Csound Csound-dev Csound-tekno Search About

if...then crash

Date2016-06-20 19:57
FromGuillermo Senna
Subjectif...then crash
Could someone try the instrument below and check if it crashes with the
current Csound from the develop branch? Thanks.

instr 1
  if p4 == 0 then
      print p4
  endif
endin


Here's what I'm getting:
*** Error in `/usr/local/bin/csound': free(): invalid next size (fast):
0x00000000007b28e0 ***
###
0x00007ffff72ad418 in __GI_raise (sig=sig@entry=6) at
../sysdeps/unix/sysv/linux/raise.c:54
54    ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff72ad418 in __GI_raise (sig=sig@entry=6) at
../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff72af01a in __GI_abort () at abort.c:89
#2  0x00007ffff72ef72a in __libc_message (do_abort=do_abort@entry=2,
    fmt=fmt@entry=0x7ffff74086b0 "*** Error in `%s': %s: 0x%s ***\n") at
../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff72f7f4a in malloc_printerr (ar_ptr=,
ptr=,
    str=0x7ffff7408728 "free(): invalid next size (fast)", action=3) at
malloc.c:5007
#4  _int_free (av=, p=, have_lock=0) at
malloc.c:3868
#5  0x00007ffff72fbabc in __GI___libc_free (mem=) at
malloc.c:2969
#6  0x00007ffff78bdabe in mfree () from /usr/local/lib/libcsound64.so.6.0
#7  0x00007ffff7b2ee97 in delete_tree () from
/usr/local/lib/libcsound64.so.6.0
#8  0x00007ffff7b2eee8 in delete_tree () from
/usr/local/lib/libcsound64.so.6.0
#9  0x00007ffff7b2ef3e in csoundDeleteTree () from
/usr/local/lib/libcsound64.so.6.0
#10 0x00007ffff7b3a66f in csoundCompileOrc () from
/usr/local/lib/libcsound64.so.6.0
#11 0x00007ffff7a3cbac in csoundCompileArgs () from
/usr/local/lib/libcsound64.so.6.0
#12 0x00007ffff7a3d999 in csoundCompile () from
/usr/local/lib/libcsound64.so.6.0
#13 0x0000000000401816 in main ()

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-06-20 20:03
Fromjpff
SubjectRe: if...then crash
yesit crases

On Mon, 20 Jun 2016, Guillermo Senna wrote:

> Could someone try the instrument below and check if it crashes with the
> current Csound from the develop branch? Thanks.
>
> instr 1
>  if p4 == 0 then
>      print p4
>  endif
> endin
>
>
> Here's what I'm getting:
> *** Error in `/usr/local/bin/csound': free(): invalid next size (fast):
> 0x00000000007b28e0 ***
> ###
> 0x00007ffff72ad418 in __GI_raise (sig=sig@entry=6) at
> ../sysdeps/unix/sysv/linux/raise.c:54
> 54    ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
> (gdb) bt
> #0  0x00007ffff72ad418 in __GI_raise (sig=sig@entry=6) at
> ../sysdeps/unix/sysv/linux/raise.c:54
> #1  0x00007ffff72af01a in __GI_abort () at abort.c:89
> #2  0x00007ffff72ef72a in __libc_message (do_abort=do_abort@entry=2,
>    fmt=fmt@entry=0x7ffff74086b0 "*** Error in `%s': %s: 0x%s ***\n") at
> ../sysdeps/posix/libc_fatal.c:175
> #3  0x00007ffff72f7f4a in malloc_printerr (ar_ptr=,
> ptr=,
>    str=0x7ffff7408728 "free(): invalid next size (fast)", action=3) at
> malloc.c:5007
> #4  _int_free (av=, p=, have_lock=0) at
> malloc.c:3868
> #5  0x00007ffff72fbabc in __GI___libc_free (mem=) at
> malloc.c:2969
> #6  0x00007ffff78bdabe in mfree () from /usr/local/lib/libcsound64.so.6.0
> #7  0x00007ffff7b2ee97 in delete_tree () from
> /usr/local/lib/libcsound64.so.6.0
> #8  0x00007ffff7b2eee8 in delete_tree () from
> /usr/local/lib/libcsound64.so.6.0
> #9  0x00007ffff7b2ef3e in csoundDeleteTree () from
> /usr/local/lib/libcsound64.so.6.0
> #10 0x00007ffff7b3a66f in csoundCompileOrc () from
> /usr/local/lib/libcsound64.so.6.0
> #11 0x00007ffff7a3cbac in csoundCompileArgs () from
> /usr/local/lib/libcsound64.so.6.0
> #12 0x00007ffff7a3d999 in csoundCompile () from
> /usr/local/lib/libcsound64.so.6.0
> #13 0x0000000000401816 in main ()
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-06-20 20:08
Fromjpff
SubjectRe: if...then crash
valgrinf shows a memory issue -- first is

==7402== Invalid write of size 1
==7402==    at 0x4C2CD4C: __strncpy_sse2_unaligned (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==7402==    by 0x50427C6: make_label (csound_orc.lex:571)
==7402==    by 0x505A4A6: create_synthetic_label 
(csound_orc_expressions.c:825)
==7402==    by 0x505A4A6: expand_if_statement 
(csound_orc_expressions.c:1129)
==7402==    by 0x50575EF: verify_tree (csound_orc_semantics.c:1775)
==7402==    by 0x50574F3: verify_tree (csound_orc_semantics.c:1726)
==7402==    by 0x5060AEF: csoundParseOrc (new_orc_parser.c:259)
==7402==    by 0x50604F7: csoundCompileOrc (csound_orc_compile.c:1764)
==7402==    by 0x4FA70A9: csoundCompileArgs (main.c:259)
==7402==    by 0x4FA7FC8: csoundCompile (main.c:513)
==7402==    by 0x40153A: main (csound_main.c:316)
==7402==  Address 0x8f78e00 is 0 bytes after a block of size 16 alloc'd
==7402==    at 0x4C2B200: calloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==7402==    by 0x4E8DA17: mcalloc (memalloc.c:113)
==7402==    by 0x5042788: make_label (csound_orc.lex:567)
==7402==    by 0x505A4A6: create_synthetic_label 
(csound_orc_expressions.c:825)
==7402==    by 0x505A4A6: expand_if_statement 
(csound_orc_expressions.c:1129)
==7402==    by 0x50575EF: verify_tree (csound_orc_semantics.c:1775)
==7402==    by 0x50574F3: verify_tree (csound_orc_semantics.c:1726)
==7402==    by 0x5060AEF: csoundParseOrc (new_orc_parser.c:259)
==7402==    by 0x50604F7: csoundCompileOrc (csound_orc_compile.c:1764)
==7402==    by 0x4FA70A9: csoundCompileArgs (main.c:259)

I think there was a recent change to labels in te parser.  What version 
are you using?

==John ff

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-06-20 20:17
FromGuillermo Senna
SubjectRe: if...then crash
Unfortunately I've just cloned the develop branch.

On 20/06/16 16:08, jpff wrote:
> valgrinf shows a memory issue -- first is
>
> ==7402== Invalid write of size 1
> ==7402==    at 0x4C2CD4C: __strncpy_sse2_unaligned (in
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==7402==    by 0x50427C6: make_label (csound_orc.lex:571)
> ==7402==    by 0x505A4A6: create_synthetic_label
> (csound_orc_expressions.c:825)
> ==7402==    by 0x505A4A6: expand_if_statement
> (csound_orc_expressions.c:1129)
> ==7402==    by 0x50575EF: verify_tree (csound_orc_semantics.c:1775)
> ==7402==    by 0x50574F3: verify_tree (csound_orc_semantics.c:1726)
> ==7402==    by 0x5060AEF: csoundParseOrc (new_orc_parser.c:259)
> ==7402==    by 0x50604F7: csoundCompileOrc (csound_orc_compile.c:1764)
> ==7402==    by 0x4FA70A9: csoundCompileArgs (main.c:259)
> ==7402==    by 0x4FA7FC8: csoundCompile (main.c:513)
> ==7402==    by 0x40153A: main (csound_main.c:316)
> ==7402==  Address 0x8f78e00 is 0 bytes after a block of size 16 alloc'd
> ==7402==    at 0x4C2B200: calloc (in
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==7402==    by 0x4E8DA17: mcalloc (memalloc.c:113)
> ==7402==    by 0x5042788: make_label (csound_orc.lex:567)
> ==7402==    by 0x505A4A6: create_synthetic_label
> (csound_orc_expressions.c:825)
> ==7402==    by 0x505A4A6: expand_if_statement
> (csound_orc_expressions.c:1129)
> ==7402==    by 0x50575EF: verify_tree (csound_orc_semantics.c:1775)
> ==7402==    by 0x50574F3: verify_tree (csound_orc_semantics.c:1726)
> ==7402==    by 0x5060AEF: csoundParseOrc (new_orc_parser.c:259)
> ==7402==    by 0x50604F7: csoundCompileOrc (csound_orc_compile.c:1764)
> ==7402==    by 0x4FA70A9: csoundCompileArgs (main.c:259)
>
> I think there was a recent change to labels in te parser.  What
> version are you using?
>
> ==John ff
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-06-20 20:40
Fromjpff
SubjectRe: if...then crash
Fixed in git

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-06-20 21:07
FromGuillermo Senna
SubjectRe: if...then crash
Thanks John! Seems to work now.

On 20/06/16 16:40, jpff wrote:
> Fixed in git
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here