[chuck-dev] weird crash

Spencer Salazar spencer at ccrma.stanford.edu
Wed Nov 20 01:54:03 EST 2013


Thanks Philipp- the issue here is that chuck doesn't cleanly handle the
situation where a function is declared to return something, but no return
statement is ever actually executed in the function definition. Calling
such a function more than a few times is almost guaranteed to cause a
crash, though it depends on the code around the function call too.

This is actually a somewhat difficult bug to solve -- we've known about it
for a while, but haven't come up with a good fix yet.

spencer


On Sun, Nov 17, 2013 at 8:05 PM, Philipp Kroos <philipp.kroos at gmail.com>wrote:

> Hi guys,
>
> I can reliably crash the VM with the following file if I uncomment the
> crashes()-function call.
> Sorry for the formatting. The really most weird thing is that the
> crash is 'triggered' only if I loop more then 4 times...
> Following the file you'll find the output of uname -a and chuck
> --version, and the backtrace.
> I wasn't sure if I should post here or on the users list, but since
> I'm a programmer I decided for this list. So let me
> know if you have any ideas that I could try out.
>
> Cheers, Philipp
>
>
>
> /* chuck file start */
> fun int dontCallMe () {
> }
>
> fun int iamOk () {
> return 0;
> }
>
> fun void crashes () {
> for (0 => int j; j < 5; j++) {
> dontCallMe ();
> 1::ms => now;
> }
> }
>
> fun void crashesNot () {
> for (0 => int j; j < 5; j++) {
> iamOk ();
> 1::ms => now;
> }
> }
>
> fun void thisNeither () {
> for (0 => int j; j < 4; j++) {
> dontCallMe ();
> 1::ms => now;
> }
> }
>
>
> //crashes ();
> crashesNot ();
> thisNeither ();
>
> /* chuck file end */
>
>
> chuck --version:
> chuck version: 1.3.2.0 (chimera)
>    linux (jack) : 32-bit
>    http://chuck.cs.princeton.edu/
>    http://chuck.stanford.edu/
>
>
> uname -a:
> Linux vostro 3.11.6-1-ARCH #1 SMP PREEMPT Sat Oct 19 00:29:46 CEST
> 2013 i686 GNU/Linux
>
>
>
> *** Error in `chuck': double free or corruption (!prev): 0x085399f0 ***
> ======= Backtrace: =========
> /usr/lib/libc.so.6(+0x6d6b3)[0xb72946b3]
> /usr/lib/libc.so.6(+0x7381a)[0xb729a81a]
> /usr/lib/libc.so.6(+0x7445c)[0xb729b45c]
> /usr/lib/libstdc++.so.6(_ZdlPv+0x1f)[0xb7515a0f]
> /usr/lib/libstdc++.so.6(_ZdaPv+0x1b)[0xb7515a5b]
> chuck[0x805d572]
> chuck[0x805d759]
> chuck[0x805d930]
> chuck[0x805b82f]
> chuck[0x805ba08]
> chuck[0x805bab0]
> chuck[0x805085d]
> /usr/lib/libc.so.6(__libc_start_main+0xf3)[0xb72409d3]
> chuck[0x8052b69]
> ======= Memory map: ========
> 08048000-081bc000 r-xp 00000000 08:09 3151140
> /home/philipp/Audio/Chuck/ChuckSource/chuck-1.3.2.0/src/chuck
> 081bc000-081e3000 rw-p 00173000 08:09 3151140
> /home/philipp/Audio/Chuck/ChuckSource/chuck-1.3.2.0/src/chuck
> 081e3000-08226000 rw-p 00000000 00:00 0
> 083cb000-0855a000 rw-p 00000000 00:00 0          [heap]
> b0b00000-b0b21000 rw-p 00000000 00:00 0
> b0b21000-b0c00000 ---p 00000000 00:00 0
> b0d00000-b0d21000 rw-p 00000000 00:00 0
> b0d21000-b0e00000 ---p 00000000 00:00 0
> b0e87000-b0e88000 ---p 00000000 00:00 0
> b0e88000-b1688000 rw-p 00000000 00:00 0          [stack:9315]
> b1688000-b1689000 ---p 00000000 00:00 0
> b1689000-b1e89000 rw-p 00000000 00:00 0
> b6d00000-b6d21000 rw-p 00000000 00:00 0
> b6d21000-b6e00000 ---p 00000000 00:00 0
> b6e68000-b6e69000 ---p 00000000 00:00 0
> b6e69000-b6ee9000 rw-p 00000000 00:00 0
> b6ee9000-b6eea000 ---p 00000000 00:00 0
> b6eea000-b6f6a000 rw-p 00000000 00:00 0
> b6f6a000-b6f6b000 ---p 00000000 00:00 0
> b6f6b000-b6fef000 rw-p 00000000 00:00 0
> b6fef000-b6ff5000 r-xp 00000000 08:05 161673     /usr/lib/libogg.so.0.8.1
> b6ff5000-b6ff6000 r--p 00005000 08:05 161673     /usr/lib/libogg.so.0.8.1
> b6ff6000-b6ff7000 rw-p 00006000 08:05 161673     /usr/lib/libogg.so.0.8.1
> b6ff7000-b7021000 r-xp 00000000 08:05 152013
> /usr/lib/libvorbis.so.0.4.6
> b7021000-b7022000 r--p 00029000 08:05 152013
> /usr/lib/libvorbis.so.0.4.6
> b7022000-b7023000 rw-p 0002a000 08:05 152013
> /usr/lib/libvorbis.so.0.4.6
> b7023000-b7189000 r-xp 00000000 08:05 152016
> /usr/lib/libvorbisenc.so.2.0.9
> b7189000-b719a000 r--p 00165000 08:05 152016
> /usr/lib/libvorbisenc.so.2.0.9
> b719a000-b719b000 rw-p 00176000 08:05 152016
> /usr/lib/libvorbisenc.so.2.0.9
> b719b000-b71cf000 r-xp 00000000 08:05 151995     /usr/lib/libFLAC.so.8.3.0
> b71cf000-b71d0000 r--p 00034000 08:05 151995     /usr/lib/libFLAC.so.8.3.0
> b71d0000-b71d1000 rw-p 00035000 08:05 151995     /usr/lib/libFLAC.so.8.3.0
> b71d1000-b721b000 r-xp 00000000 08:05 139847
> /usr/lib/libdbus-1.so.3.7.5
> b721b000-b721c000 r--p 00049000 08:05 139847
> /usr/lib/libdbus-1.so.3.7.5
> b721c000-b721d000 rw-p 0004a000 08:05 139847
> /usr/lib/libdbus-1.so.3.7.5
> b721d000-b721e000 rw-p 00000000 00:00 0
> b721e000-b7225000 r-xp 00000000 08:05 133596     /usr/lib/librt-2.18.so
> b7225000-b7226000 r--p 00006000 08:05 133596     /usr/lib/librt-2.18.so
> b7226000-b7227000 rw-p 00007000 08:05 133596     /usr/lib/librt-2.18.so
> b7227000-b73d0000 r-xp 00000000 08:05 132898     /usr/lib/libc-2.18.so
> b73d0000-b73d1000 ---p 001a9000 08:05 132898     /usr/lib/libc-2.18.so
> b73d1000-b73d3000 r--p 001a9000 08:05 132898     /usr/lib/libc-2.18.so
> b73d3000-b73d4000 rw-p 001ab000 08:05 132898     /usr/lib/libc-2.18.so
> b73d4000-b73d7000 rw-p 00000000 00:00 0
> b73d7000-b73f2000 r-xp 00000000 08:05 133144     /usr/lib/libgcc_s.so.1
> b73f2000-b73f3000 rw-p 0001a000 08:05 133144     /usr/lib/libgcc_s.so.1
> b73f3000-b7437000 r-xp 00000000 08:05 132897     /usr/lib/libm-2.18.so
> b7437000-b7438000 r--p 00043000 08:05 132897     /usr/lib/libm-2.18.so
> b7438000-b7439000 rw-p 00044000 08:05 132897     /usr/lib/libm-2.18.so
> b7439000-b7451000 r-xp 00000000 08:05 132847     /usr/lib/
> libpthread-2.18.so
> b7451000-b7452000 r--p 00017000 08:05 132847     /usr/lib/
> libpthread-2.18.so
> b7452000-b7453000 rw-p 00018000 08:05 132847     /usr/lib/
> libpthread-2.18.so
> b7453000-b7456000 rw-p 00000000 00:00 0
> b7456000-b74c1000 r-xp 00000000 08:05 152046
> /usr/lib/libsndfile.so.1.0.25
> b74c1000-b74c3000 r--p 0006a000 08:05 152046
> /usr/lib/libsndfile.so.1.0.25
> b74c3000-b74c4000 rw-p 0006c000 08:05 152046
> /usr/lib/libsndfile.so.1.0.25
> b74c4000-b74c8000 rw-p 00000000 00:00 0
> b74c8000-b74cb000 r-xp 00000000 08:05 133597     /usr/lib/libdl-2.18.so
> b74cb000-b74cc000 r--p 00002000 08:05 133597     /usr/lib/libdl-2.18.so
> b74cc000-b74cd000 rw-p 00003000 08:05 133597     /usr/lib/libdl-2.18.so
> b74cd000-b75aa000 r-xp 00000000 08:05 133135
> /usr/lib/libstdc++.so.6.0.18
> b75aa000-b75ae000 r--p 000dc000 08:05 133135
> /usr/lib/libstdc++.so.6.0.18
> b75ae000-b75af000 rw-p 000e0000 08:05 133135
> /usr/lib/libstdc++.so.6.0.18
> b75af000-b75b6000 rw-p 00000000 00:00 0
> b75b6000-b75fa000 r-xp 00000000 08:05 172795     /usr/lib/libjack.so.0.1.0
> b75fa000-b75fc000 r--p 00043000 08:05 172795     /usr/lib/libjack.so.0.1.0
> b75fc000-b75fd000 rw-p 00045000 08:05 172795     /usr/lib/libjack.so.0.1.0
> b75fd000-b76f1000 r-xp 00000000 08:05 139859
> /usr/lib/libasound.so.2.0.0
> b76f1000-b76f5000 r--p 000f3000 08:05 139859
> /usr/lib/libasound.so.2.0.0
> b76f5000-b76f6000 rw-p 000f7000 08:05 139859
> /usr/lib/libasound.so.2.0.0
> b770d000-b771f000 rw-s 00000000 00:10 17126      /dev/shm/jack-shm-registry
> b7721000-b7723000 rw-p 00000000 00:00 0
> b7723000-b7724000 r-xp 00000000 00:00 0          [vdso]
> b7724000-b7744000 r-xp 00000000 08:05 132873     /usr/lib/ld-2.18.so
> b7744000-b7745000 r--p 0001f000 08:05 132873     /usr/lib/ld-2.18.so
> b7745000-b7746000 rw-p 00020000 08:05 132873     /usr/lib/ld-2.18.so
> bfcd6000-bfcf7000 rw-p 00000000 00:00 0          [stack]
> zsh: abort (core dumped)  chuck debug.ck
> _______________________________________________
> chuck-dev mailing list
> chuck-dev at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-dev/attachments/20131119/da3bc95a/attachment.html>


More information about the chuck-dev mailing list