Re: [chuck-users] 147th shred removed...segmentation fault? (Ryan Supak)
I have lots of programs that spork hundreds or thousands of shreds without this error. So, without seeing your code, my guesses (and questions) are as follows: Are you running this on a small memory architecture? Since you say headless, I'm guessing maybe Raspberry Pi? It could be that you're running out of memory, so see next question. Does the shred that you're sporking declare new UGs or require memory to be allocated (arrays, lots of string manipulation, etc.)? In general, this is a bad idea if you can avoid it. ChucK does no garbage collection, which means that you need to be cautious about declaring memory. So even a shred as simple as: fun void mySine() { SinOsc s => dac; Math.random2f(100,1000) => s.freq; second => now; s =< dac; } will eat up memory, because even though the SinOsc is unchucked and never computes again, the memory for that structure is still around. We want, someday to make ChucK a proper garbage collecting language, but it's hard, especially for real-time systems. If this turns out to be your issue, then one way to handle this is to make a global pool of fixed resources and have your shred grab from that. Like classic "round robin voice stealing" in synthesizers: SinOsc s[100]; 0 => int next2Use; fun void mySine() { next2Use => int thisOne; 1 +=> next2Use; if (next2Use > 99) 0 => next2Use; s[thisOne] => dac; Math.random2f(100,1000) => s[thisOne].freq; second => now; s[thisOne] =< dac; } // to test: while (1) { Math.random2f(0.01,0.1) :: second => now; spork ~ mySine(); } I just fired up a few dozen of these running in parallel, VM showed 2600 total shreds running, no problem (and no clicks or dropouts!!). Hope this helps, if none of this applies, then you may have discovered a strange bug. Source code please, and we can all scratch our heads on it. Thanx!! PRC Today's Topics: 1. 147th shred removed...segmentation fault? (Ryan Supak)
Thanks for the thorough reply. I'm doing one safer, even than "voice
stealing": each Spork is, at most, reconfiguring a single global oscillator.
Attached is the entire source. Lines 128-142 contain initialization code
that creates a Shred to make an LED blink by sending a MIDI message within
a time loop, and another Shred that sets the frequency of an LFO, polls it
every ten milliseconds, and sends some Serial output based on the LFO
position.
Anytime that the parameters controlling the blinking rate and the LFO
rate/phase have occasion to change (when MIDI events come in to change
them), the "old" Shreds are Machine.Remove'd and they're recreated
immediately following. You can see this at lines 343 and 589.
Notice that the LFOMod function and the Blink function aren't creating
anything new (with the exception of local arguments being instantiated),
but if you think those local arguments could be causing my problem I'll
eliminate them too.
Please see the attached.
rs
On Mon, Jun 23, 2014 at 11:59 AM, Perry R Cook
I have lots of programs that spork hundreds or thousands of shreds without this error. So, without seeing your code, my guesses (and questions) are as follows:
Are you running this on a small memory architecture? Since you say headless, I'm guessing maybe Raspberry Pi? It could be that you're running out of memory, so see next question.
Does the shred that you're sporking declare new UGs or require memory to be allocated (arrays, lots of string manipulation, etc.)? In general, this is a bad idea if you can avoid it. ChucK does no garbage collection, which means that you need to be cautious about declaring memory.
So even a shred as simple as:
fun void mySine() { SinOsc s => dac; Math.random2f(100,1000) => s.freq; second => now; s =< dac; }
will eat up memory, because even though the SinOsc is unchucked and never computes again, the memory for that structure is still around. We want, someday to make ChucK a proper garbage collecting language, but it's hard, especially for real-time systems.
If this turns out to be your issue, then one way to handle this is to make a global pool of fixed resources and have your shred grab from that. Like classic "round robin voice stealing" in synthesizers:
SinOsc s[100]; 0 => int next2Use;
fun void mySine() { next2Use => int thisOne; 1 +=> next2Use; if (next2Use > 99) 0 => next2Use; s[thisOne] => dac; Math.random2f(100,1000) => s[thisOne].freq; second => now; s[thisOne] =< dac; }
// to test: while (1) { Math.random2f(0.01,0.1) :: second => now; spork ~ mySine(); }
I just fired up a few dozen of these running in parallel, VM showed 2600 total shreds running, no problem (and no clicks or dropouts!!).
Hope this helps, if none of this applies, then you may have discovered a strange bug. Source code please, and we can all scratch our heads on it.
Thanx!! PRC
Today's Topics:
1. 147th shred removed...segmentation fault? (Ryan Supak) _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Update: I eliminated everything I could from the Shreds that were being
Sporked, and I still get the exact same error (at exactly 147 Shreds.)
Here is what I shortened the Shreds to:
fun void Blink()
{
while( true )
{
50::ms => now;
}
}
fun void LFOMod()
{
while( true )
{
50::ms => now;
}
}
On Mon, Jun 23, 2014 at 4:22 PM, Ryan Supak
Thanks for the thorough reply. I'm doing one safer, even than "voice stealing": each Spork is, at most, reconfiguring a single global oscillator.
Attached is the entire source. Lines 128-142 contain initialization code that creates a Shred to make an LED blink by sending a MIDI message within a time loop, and another Shred that sets the frequency of an LFO, polls it every ten milliseconds, and sends some Serial output based on the LFO position.
Anytime that the parameters controlling the blinking rate and the LFO rate/phase have occasion to change (when MIDI events come in to change them), the "old" Shreds are Machine.Remove'd and they're recreated immediately following. You can see this at lines 343 and 589.
Notice that the LFOMod function and the Blink function aren't creating anything new (with the exception of local arguments being instantiated), but if you think those local arguments could be causing my problem I'll eliminate them too.
Please see the attached. rs
On Mon, Jun 23, 2014 at 11:59 AM, Perry R Cook
wrote: I have lots of programs that spork hundreds or thousands of shreds without this error. So, without seeing your code, my guesses (and questions) are as follows:
Are you running this on a small memory architecture? Since you say headless, I'm guessing maybe Raspberry Pi? It could be that you're running out of memory, so see next question.
Does the shred that you're sporking declare new UGs or require memory to be allocated (arrays, lots of string manipulation, etc.)? In general, this is a bad idea if you can avoid it. ChucK does no garbage collection, which means that you need to be cautious about declaring memory.
So even a shred as simple as:
fun void mySine() { SinOsc s => dac; Math.random2f(100,1000) => s.freq; second => now; s =< dac; }
will eat up memory, because even though the SinOsc is unchucked and never computes again, the memory for that structure is still around. We want, someday to make ChucK a proper garbage collecting language, but it's hard, especially for real-time systems.
If this turns out to be your issue, then one way to handle this is to make a global pool of fixed resources and have your shred grab from that. Like classic "round robin voice stealing" in synthesizers:
SinOsc s[100]; 0 => int next2Use;
fun void mySine() { next2Use => int thisOne; 1 +=> next2Use; if (next2Use > 99) 0 => next2Use; s[thisOne] => dac; Math.random2f(100,1000) => s[thisOne].freq; second => now; s[thisOne] =< dac; }
// to test: while (1) { Math.random2f(0.01,0.1) :: second => now; spork ~ mySine(); }
I just fired up a few dozen of these running in parallel, VM showed 2600 total shreds running, no problem (and no clicks or dropouts!!).
Hope this helps, if none of this applies, then you may have discovered a strange bug. Source code please, and we can all scratch our heads on it.
Thanx!! PRC
Today's Topics:
1. 147th shred removed...segmentation fault? (Ryan Supak) _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Interesting find, even this simple example blows for me
dmxBug.ck:
fun void blink()
{
while (true)
{
50::ms => now;
}
}
Shred shred;
spork ~ blink() @=> shred;
0 => int count;
while (true)
{
200::ms => now;
shred.id() => Machine.remove;
spork ~ blink() @=> shred;
<<<"count", count>>>;
}
$ chuck --silent examples/dmxBug.ck
...
[chuck](VM): removing shred: 144 (spork~exp)...
count 0
[chuck](VM): removing shred: 145 (spork~exp)...
count 0
[chuck](VM): removing shred: 146 (spork~exp)...
Segmentation fault: 11
michael
On Mon, Jun 23, 2014 at 5:17 PM, Ryan Supak
Update: I eliminated everything I could from the Shreds that were being Sporked, and I still get the exact same error (at exactly 147 Shreds.)
Here is what I shortened the Shreds to:
fun void Blink() { while( true ) { 50::ms => now; } }
fun void LFOMod() { while( true ) { 50::ms => now; } }
On Mon, Jun 23, 2014 at 4:22 PM, Ryan Supak
wrote: Thanks for the thorough reply. I'm doing one safer, even than "voice stealing": each Spork is, at most, reconfiguring a single global oscillator.
Attached is the entire source. Lines 128-142 contain initialization code that creates a Shred to make an LED blink by sending a MIDI message within a time loop, and another Shred that sets the frequency of an LFO, polls it every ten milliseconds, and sends some Serial output based on the LFO position.
Anytime that the parameters controlling the blinking rate and the LFO rate/phase have occasion to change (when MIDI events come in to change them), the "old" Shreds are Machine.Remove'd and they're recreated immediately following. You can see this at lines 343 and 589.
Notice that the LFOMod function and the Blink function aren't creating anything new (with the exception of local arguments being instantiated), but if you think those local arguments could be causing my problem I'll eliminate them too.
Please see the attached. rs
On Mon, Jun 23, 2014 at 11:59 AM, Perry R Cook
wrote: I have lots of programs that spork hundreds or thousands of shreds without this error. So, without seeing your code, my guesses (and questions) are as follows:
Are you running this on a small memory architecture? Since you say headless, I'm guessing maybe Raspberry Pi? It could be that you're running out of memory, so see next question.
Does the shred that you're sporking declare new UGs or require memory to be allocated (arrays, lots of string manipulation, etc.)? In general, this is a bad idea if you can avoid it. ChucK does no garbage collection, which means that you need to be cautious about declaring memory.
So even a shred as simple as:
fun void mySine() { SinOsc s => dac; Math.random2f(100,1000) => s.freq; second => now; s =< dac; }
will eat up memory, because even though the SinOsc is unchucked and never computes again, the memory for that structure is still around. We want, someday to make ChucK a proper garbage collecting language, but it's hard, especially for real-time systems.
If this turns out to be your issue, then one way to handle this is to make a global pool of fixed resources and have your shred grab from that. Like classic "round robin voice stealing" in synthesizers:
SinOsc s[100]; 0 => int next2Use;
fun void mySine() { next2Use => int thisOne; 1 +=> next2Use; if (next2Use > 99) 0 => next2Use; s[thisOne] => dac; Math.random2f(100,1000) => s[thisOne].freq; second => now; s[thisOne] =< dac; }
// to test: while (1) { Math.random2f(0.01,0.1) :: second => now; spork ~ mySine(); }
I just fired up a few dozen of these running in parallel, VM showed 2600 total shreds running, no problem (and no clicks or dropouts!!).
Hope this helps, if none of this applies, then you may have discovered a strange bug. Source code please, and we can all scratch our heads on it.
Thanx!! PRC
Today's Topics:
1. 147th shred removed...segmentation fault? (Ryan Supak) _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Oops, forgot to increment count
<<<"count", count++>>>;
...
$ chuck --silent examples/dmxBug.ck
[chuck](VM): removing shred: 2 (spork~exp)...
count 0
[chuck](VM): removing shred: 3 (spork~exp)...
count 1
...
[chuck](VM): removing shred: 144 (spork~exp)...
count 142
[chuck](VM): removing shred: 145 (spork~exp)...
count 143
[chuck](VM): removing shred: 146 (spork~exp)...
Segmentation fault: 11
On Mon, Jun 23, 2014 at 5:31 PM, Michael Heuer
Interesting find, even this simple example blows for me
dmxBug.ck:
fun void blink() { while (true) { 50::ms => now; } }
Shred shred; spork ~ blink() @=> shred;
0 => int count;
while (true) { 200::ms => now; shred.id() => Machine.remove; spork ~ blink() @=> shred; <<<"count", count>>>; }
$ chuck --silent examples/dmxBug.ck ... [chuck](VM): removing shred: 144 (spork~exp)... count 0 [chuck](VM): removing shred: 145 (spork~exp)... count 0 [chuck](VM): removing shred: 146 (spork~exp)... Segmentation fault: 11
michael
On Mon, Jun 23, 2014 at 5:17 PM, Ryan Supak
wrote: Update: I eliminated everything I could from the Shreds that were being Sporked, and I still get the exact same error (at exactly 147 Shreds.)
Here is what I shortened the Shreds to:
fun void Blink() { while( true ) { 50::ms => now; } }
fun void LFOMod() { while( true ) { 50::ms => now; } }
On Mon, Jun 23, 2014 at 4:22 PM, Ryan Supak
wrote: Thanks for the thorough reply. I'm doing one safer, even than "voice stealing": each Spork is, at most, reconfiguring a single global oscillator.
Attached is the entire source. Lines 128-142 contain initialization code that creates a Shred to make an LED blink by sending a MIDI message within a time loop, and another Shred that sets the frequency of an LFO, polls it every ten milliseconds, and sends some Serial output based on the LFO position.
Anytime that the parameters controlling the blinking rate and the LFO rate/phase have occasion to change (when MIDI events come in to change them), the "old" Shreds are Machine.Remove'd and they're recreated immediately following. You can see this at lines 343 and 589.
Notice that the LFOMod function and the Blink function aren't creating anything new (with the exception of local arguments being instantiated), but if you think those local arguments could be causing my problem I'll eliminate them too.
Please see the attached. rs
On Mon, Jun 23, 2014 at 11:59 AM, Perry R Cook
wrote: I have lots of programs that spork hundreds or thousands of shreds without this error. So, without seeing your code, my guesses (and questions) are as follows:
Are you running this on a small memory architecture? Since you say headless, I'm guessing maybe Raspberry Pi? It could be that you're running out of memory, so see next question.
Does the shred that you're sporking declare new UGs or require memory to be allocated (arrays, lots of string manipulation, etc.)? In general, this is a bad idea if you can avoid it. ChucK does no garbage collection, which means that you need to be cautious about declaring memory.
So even a shred as simple as:
fun void mySine() { SinOsc s => dac; Math.random2f(100,1000) => s.freq; second => now; s =< dac; }
will eat up memory, because even though the SinOsc is unchucked and never computes again, the memory for that structure is still around. We want, someday to make ChucK a proper garbage collecting language, but it's hard, especially for real-time systems.
If this turns out to be your issue, then one way to handle this is to make a global pool of fixed resources and have your shred grab from that. Like classic "round robin voice stealing" in synthesizers:
SinOsc s[100]; 0 => int next2Use;
fun void mySine() { next2Use => int thisOne; 1 +=> next2Use; if (next2Use > 99) 0 => next2Use; s[thisOne] => dac; Math.random2f(100,1000) => s[thisOne].freq; second => now; s[thisOne] =< dac; }
// to test: while (1) { Math.random2f(0.01,0.1) :: second => now; spork ~ mySine(); }
I just fired up a few dozen of these running in parallel, VM showed 2600 total shreds running, no problem (and no clicks or dropouts!!).
Hope this helps, if none of this applies, then you may have discovered a strange bug. Source code please, and we can all scratch our heads on it.
Thanx!! PRC
Today's Topics:
1. 147th shred removed...segmentation fault? (Ryan Supak) _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Yuck, it behaves badly on Mac, but even worse on RPi. I get to maybe 30
shreds before it tanks... rs
On Mon, Jun 23, 2014 at 5:33 PM, Michael Heuer
Oops, forgot to increment count
<<<"count", count++>>>;
...
$ chuck --silent examples/dmxBug.ck [chuck](VM): removing shred: 2 (spork~exp)... count 0 [chuck](VM): removing shred: 3 (spork~exp)... count 1 ... [chuck](VM): removing shred: 144 (spork~exp)... count 142 [chuck](VM): removing shred: 145 (spork~exp)... count 143 [chuck](VM): removing shred: 146 (spork~exp)... Segmentation fault: 11
On Mon, Jun 23, 2014 at 5:31 PM, Michael Heuer
wrote: Interesting find, even this simple example blows for me
dmxBug.ck:
fun void blink() { while (true) { 50::ms => now; } }
Shred shred; spork ~ blink() @=> shred;
0 => int count;
while (true) { 200::ms => now; shred.id() => Machine.remove; spork ~ blink() @=> shred; <<<"count", count>>>; }
$ chuck --silent examples/dmxBug.ck ... [chuck](VM): removing shred: 144 (spork~exp)... count 0 [chuck](VM): removing shred: 145 (spork~exp)... count 0 [chuck](VM): removing shred: 146 (spork~exp)... Segmentation fault: 11
michael
On Mon, Jun 23, 2014 at 5:17 PM, Ryan Supak
wrote: Update: I eliminated everything I could from the Shreds that were being Sporked, and I still get the exact same error (at exactly 147 Shreds.)
Here is what I shortened the Shreds to:
fun void Blink() { while( true ) { 50::ms => now; } }
fun void LFOMod() { while( true ) { 50::ms => now; } }
On Mon, Jun 23, 2014 at 4:22 PM, Ryan Supak
wrote: Thanks for the thorough reply. I'm doing one safer, even than "voice stealing": each Spork is, at most, reconfiguring a single global
oscillator.
Attached is the entire source. Lines 128-142 contain initialization
code
that creates a Shred to make an LED blink by sending a MIDI message within a time loop, and another Shred that sets the frequency of an LFO, polls it every ten milliseconds, and sends some Serial output based on the LFO position.
Anytime that the parameters controlling the blinking rate and the LFO rate/phase have occasion to change (when MIDI events come in to change them), the "old" Shreds are Machine.Remove'd and they're recreated immediately following. You can see this at lines 343 and 589.
Notice that the LFOMod function and the Blink function aren't creating anything new (with the exception of local arguments being instantiated), but if you think those local arguments could be causing my problem I'll eliminate them too.
Please see the attached. rs
On Mon, Jun 23, 2014 at 11:59 AM, Perry R Cook
wrote: I have lots of programs that spork hundreds or thousands of shreds without this error. So, without seeing your code, my guesses (and questions) are as follows:
Are you running this on a small memory architecture? Since you say headless, I'm guessing maybe Raspberry Pi? It could be that you're running out of memory, so see next question.
Does the shred that you're sporking declare new UGs or require memory to be allocated (arrays, lots of string manipulation, etc.)? In general, this is a bad idea if you can avoid it. ChucK does no garbage collection, which means that you need to be cautious about declaring memory.
So even a shred as simple as:
fun void mySine() { SinOsc s => dac; Math.random2f(100,1000) => s.freq; second => now; s =< dac; }
will eat up memory, because even though the SinOsc is unchucked and never computes again, the memory for that structure is still around. We want, someday to make ChucK a proper garbage collecting language, but it's hard, especially for real-time systems.
If this turns out to be your issue, then one way to handle this is to make a global pool of fixed resources and have your shred grab from that. Like classic "round robin voice stealing" in synthesizers:
SinOsc s[100]; 0 => int next2Use;
fun void mySine() { next2Use => int thisOne; 1 +=> next2Use; if (next2Use > 99) 0 => next2Use; s[thisOne] => dac; Math.random2f(100,1000) => s[thisOne].freq; second => now; s[thisOne] =< dac; }
// to test: while (1) { Math.random2f(0.01,0.1) :: second => now; spork ~ mySine(); }
I just fired up a few dozen of these running in parallel, VM showed 2600 total shreds running, no problem (and no clicks or dropouts!!).
Hope this helps, if none of this applies, then you may have discovered a strange bug. Source code please, and we can all scratch our heads on it.
Thanx!! PRC
Today's Topics:
1. 147th shred removed...segmentation fault? (Ryan Supak) _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
On linux, my example works fine with 1.3.3.0
...
[chuck](VM): removing shred: 35000 (spork~exp)...
count 34998
[chuck](VM): removing shred: 35001 (spork~exp)...
count 34999
^C[chuck]: cleaning up...
but not with 1.3.4.0 built with alsa support
$ ./chuck --silent ~/working/lick/examples/dmxBug.ck
[chuck](VM): removing shred: 2 (spork~exp)...
count 0
[chuck](VM): removing shred: 3 (spork~exp)...
count 1
[chuck](VM): removing shred: 4 (spork~exp)...
count 2
[chuck](VM): removing shred: 5 (spork~exp)...
count 3
[chuck](VM): removing shred: 6 (spork~exp)...
count 4
[chuck](VM): removing shred: 7 (spork~exp)...
count 5
[chuck](VM): removing shred: 8 (spork~exp)...
count 6
[chuck](VM): removing shred: 9 (spork~exp)...
count 7
[chuck](VM): removing shred: 10 (spork~exp)...
count 8
[chuck](VM): removing shred: 11 (spork~exp)...
count 9
[chuck](VM): removing shred: 12 (spork~exp)...
count 10
[chuck](VM): removing shred: 13 (spork~exp)...
count 11
[chuck](VM): removing shred: 14 (spork~exp)...
count 12
[chuck](VM): removing shred: 15 (spork~exp)...
count 13
[chuck](VM): removing shred: 16 (spork~exp)...
count 14
[chuck](VM): removing shred: 17 (spork~exp)...
count 15
[chuck](VM): removing shred: 18 (spork~exp)...
count 16
[chuck](VM): removing shred: 19 (spork~exp)...
count 17
[chuck](VM): removing shred: 20 (spork~exp)...
count 18
[chuck](VM): removing shred: 21 (spork~exp)...
count 19
[chuck](VM): removing shred: 22 (spork~exp)...
count 20
[chuck](VM): removing shred: 23 (spork~exp)...*** buffer overflow
detected ***: ./chuck terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7fd43586cf47]
/lib/x86_64-linux-gnu/libc.so.6(+0x109e40)[0x7fd43586be40]
/lib/x86_64-linux-gnu/libc.so.6(+0x108d13)[0x7fd43586ad13]
./chuck[0x41585a]
./chuck[0x41cabb]
./chuck[0x46d898]
./chuck[0x50517f]
./chuck[0x4245d0]
./chuck[0x418d0e]
./chuck[0x41dbd2]
./chuck[0x41e077]
./chuck[0x40b6fd]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7fd43578376d]
./chuck[0x40dc55]
======= Memory map: ========
00400000-0059d000 r-xp 00000000 08:03 269080
/home/heuermh/bin/chuck-1.3.4.0/src/chuck
0079d000-0079e000 r--p 0019d000 08:03 269080
/home/heuermh/bin/chuck-1.3.4.0/src/chuck
0079e000-007c5000 rw-p 0019e000 08:03 269080
/home/heuermh/bin/chuck-1.3.4.0/src/chuck
007c5000-0084a000 rw-p 00000000 00:00 0
01db2000-020f9000 rw-p 00000000 00:00 0 [heap]
7fd428000000-7fd428021000 rw-p 00000000 00:00 0
7fd428021000-7fd42c000000 ---p 00000000 00:00 0
7fd42f3d8000-7fd42f3d9000 ---p 00000000 00:00 0
7fd42f3d9000-7fd42fbd9000 rw-p 00000000 00:00 0
7fd42fbd9000-7fd42fbdd000 r-xp 00000000 08:03 802428
/usr/lib/chuck/GVerb.chug
7fd42fbdd000-7fd42fddd000 ---p 00004000 08:03 802428
/usr/lib/chuck/GVerb.chug
7fd42fddd000-7fd42fdde000 r--p 00004000 08:03 802428
/usr/lib/chuck/GVerb.chug
7fd42fdde000-7fd42fddf000 rw-p 00005000 08:03 802428
/usr/lib/chuck/GVerb.chug
7fd42fddf000-7fd42fde1000 r-xp 00000000 08:03 802423
/usr/lib/chuck/KasFilter.chug
7fd42fde1000-7fd42ffe0000 ---p 00002000 08:03 802423
/usr/lib/chuck/KasFilter.chug
7fd42ffe0000-7fd42ffe1000 r--p 00001000 08:03 802423
/usr/lib/chuck/KasFilter.chug
7fd42ffe1000-7fd42ffe2000 rw-p 00002000 08:03 802423
/usr/lib/chuck/KasFilter.chug
7fd42ffe2000-7fd42fff0000 r-xp 00000000 08:03 802430
/usr/lib/chuck/Spectacle.chug
7fd42fff0000-7fd4301ef000 ---p 0000e000 08:03 802430
/usr/lib/chuck/Spectacle.chug
7fd4301ef000-7fd4301f0000 r--p 0000d000 08:03 802430
/usr/lib/chuck/Spectacle.chug
7fd4301f0000-7fd4301f1000 rw-p 0000e000 08:03 802430
/usr/lib/chuck/Spectacle.chug
7fd4301f1000-7fd430209000 r-xp 00000000 08:03 3411496
/lib/x86_64-linux-gnu/libresolv-2.15.so
7fd430209000-7fd430409000 ---p 00018000 08:03 3411496
/lib/x86_64-linux-gnu/libresolv-2.15.so
7fd430409000-7fd43040a000 r--p 00018000 08:03 3411496
/lib/x86_64-linux-gnu/libresolv-2.15.so
7fd43040a000-7fd43040b000 rw-p 00019000 08:03 3411496
/lib/x86_64-linux-gnu/libresolv-2.15.so
7fd43040b000-7fd43040d000 rw-p 00000000 00:00 0
7fd43040d000-7fd430424000 r-xp 00000000 08:03 3411602
/lib/x86_64-linux-gnu/libnsl-2.15.so
7fd430424000-7fd430623000 ---p 00017000 08:03 3411602
/lib/x86_64-linux-gnu/libnsl-2.15.so
7fd430623000-7fd430624000 r--p 00016000 08:03 3411602
/lib/x86_64-linux-gnu/libnsl-2.15.so
7fd430624000-7fd430625000 rw-p 00017000 08:03 3411602
/lib/x86_64-linux-gnu/libnsl-2.15.so
7fd430625000-7fd430627000 rw-p 00000000 00:00 0
7fd430627000-7fd43062c000 r-xp 00000000 08:03 663153
/usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7fd43062c000-7fd43082b000 ---p 00005000 08:03 663153
/usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7fd43082b000-7fd43082c000 r--p 00004000 08:03 663153
/usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7fd43082c000-7fd43082d000 rw-p 00005000 08:03 663153
/usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7fd43082d000-7fd43082f000 r-xp 00000000 08:03 663140
/usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7fd43082f000-7fd430a2e000 ---p 00002000 08:03 663140
/usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7fd430a2e000-7fd430a2f000 r--p 00001000 08:03 663140
/usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7fd430a2f000-7fd430a30000 rw-p 00002000 08:03 663140
/usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7fd430a30000-7fd430a35000 r-xp 00000000 08:03 663205
/usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1
7fd430a35000-7fd430c34000 ---p 00005000 08:03 663205
/usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1
7fd430c34000-7fd430c35000 r--p 00004000 08:03 663205
/usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1
7fd430c35000-7fd430c36000 rw-p 00005000 08:03 663205
/usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1
7fd430c36000-7fd430c3e000 r-xp 00000000 08:03 3411651
/lib/x86_64-linux-gnu/libwrap.so.0.7.6
7fd430c3e000-7fd430e3d000 ---p 00008000 08:03 3411651
/lib/x86_64-linux-gnu/libwrap.so.0.7.6
7fd430e3d000-7fd430e3e000 r--p 00007000 08:03 3411651
/lib/x86_64-linux-gnu/libwrap.so.0.7.6
7fd430e3e000-7fd430e3f000 rw-p 00008000 08:03 3411651
/lib/x86_64-linux-gnu/libwrap.so.0.7.6
7fd430e3f000-7fd430e5c000 r-xp 00000000 08:03 657105
/usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7fd430e5c000-7fd43105b000 ---p 0001d000 08:03 657105
/usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7fd43105b000-7fd43105c000 r--p 0001c000 08:03 657105
/usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7fd43105c000-7fd43105d000 rw-p 0001d000 08:03 657105
/usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7fd43105d000-7fd431064000 r-xp 00000000 08:03 663531
/usr/lib/x86_64-linux-gnu/libjson.so.0.0.1
7fd431064000-7fd431263000 ---p 00007000 08:03 663531
/usr/lib/x86_64-linux-gnu/libjson.so.0.0.1
7fd431263000-7fd431264000 r--p 00006000 08:03 663531
/usr/lib/x86_64-linux-gnu/libjson.so.0.0.1
7fd431264000-7fd431265000 rw-p 00007000 08:03 663531
/usr/lib/x86_64-linux-gnu/libjson.so.0.0.1
7fd431265000-7fd431287000 r-xp 00000000 08:03 3411639
/lib/x86_64-linux-gnu/libtinfo.so.5.9
7fd431287000-7fd431487000 ---p 00022000 08:03 3411639
/lib/x86_64-linux-gnu/libtinfo.so.5.9
7fd431487000-7fd43148b000 r--p 00022000 08:03 3411639
/lib/x86_64-linux-gnu/libtinfo.so.5.9
7fd43148b000-7fd43148c000 rw-p 00026000 08:03 3411639
/lib/x86_64-linux-gnu/libtinfo.so.5.9
7fd43148c000-7fd4314e8000 r-xp 00000000 08:03 662027
/usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so
7fd4314e8000-7fd4316e8000 ---p 0005c000 08:03 662027
/usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so
7fd4316e8000-7fd4316e9000 r--p 0005c000 08:03 662027
/usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so
7fd4316e9000-7fd4316ea000 rw-p 0005d000 08:03 662027
/usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so
7fd4316ea000-7fd431730000 r-xp 00000000 08:03 661818
/usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5
7fd431730000-7fd431930000 ---p 00046000 08:03 661818
/usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5
7fd431930000-7fd431931000 r--p 00046000 08:03 661818
/usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5
7fd431931000-7fd431932000 rw-p 00047000 08:03 661818
/usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5
7fd431932000-7fd43196e000 r-xp 00000000 08:03 3411615
/lib/x86_64-linux-gnu/libpcre.so.3.12.1
7fd43196e000-7fd431b6d000 ---p 0003c000 08:03 3411615
/lib/x86_64-linux-gnu/libpcre.so.3.12.1
7fd431b6d000-7fd431b6e000 r--p 0003b000 08:03 3411615
/lib/x86_64-linux-gnu/libpcre.so.3.12.1
7fd431b6e000-7fd431b6f000 rw-p 0003c000 08:03 3411615
/lib/x86_64-linux-gnu/libpcre.so.3.12.1
7fd431b6f000-7fd431ba8000 r-xp 00000000 08:03 3411625
/lib/x86_64-linux-gnu/libreadline.so.6.2
7fd431ba8000-7fd431da8000 ---p 00039000 08:03 3411625
/lib/x86_64-linux-gnu/libreadline.so.6.2
7fd431da8000-7fd431daa000 r--p 00039000 08:03 3411625
/lib/x86_64-linux-gnu/libreadline.so.6.2
7fd431daa000-7fd431db0000 rw-p 0003b000 08:03 3411625
/lib/x86_64-linux-gnu/libreadline.so.6.2
7fd431db0000-7fd431db1000 rw-p 00000000 00:00 0
7fd431db1000-7fd431df3000 r-xp 00000000 08:03 3407910
/lib/x86_64-linux-gnu/libdbus-1.so.3.5.8
7fd431df3000-7fd431ff3000 ---p 00042000 08:03 3407910
/lib/x86_64-linux-gnu/libdbus-1.so.3.5.8
7fd431ff3000-7fd431ff4000 r--p 00042000 08:03 3407910
/lib/x86_64-linux-gnu/libdbus-1.so.3.5.8
7fd431ff4000-7fd431ff5000 rw-p 00043000 08:03 3407910
/lib/x86_64-linux-gnu/libdbus-1.so.3.5.8
7fd431ff5000-7fd431ff8000 r-xp 00000000 08:03 662026
/usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3
7fd431ff8000-7fd4321f7000 ---p 00003000 08:03 662026
/usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3
7fd4321f7000-7fd4321f8000 r--p 00002000 08:03 662026
/usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3
7fd4321f8000-7fd4321f9000 rw-p 00003000 08:03 662026
/usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3
7fd4321f9000-7fd43220c000 r-xp 00000000 08:03 656534
/usr/lib/x86_64-linux-gnu/libjack.so.0.0.28
7fd43220c000-7fd43240b000 ---p 00013000 08:03 656534
/usr/lib/x86_64-linux-gnu/libjack.so.0.0.28
7fd43240b000-7fd43240c000 r--p 00012000 08:03 656534
/usr/lib/x86_64-linux-gnu/libjack.so.0.0.28
7fd43240c000-7fd43240d000 rw-p 00013000 08:03 656534
/usr/lib/x86_64-linux-gnu/libjack.so.0.0.28
7fd43240d000-7fd432416000 rw-p 00000000 00:00 0
7fd432416000-7fd432508000 r-xp 00000000 08:03 3407908
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4
7fd432508000-7fd432708000 ---p 000f2000 08:03 3407908
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4
7fd432708000-7fd432709000 r--p 000f2000 08:03 3407908
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4
7fd432709000-7fd43270a000 rw-p 000f3000 08:03 3407908
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4
7fd43270a000-7fd43270b000 rw-p 00000000 00:00 0
7fd43270b000-7fd43275f000 r-xp 00000000 08:03 671207
/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1
7fd43275f000-7fd43295f000 ---p 00054000 08:03 671207
/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1
7fd43295f000-7fd432960000 r--p 00054000 08:03 671207
/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1
7fd432960000-7fd432962000 rw-p 00055000 08:03 671207
/usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1
7fd432962000-7fd4329d0000 rw-p 00000000 00:00 0
7fd4329d0000-7fd4329d2000 r-xp 00000000 08:03 802431
/usr/lib/chuck/FluidSynth.chug
7fd4329d2000-7fd432bd1000 ---p 00002000 08:03 802431
/usr/lib/chuck/FluidSynth.chug
7fd432bd1000-7fd432bd2000 r--p 00001000 08:03 802431
/usr/lib/chuck/FluidSynth.chug
7fd432bd2000-7fd432bd3000 rw-p 00002000 08:03 802431
/usr/lib/chuck/FluidSynth.chug
7fd432bd3000-7fd432bda000 r-xp 00000000 08:03 796739
/usr/lib/chuck/Sigmund.chug
7fd432bda000-7fd432dd9000 ---p 00007000 08:03 796739
/usr/lib/chuck/Sigmund.chug
7fd432dd9000-7fd432dda000 r--p 00006000 08:03 796739
/usr/lib/chuck/Sigmund.chug
7fd432dda000-7fd432ddb000 rw-p 00007000 08:03 796739
/usr/lib/chuck/Sigmund.chug
7fd432ddb000-7fd432de6000 r-xp 00000000 08:03 802429
/usr/lib/chuck/Mesh2D.chug
7fd432de6000-7fd432fe5000 ---p 0000b000 08:03 802429
/usr/lib/chuck/Mesh2D.chug
7fd432fe5000-7fd432fe6000 r--p 0000a000 08:03 802429
/usr/lib/chuck/Mesh2D.chug
7fd432fe6000-7fd432fe7000 rw-p 0000b000 08:03 802429
/usr/lib/chuck/Mesh2D.chug
7fd432fe7000-7fd432fe9000 r-xp 00000000 08:03 802426
/usr/lib/chuck/PanN.chug
7fd432fe9000-7fd4331e9000 ---p 00002000 08:03 802426
/usr/lib/chuck/PanN.chug
7fd4331e9000-7fd4331ea000 r--p 00002000 08:03 802426
/usr/lib/chuck/PanN.chug
7fd4331ea000-7fd4331eb000 rw-p 00003000 08:03 802426
/usr/lib/chuck/PanN.chug
7fd4331eb000-7fd4331ed000 r-xp 00000000 08:03 797714
/usr/lib/chuck/ExpDelay.chug
7fd4331ed000-7fd4333ed000 ---p 00002000 08:03 797714
/usr/lib/chuck/ExpDelay.chug
7fd4333ed000-7fd4333ee000 r--p 00002000 08:03 797714
/usr/lib/chuck/ExpDelay.chug
7fd4333ee000-7fd4333ef000 rw-p 00003000 08:03 797714
/usr/lib/chuck/ExpDelay.chug
7fd4333ef000-7fd4333f3000 r-xp 00000000 08:03 802427
/usr/lib/chuck/PitchTrack.chug
7fd4333f3000-7fd4335f2000 ---p 00004000 08:03 802427
/usr/lib/chuck/PitchTrack.chug
7fd4335f2000-7fd4335f3000 r--p 00003000 08:03 802427
/usr/lib/chuck/PitchTrack.chug
7fd4335f3000-7fd4335f4000 rw-p 00004000 08:03 802427
/usr/lib/chuck/PitchTrack.chug
7fd4335f4000-7fd4335f8000 r-xp 00000000 08:03 799399
/usr/lib/chuck/Ladspa.chug
7fd4335f8000-7fd4337f7000 ---p 00004000 08:03 799399
/usr/lib/chuck/Ladspa.chug
7fd4337f7000-7fd4337f8000 r--p 00003000 08:03 799399
/usr/lib/chuck/Ladspa.chug
7fd4337f8000-7fd4337f9000 rw-p 00004000 08:03 799399
/usr/lib/chuck/Ladspa.chug
7fd4337f9000-7fd4337fa000 r-xp 00000000 08:03 802424
/usr/lib/chuck/MagicSine.chug
7fd4337fa000-7fd4339f9000 ---p 00001000 08:03 802424
/usr/lib/chuck/MagicSine.chug
7fd4339f9000-7fd4339fa000 r--p 00000000 08:03 802424
/usr/lib/chuck/MagicSine.chug
7fd4339fa000-7fd4339fb000 rw-p 00001000 08:03 802424
/usr/lib/chuck/MagicSine.chug
7fd4339fb000-7fd4339fe000 r-xp 00000000 08:03 802421
/usr/lib/chuck/ABSaturator.chug
7fd4339fe000-7fd433bfd000 ---p 00003000 08:03 802421
/usr/lib/chuck/ABSaturator.chug
7fd433bfd000-7fd433bfe000 r--p 00002000 08:03 802421
/usr/lib/chuck/ABSaturator.chug
7fd433bfe000-7fd433bff000 rw-p 00003000 08:03 802421
/usr/lib/chuck/ABSaturator.chug
7fd433bff000-7fd433c00000 r-xp 00000000 08:03 802422
/usr/lib/chuck/Bitcrusher.chug
7fd433c00000-7fd433e00000 ---p 00001000 08:03 802422
/usr/lib/chuck/Bitcrusher.chug
7fd433e00000-7fd433e01000 r--p 00001000 08:03 802422
/usr/lib/chuck/Bitcrusher.chug
7fd433e01000-7fd433e02000 rw-p 00002000 08:03 802422
/usr/lib/chuck/Bitcrusher.chug
7fd433e02000-7fd433e05000 r-xp 00000000 08:03 802425
/usr/lib/chuck/FIR.chug
7fd433e05000-7fd434004000 ---p 00003000 08:03 802425
/usr/lib/chuck/FIR.chug
7fd434004000-7fd434005000 r--p 00002000 08:03 802425
/usr/lib/chuck/FIR.chug
7fd434005000-7fd434006000 rw-p 00003000 08:03 802425
/usr/lib/chuck/FIR.chug
7fd434006000-7fd43400b000 r-xp 00000000 08:03 802432
/usr/lib/chuck/Elliptic.chug
7fd43400b000-7fd43420a000 ---p 00005000 08:03 802432
/usr/lib/chuck/Elliptic.chug
7fd43420a000-7fd43420b000 r--p 00004000 08:03 802432
/usr/lib/chuck/Elliptic.chug
7fd43420b000-7fd43420c000 rw-p 00005000 08:03 802432
/usr/lib/chuck/Elliptic.chug
7fd43420c000-7fd43420d000 rw-p 00000000 00:00 0
7fd43420d000-7fd43420e000 ---p 00000000 00:00 0
7fd43420e000-7fd434a0e000 rw-p 00000000 00:00 0
7fd434a0e000-7fd434a14000 r-xp 00000000 08:03 663601
/usr/lib/x86_64-linux-gnu/libogg.so.0.7.1
7fd434a14000-7fd434c13000 ---p 00006000 08:03 663601
/usr/lib/x86_64-linux-gnu/libogg.so.0.7.1
7fd434c13000-7fd434c14000 r--p 00005000 08:03 663601
/usr/lib/x86_64-linux-gnu/libogg.so.0.7.1
7fd434c14000-7fd434c15000 rw-p 00006000 08:03 663601
/usr/lib/x86_64-linux-gnu/libogg.so.0.7.1
7fd434c15000-7fd434c40000 r-xp 00000000 08:03 663780
/usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5
7fd434c40000-7fd434e3f000 ---p 0002b000 08:03 663780
/usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5
7fd434e3f000-7fd434e40000 r--p 0002a000 08:03 663780
/usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5
7fd434e40000-7fd434e41000 rw-p 0002b000 08:03 663780
/usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5
7fd434e41000-7fd4350f4000 r-xp 00000000 08:03 663782
/usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8
7fd4350f4000-7fd4352f3000 ---p 002b3000 08:03 663782
/usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8
7fd4352f3000-7fd43530f000 r--p 002b2000 08:03 663782
/usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8
7fd43530f000-7fd435310000 rw-p 002ce000 08:03 663782
/usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8
7fd435310000-7fd435358000 r-xp 00000000 08:03 663073
/usr/lib/x86_64-linux-gnu/libFLAC.so.8.2.0
7fd435358000-7fd435558000 ---p 00048000 08:03 663073
/usr/lib/x86_64-linux-gnu/libFLAC.so.8.2.0Aborted (core dumped)
I suppose we should move this to an issue on github at some point. . .
michael
On Mon, Jun 23, 2014 at 9:17 PM, Ryan Supak
Yuck, it behaves badly on Mac, but even worse on RPi. I get to maybe 30 shreds before it tanks... rs
On Mon, Jun 23, 2014 at 5:33 PM, Michael Heuer
wrote: Oops, forgot to increment count
<<<"count", count++>>>;
...
$ chuck --silent examples/dmxBug.ck [chuck](VM): removing shred: 2 (spork~exp)... count 0 [chuck](VM): removing shred: 3 (spork~exp)... count 1 ... [chuck](VM): removing shred: 144 (spork~exp)... count 142 [chuck](VM): removing shred: 145 (spork~exp)... count 143 [chuck](VM): removing shred: 146 (spork~exp)... Segmentation fault: 11
On Mon, Jun 23, 2014 at 5:31 PM, Michael Heuer
wrote: Interesting find, even this simple example blows for me
dmxBug.ck:
fun void blink() { while (true) { 50::ms => now; } }
Shred shred; spork ~ blink() @=> shred;
0 => int count;
while (true) { 200::ms => now; shred.id() => Machine.remove; spork ~ blink() @=> shred; <<<"count", count>>>; }
$ chuck --silent examples/dmxBug.ck ... [chuck](VM): removing shred: 144 (spork~exp)... count 0 [chuck](VM): removing shred: 145 (spork~exp)... count 0 [chuck](VM): removing shred: 146 (spork~exp)... Segmentation fault: 11
michael
On Mon, Jun 23, 2014 at 5:17 PM, Ryan Supak
wrote: Update: I eliminated everything I could from the Shreds that were being Sporked, and I still get the exact same error (at exactly 147 Shreds.)
Here is what I shortened the Shreds to:
fun void Blink() { while( true ) { 50::ms => now; } }
fun void LFOMod() { while( true ) { 50::ms => now; } }
On Mon, Jun 23, 2014 at 4:22 PM, Ryan Supak
wrote: Thanks for the thorough reply. I'm doing one safer, even than "voice stealing": each Spork is, at most, reconfiguring a single global oscillator.
Attached is the entire source. Lines 128-142 contain initialization code that creates a Shred to make an LED blink by sending a MIDI message within a time loop, and another Shred that sets the frequency of an LFO, polls it every ten milliseconds, and sends some Serial output based on the LFO position.
Anytime that the parameters controlling the blinking rate and the LFO rate/phase have occasion to change (when MIDI events come in to change them), the "old" Shreds are Machine.Remove'd and they're recreated immediately following. You can see this at lines 343 and 589.
Notice that the LFOMod function and the Blink function aren't creating anything new (with the exception of local arguments being instantiated), but if you think those local arguments could be causing my problem I'll eliminate them too.
Please see the attached. rs
On Mon, Jun 23, 2014 at 11:59 AM, Perry R Cook
wrote: I have lots of programs that spork hundreds or thousands of shreds without this error. So, without seeing your code, my guesses (and questions) are as follows:
Are you running this on a small memory architecture? Since you say headless, I'm guessing maybe Raspberry Pi? It could be that you're running out of memory, so see next question.
Does the shred that you're sporking declare new UGs or require memory to be allocated (arrays, lots of string manipulation, etc.)? In general, this is a bad idea if you can avoid it. ChucK does no garbage collection, which means that you need to be cautious about declaring memory.
So even a shred as simple as:
fun void mySine() { SinOsc s => dac; Math.random2f(100,1000) => s.freq; second => now; s =< dac; }
will eat up memory, because even though the SinOsc is unchucked and never computes again, the memory for that structure is still around. We want, someday to make ChucK a proper garbage collecting language, but it's hard, especially for real-time systems.
If this turns out to be your issue, then one way to handle this is to make a global pool of fixed resources and have your shred grab from that. Like classic "round robin voice stealing" in synthesizers:
SinOsc s[100]; 0 => int next2Use;
fun void mySine() { next2Use => int thisOne; 1 +=> next2Use; if (next2Use > 99) 0 => next2Use; s[thisOne] => dac; Math.random2f(100,1000) => s[thisOne].freq; second => now; s[thisOne] =< dac; }
// to test: while (1) { Math.random2f(0.01,0.1) :: second => now; spork ~ mySine(); }
I just fired up a few dozen of these running in parallel, VM showed 2600 total shreds running, no problem (and no clicks or dropouts!!).
Hope this helps, if none of this applies, then you may have discovered a strange bug. Source code please, and we can all scratch our heads on it.
Thanx!! PRC
Today's Topics:
1. 147th shred removed...segmentation fault? (Ryan Supak) _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
I was able to work around it by not doing any Sporking in code, instead
just updating global variables.
But, yeah, definite issue here.
rs
On Tuesday, June 24, 2014, Michael Heuer
On linux, my example works fine with 1.3.3.0
... [chuck](VM): removing shred: 35000 (spork~exp)... count 34998 [chuck](VM): removing shred: 35001 (spork~exp)... count 34999 ^C[chuck]: cleaning up...
but not with 1.3.4.0 built with alsa support
$ ./chuck --silent ~/working/lick/examples/dmxBug.ck [chuck](VM): removing shred: 2 (spork~exp)... count 0 [chuck](VM): removing shred: 3 (spork~exp)... count 1 [chuck](VM): removing shred: 4 (spork~exp)... count 2 [chuck](VM): removing shred: 5 (spork~exp)... count 3 [chuck](VM): removing shred: 6 (spork~exp)... count 4 [chuck](VM): removing shred: 7 (spork~exp)... count 5 [chuck](VM): removing shred: 8 (spork~exp)... count 6 [chuck](VM): removing shred: 9 (spork~exp)... count 7 [chuck](VM): removing shred: 10 (spork~exp)... count 8 [chuck](VM): removing shred: 11 (spork~exp)... count 9 [chuck](VM): removing shred: 12 (spork~exp)... count 10 [chuck](VM): removing shred: 13 (spork~exp)... count 11 [chuck](VM): removing shred: 14 (spork~exp)... count 12 [chuck](VM): removing shred: 15 (spork~exp)... count 13 [chuck](VM): removing shred: 16 (spork~exp)... count 14 [chuck](VM): removing shred: 17 (spork~exp)... count 15 [chuck](VM): removing shred: 18 (spork~exp)... count 16 [chuck](VM): removing shred: 19 (spork~exp)... count 17 [chuck](VM): removing shred: 20 (spork~exp)... count 18 [chuck](VM): removing shred: 21 (spork~exp)... count 19 [chuck](VM): removing shred: 22 (spork~exp)... count 20 [chuck](VM): removing shred: 23 (spork~exp)...*** buffer overflow detected ***: ./chuck terminated ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7fd43586cf47] /lib/x86_64-linux-gnu/libc.so.6(+0x109e40)[0x7fd43586be40] /lib/x86_64-linux-gnu/libc.so.6(+0x108d13)[0x7fd43586ad13] ./chuck[0x41585a] ./chuck[0x41cabb] ./chuck[0x46d898] ./chuck[0x50517f] ./chuck[0x4245d0] ./chuck[0x418d0e] ./chuck[0x41dbd2] ./chuck[0x41e077] ./chuck[0x40b6fd] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7fd43578376d] ./chuck[0x40dc55] ======= Memory map: ======== 00400000-0059d000 r-xp 00000000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 0079d000-0079e000 r--p 0019d000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 0079e000-007c5000 rw-p 0019e000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 007c5000-0084a000 rw-p 00000000 00:00 0 01db2000-020f9000 rw-p 00000000 00:00 0 [heap] 7fd428000000-7fd428021000 rw-p 00000000 00:00 0 7fd428021000-7fd42c000000 ---p 00000000 00:00 0 7fd42f3d8000-7fd42f3d9000 ---p 00000000 00:00 0 7fd42f3d9000-7fd42fbd9000 rw-p 00000000 00:00 0 7fd42fbd9000-7fd42fbdd000 r-xp 00000000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fbdd000-7fd42fddd000 ---p 00004000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fddd000-7fd42fdde000 r--p 00004000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fdde000-7fd42fddf000 rw-p 00005000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fddf000-7fd42fde1000 r-xp 00000000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42fde1000-7fd42ffe0000 ---p 00002000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe0000-7fd42ffe1000 r--p 00001000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe1000-7fd42ffe2000 rw-p 00002000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe2000-7fd42fff0000 r-xp 00000000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd42fff0000-7fd4301ef000 ---p 0000e000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301ef000-7fd4301f0000 r--p 0000d000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301f0000-7fd4301f1000 rw-p 0000e000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301f1000-7fd430209000 r-xp 00000000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd430209000-7fd430409000 ---p 00018000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd430409000-7fd43040a000 r--p 00018000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd43040a000-7fd43040b000 rw-p 00019000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd43040b000-7fd43040d000 rw-p 00000000 00:00 0 7fd43040d000-7fd430424000 r-xp 00000000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430424000-7fd430623000 ---p 00017000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430623000-7fd430624000 r--p 00016000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430624000-7fd430625000 rw-p 00017000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430625000-7fd430627000 rw-p 00000000 00:00 0 7fd430627000-7fd43062c000 r-xp 00000000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43062c000-7fd43082b000 ---p 00005000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082b000-7fd43082c000 r--p 00004000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082c000-7fd43082d000 rw-p 00005000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082d000-7fd43082f000 r-xp 00000000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd43082f000-7fd430a2e000 ---p 00002000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a2e000-7fd430a2f000 r--p 00001000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a2f000-7fd430a30000 rw-p 00002000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a30000-7fd430a35000 r-xp 00000000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430a35000-7fd430c34000 ---p 00005000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c34000-7fd430c35000 r--p 00004000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c35000-7fd430c36000 rw-p 00005000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c36000-7fd430c3e000 r-xp 00000000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430c3e000-7fd430e3d000 ---p 00008000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3d000-7fd430e3e000 r--p 00007000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3e000-7fd430e3f000 rw-p 00008000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3f000-7fd430e5c000 r-xp 00000000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd430e5c000-7fd43105b000 ---p 0001d000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105b000-7fd43105c000 r--p 0001c000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105c000-7fd43105d000 rw-p 0001d000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105d000-7fd431064000 r-xp 00000000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431064000-7fd431263000 ---p 00007000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431263000-7fd431264000 r--p 00006000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431264000-7fd431265000 rw-p 00007000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431265000-7fd431287000 r-xp 00000000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd431287000-7fd431487000 ---p 00022000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd431487000-7fd43148b000 r--p 00022000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd43148b000-7fd43148c000 rw-p 00026000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd43148c000-7fd4314e8000 r-xp 00000000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4314e8000-7fd4316e8000 ---p 0005c000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316e8000-7fd4316e9000 r--p 0005c000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316e9000-7fd4316ea000 rw-p 0005d000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316ea000-7fd431730000 r-xp 00000000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431730000-7fd431930000 ---p 00046000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431930000-7fd431931000 r--p 00046000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431931000-7fd431932000 rw-p 00047000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431932000-7fd43196e000 r-xp 00000000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd43196e000-7fd431b6d000 ---p 0003c000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6d000-7fd431b6e000 r--p 0003b000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6e000-7fd431b6f000 rw-p 0003c000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6f000-7fd431ba8000 r-xp 00000000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431ba8000-7fd431da8000 ---p 00039000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431da8000-7fd431daa000 r--p 00039000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431daa000-7fd431db0000 rw-p 0003b000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431db0000-7fd431db1000 rw-p 00000000 00:00 0 7fd431db1000-7fd431df3000 r-xp 00000000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431df3000-7fd431ff3000 ---p 00042000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff3000-7fd431ff4000 r--p 00042000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff4000-7fd431ff5000 rw-p 00043000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff5000-7fd431ff8000 r-xp 00000000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd431ff8000-7fd4321f7000 ---p 00003000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f7000-7fd4321f8000 r--p 00002000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f8000-7fd4321f9000 rw-p 00003000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f9000-7fd43220c000 r-xp 00000000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43220c000-7fd43240b000 ---p 00013000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240b000-7fd43240c000 r--p 00012000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240c000-7fd43240d000 rw-p 00013000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240d000-7fd432416000 rw-p 00000000 00:00 0 7fd432416000-7fd432508000 r-xp 00000000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432508000-7fd432708000 ---p 000f2000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432708000-7fd432709000 r--p 000f2000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432709000-7fd43270a000 rw-p 000f3000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd43270a000-7fd43270b000 rw-p 00000000 00:00 0 7fd43270b000-7fd43275f000 r-xp 00000000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd43275f000-7fd43295f000 ---p 00054000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd43295f000-7fd432960000 r--p 00054000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd432960000-7fd432962000 rw-p 00055000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd432962000-7fd4329d0000 rw-p 00000000 00:00 0 7fd4329d0000-7fd4329d2000 r-xp 00000000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd4329d2000-7fd432bd1000 ---p 00002000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd1000-7fd432bd2000 r--p 00001000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd2000-7fd432bd3000 rw-p 00002000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd3000-7fd432bda000 r-xp 00000000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432bda000-7fd432dd9000 ---p 00007000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432dd9000-7fd432dda000 r--p 00006000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432dda000-7fd432ddb000 rw-p 00007000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432ddb000-7fd432de6000 r-xp 00000000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432de6000-7fd432fe5000 ---p 0000b000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe5000-7fd432fe6000 r--p 0000a000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe6000-7fd432fe7000 rw-p 0000b000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe7000-7fd432fe9000 r-xp 00000000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd432fe9000-7fd4331e9000 ---p 00002000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331e9000-7fd4331ea000 r--p 00002000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331ea000-7fd4331eb000 rw-p 00003000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331eb000-7fd4331ed000 r-xp 00000000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4331ed000-7fd4333ed000 ---p 00002000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ed000-7fd4333ee000 r--p 00002000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ee000-7fd4333ef000 rw-p 00003000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ef000-7fd4333f3000 r-xp 00000000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4333f3000-7fd4335f2000 ---p 00004000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f2000-7fd4335f3000 r--p 00003000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f3000-7fd4335f4000 rw-p 00004000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f4000-7fd4335f8000 r-xp 00000000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4335f8000-7fd4337f7000 ---p 00004000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f7000-7fd4337f8000 r--p 00003000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f8000-7fd4337f9000 rw-p 00004000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f9000-7fd4337fa000 r-xp 00000000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4337fa000-7fd4339f9000 ---p 00001000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339f9000-7fd4339fa000 r--p 00000000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339fa000-7fd4339fb000 rw-p 00001000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339fb000-7fd4339fe000 r-xp 00000000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd4339fe000-7fd433bfd000 ---p 00003000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bfd000-7fd433bfe000 r--p 00002000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bfe000-7fd433bff000 rw-p 00003000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bff000-7fd433c00000 r-xp 00000000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433c00000-7fd433e00000 ---p 00001000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e00000-7fd433e01000 r--p 00001000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e01000-7fd433e02000 rw-p 00002000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e02000-7fd433e05000 r-xp 00000000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd433e05000-7fd434004000 ---p 00003000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434004000-7fd434005000 r--p 00002000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434005000-7fd434006000 rw-p 00003000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434006000-7fd43400b000 r-xp 00000000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43400b000-7fd43420a000 ---p 00005000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420a000-7fd43420b000 r--p 00004000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420b000-7fd43420c000 rw-p 00005000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420c000-7fd43420d000 rw-p 00000000 00:00 0 7fd43420d000-7fd43420e000 ---p 00000000 00:00 0 7fd43420e000-7fd434a0e000 rw-p 00000000 00:00 0 7fd434a0e000-7fd434a14000 r-xp 00000000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434a14000-7fd434c13000 ---p 00006000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c13000-7fd434c14000 r--p 00005000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c14000-7fd434c15000 rw-p 00006000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c15000-7fd434c40000 r-xp 00000000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434c40000-7fd434e3f000 ---p 0002b000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e3f000-7fd434e40000 r--p 0002a000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e40000-7fd434e41000 rw-p 0002b000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e41000-7fd4350f4000 r-xp 00000000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd4350f4000-7fd4352f3000 ---p 002b3000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd4352f3000-7fd43530f000 r--p 002b2000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd43530f000-7fd435310000 rw-p 002ce000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd435310000-7fd435358000 r-xp 00000000 08:03 663073 /usr/lib/x86_64-linux-gnu/libFLAC.so.8.2.0 7fd435358000-7fd435558000 ---p 00048000 08:03 663073 /usr/lib/x86_64-linux-gnu/libFLAC.so.8.2.0Aborted (core dumped)
I suppose we should move this to an issue on github at some point. . .
michael
Yuck, it behaves badly on Mac, but even worse on RPi. I get to maybe 30 shreds before it tanks... rs
On Mon, Jun 23, 2014 at 5:33 PM, Michael Heuer
javascript:;> wrote: Oops, forgot to increment count
<<<"count", count++>>>;
...
$ chuck --silent examples/dmxBug.ck [chuck](VM): removing shred: 2 (spork~exp)... count 0 [chuck](VM): removing shred: 3 (spork~exp)... count 1 ... [chuck](VM): removing shred: 144 (spork~exp)... count 142 [chuck](VM): removing shred: 145 (spork~exp)... count 143 [chuck](VM): removing shred: 146 (spork~exp)... Segmentation fault: 11
On Mon, Jun 23, 2014 at 5:31 PM, Michael Heuer
javascript:;> wrote:
Interesting find, even this simple example blows for me
dmxBug.ck:
fun void blink() { while (true) { 50::ms => now; } }
Shred shred; spork ~ blink() @=> shred;
0 => int count;
while (true) { 200::ms => now; shred.id() => Machine.remove; spork ~ blink() @=> shred; <<<"count", count>>>; }
$ chuck --silent examples/dmxBug.ck ... [chuck](VM): removing shred: 144 (spork~exp)... count 0 [chuck](VM): removing shred: 145 (spork~exp)... count 0 [chuck](VM): removing shred: 146 (spork~exp)... Segmentation fault: 11
michael
On Mon, Jun 23, 2014 at 5:17 PM, Ryan Supak
javascript:;> wrote: Update: I eliminated everything I could from the Shreds that were being Sporked, and I still get the exact same error (at exactly 147 Shreds.)
Here is what I shortened the Shreds to:
fun void Blink() { while( true ) { 50::ms => now; } }
fun void LFOMod() { while( true ) { 50::ms => now; } }
On Mon, Jun 23, 2014 at 4:22 PM, Ryan Supak
javascript:;> wrote: Thanks for the thorough reply. I'm doing one safer, even than "voice stealing": each Spork is, at most, reconfiguring a single global oscillator.
Attached is the entire source. Lines 128-142 contain initialization code that creates a Shred to make an LED blink by sending a MIDI message within a time loop, and another Shred that sets the frequency of an LFO,
it every ten milliseconds, and sends some Serial output based on the LFO position.
Anytime that the parameters controlling the blinking rate and the LFO rate/phase have occasion to change (when MIDI events come in to change them), the "old" Shreds are Machine.Remove'd and they're recreated immediately following. You can see this at lines 343 and 589.
Notice that the LFOMod function and the Blink function aren't creating anything new (with the exception of local arguments being instantiated), but if you think those local arguments could be causing my problem I'll eliminate them too.
Please see the attached. rs
On Mon, Jun 23, 2014 at 11:59 AM, Perry R Cook <
On Mon, Jun 23, 2014 at 9:17 PM, Ryan Supak
javascript:;> wrote: polls prc@cs.princeton.edu javascript:;> wrote: > > I have lots of programs that spork hundreds or thousands > of shreds without this error. So, without seeing your > code, my guesses (and questions) are as follows: > > Are you running this on a small memory architecture? Since > you say headless, I'm guessing maybe Raspberry Pi? It > could be that you're running out of memory, so see next > question. > > Does the shred that you're sporking declare new UGs or > require memory to be allocated (arrays, lots of string > manipulation, etc.)? In general, this is a bad idea if you > can avoid it. ChucK does no garbage collection, which > means that you need to be cautious about declaring memory. > > So even a shred as simple as: > > fun void mySine() { > SinOsc s => dac; > Math.random2f(100,1000) => s.freq; > second => now; > s =< dac; > } > > will eat up memory, because even though the SinOsc > is unchucked and never computes again, the memory > for that structure is still around. We want, someday > to make ChucK a proper garbage collecting language, > but it's hard, especially for real-time systems. > > If this turns out to be your issue, then one way to > handle this is to make a global pool of fixed > resources and have your shred grab from that. > Like classic "round robin voice stealing" in > synthesizers: > > SinOsc s[100]; > 0 => int next2Use; > > fun void mySine() { > next2Use => int thisOne; > 1 +=> next2Use; > if (next2Use > 99) 0 => next2Use; > s[thisOne] => dac; > Math.random2f(100,1000) => s[thisOne].freq; > second => now; > s[thisOne] =< dac; > } > > // to test: > while (1) { > Math.random2f(0.01,0.1) :: second => now; > spork ~ mySine(); > } > > I just fired up a few dozen of these running in > parallel, VM showed 2600 total shreds running, > no problem (and no clicks or dropouts!!). > > Hope this helps, if none of this applies, then you > may have discovered a strange bug. Source code please, > and we can all scratch our heads on it. > > Thanx!! PRC > > > Today's Topics: > > 1. 147th shred removed...segmentation fault? (Ryan Supak) > _______________________________________________ > chuck-users mailing list > chuck-users@lists.cs.princeton.edu javascript:; > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu javascript:; https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
chuck-users mailing list chuck-users@lists.cs.princeton.edu javascript:; https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu javascript:; https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu javascript:; https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Hey y'all,
Think I figured this out, the internal message buffer (the one that says
"sporking shred ...") was overflowing and randomly overwriting other parts
of memory, causing crashes for seemingly unrelated reasons. Anyways, with
the fix that is in the git repo, I can't get Michael's example to crash
anymore. An updated release to come shortly!
spencer
On Tue, Jun 24, 2014 at 9:20 PM, Ryan Supak
I was able to work around it by not doing any Sporking in code, instead just updating global variables.
But, yeah, definite issue here. rs
On Tuesday, June 24, 2014, Michael Heuer
wrote: On linux, my example works fine with 1.3.3.0
... [chuck](VM): removing shred: 35000 (spork~exp)... count 34998 [chuck](VM): removing shred: 35001 (spork~exp)... count 34999 ^C[chuck]: cleaning up...
but not with 1.3.4.0 built with alsa support
$ ./chuck --silent ~/working/lick/examples/dmxBug.ck [chuck](VM): removing shred: 2 (spork~exp)... count 0 [chuck](VM): removing shred: 3 (spork~exp)... count 1 [chuck](VM): removing shred: 4 (spork~exp)... count 2 [chuck](VM): removing shred: 5 (spork~exp)... count 3 [chuck](VM): removing shred: 6 (spork~exp)... count 4 [chuck](VM): removing shred: 7 (spork~exp)... count 5 [chuck](VM): removing shred: 8 (spork~exp)... count 6 [chuck](VM): removing shred: 9 (spork~exp)... count 7 [chuck](VM): removing shred: 10 (spork~exp)... count 8 [chuck](VM): removing shred: 11 (spork~exp)... count 9 [chuck](VM): removing shred: 12 (spork~exp)... count 10 [chuck](VM): removing shred: 13 (spork~exp)... count 11 [chuck](VM): removing shred: 14 (spork~exp)... count 12 [chuck](VM): removing shred: 15 (spork~exp)... count 13 [chuck](VM): removing shred: 16 (spork~exp)... count 14 [chuck](VM): removing shred: 17 (spork~exp)... count 15 [chuck](VM): removing shred: 18 (spork~exp)... count 16 [chuck](VM): removing shred: 19 (spork~exp)... count 17 [chuck](VM): removing shred: 20 (spork~exp)... count 18 [chuck](VM): removing shred: 21 (spork~exp)... count 19 [chuck](VM): removing shred: 22 (spork~exp)... count 20 [chuck](VM): removing shred: 23 (spork~exp)...*** buffer overflow detected ***: ./chuck terminated ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7fd43586cf47] /lib/x86_64-linux-gnu/libc.so.6(+0x109e40)[0x7fd43586be40] /lib/x86_64-linux-gnu/libc.so.6(+0x108d13)[0x7fd43586ad13] ./chuck[0x41585a] ./chuck[0x41cabb] ./chuck[0x46d898] ./chuck[0x50517f] ./chuck[0x4245d0] ./chuck[0x418d0e] ./chuck[0x41dbd2] ./chuck[0x41e077] ./chuck[0x40b6fd] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7fd43578376d] ./chuck[0x40dc55] ======= Memory map: ======== 00400000-0059d000 r-xp 00000000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 0079d000-0079e000 r--p 0019d000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 0079e000-007c5000 rw-p 0019e000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 007c5000-0084a000 rw-p 00000000 00:00 0 01db2000-020f9000 rw-p 00000000 00:00 0 [heap] 7fd428000000-7fd428021000 rw-p 00000000 00:00 0 7fd428021000-7fd42c000000 ---p 00000000 00:00 0 7fd42f3d8000-7fd42f3d9000 ---p 00000000 00:00 0 7fd42f3d9000-7fd42fbd9000 rw-p 00000000 00:00 0 7fd42fbd9000-7fd42fbdd000 r-xp 00000000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fbdd000-7fd42fddd000 ---p 00004000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fddd000-7fd42fdde000 r--p 00004000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fdde000-7fd42fddf000 rw-p 00005000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fddf000-7fd42fde1000 r-xp 00000000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42fde1000-7fd42ffe0000 ---p 00002000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe0000-7fd42ffe1000 r--p 00001000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe1000-7fd42ffe2000 rw-p 00002000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe2000-7fd42fff0000 r-xp 00000000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd42fff0000-7fd4301ef000 ---p 0000e000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301ef000-7fd4301f0000 r--p 0000d000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301f0000-7fd4301f1000 rw-p 0000e000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301f1000-7fd430209000 r-xp 00000000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd430209000-7fd430409000 ---p 00018000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd430409000-7fd43040a000 r--p 00018000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd43040a000-7fd43040b000 rw-p 00019000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd43040b000-7fd43040d000 rw-p 00000000 00:00 0 7fd43040d000-7fd430424000 r-xp 00000000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430424000-7fd430623000 ---p 00017000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430623000-7fd430624000 r--p 00016000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430624000-7fd430625000 rw-p 00017000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430625000-7fd430627000 rw-p 00000000 00:00 0 7fd430627000-7fd43062c000 r-xp 00000000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43062c000-7fd43082b000 ---p 00005000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082b000-7fd43082c000 r--p 00004000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082c000-7fd43082d000 rw-p 00005000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082d000-7fd43082f000 r-xp 00000000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd43082f000-7fd430a2e000 ---p 00002000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a2e000-7fd430a2f000 r--p 00001000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a2f000-7fd430a30000 rw-p 00002000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a30000-7fd430a35000 r-xp 00000000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430a35000-7fd430c34000 ---p 00005000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c34000-7fd430c35000 r--p 00004000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c35000-7fd430c36000 rw-p 00005000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c36000-7fd430c3e000 r-xp 00000000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430c3e000-7fd430e3d000 ---p 00008000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3d000-7fd430e3e000 r--p 00007000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3e000-7fd430e3f000 rw-p 00008000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3f000-7fd430e5c000 r-xp 00000000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd430e5c000-7fd43105b000 ---p 0001d000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105b000-7fd43105c000 r--p 0001c000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105c000-7fd43105d000 rw-p 0001d000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105d000-7fd431064000 r-xp 00000000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431064000-7fd431263000 ---p 00007000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431263000-7fd431264000 r--p 00006000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431264000-7fd431265000 rw-p 00007000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431265000-7fd431287000 r-xp 00000000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd431287000-7fd431487000 ---p 00022000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd431487000-7fd43148b000 r--p 00022000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd43148b000-7fd43148c000 rw-p 00026000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd43148c000-7fd4314e8000 r-xp 00000000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4314e8000-7fd4316e8000 ---p 0005c000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316e8000-7fd4316e9000 r--p 0005c000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316e9000-7fd4316ea000 rw-p 0005d000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316ea000-7fd431730000 r-xp 00000000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431730000-7fd431930000 ---p 00046000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431930000-7fd431931000 r--p 00046000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431931000-7fd431932000 rw-p 00047000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431932000-7fd43196e000 r-xp 00000000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd43196e000-7fd431b6d000 ---p 0003c000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6d000-7fd431b6e000 r--p 0003b000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6e000-7fd431b6f000 rw-p 0003c000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6f000-7fd431ba8000 r-xp 00000000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431ba8000-7fd431da8000 ---p 00039000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431da8000-7fd431daa000 r--p 00039000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431daa000-7fd431db0000 rw-p 0003b000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431db0000-7fd431db1000 rw-p 00000000 00:00 0 7fd431db1000-7fd431df3000 r-xp 00000000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431df3000-7fd431ff3000 ---p 00042000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff3000-7fd431ff4000 r--p 00042000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff4000-7fd431ff5000 rw-p 00043000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff5000-7fd431ff8000 r-xp 00000000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd431ff8000-7fd4321f7000 ---p 00003000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f7000-7fd4321f8000 r--p 00002000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f8000-7fd4321f9000 rw-p 00003000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f9000-7fd43220c000 r-xp 00000000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43220c000-7fd43240b000 ---p 00013000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240b000-7fd43240c000 r--p 00012000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240c000-7fd43240d000 rw-p 00013000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240d000-7fd432416000 rw-p 00000000 00:00 0 7fd432416000-7fd432508000 r-xp 00000000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432508000-7fd432708000 ---p 000f2000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432708000-7fd432709000 r--p 000f2000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432709000-7fd43270a000 rw-p 000f3000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd43270a000-7fd43270b000 rw-p 00000000 00:00 0 7fd43270b000-7fd43275f000 r-xp 00000000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd43275f000-7fd43295f000 ---p 00054000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd43295f000-7fd432960000 r--p 00054000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd432960000-7fd432962000 rw-p 00055000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd432962000-7fd4329d0000 rw-p 00000000 00:00 0 7fd4329d0000-7fd4329d2000 r-xp 00000000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd4329d2000-7fd432bd1000 ---p 00002000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd1000-7fd432bd2000 r--p 00001000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd2000-7fd432bd3000 rw-p 00002000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd3000-7fd432bda000 r-xp 00000000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432bda000-7fd432dd9000 ---p 00007000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432dd9000-7fd432dda000 r--p 00006000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432dda000-7fd432ddb000 rw-p 00007000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432ddb000-7fd432de6000 r-xp 00000000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432de6000-7fd432fe5000 ---p 0000b000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe5000-7fd432fe6000 r--p 0000a000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe6000-7fd432fe7000 rw-p 0000b000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe7000-7fd432fe9000 r-xp 00000000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd432fe9000-7fd4331e9000 ---p 00002000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331e9000-7fd4331ea000 r--p 00002000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331ea000-7fd4331eb000 rw-p 00003000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331eb000-7fd4331ed000 r-xp 00000000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4331ed000-7fd4333ed000 ---p 00002000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ed000-7fd4333ee000 r--p 00002000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ee000-7fd4333ef000 rw-p 00003000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ef000-7fd4333f3000 r-xp 00000000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4333f3000-7fd4335f2000 ---p 00004000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f2000-7fd4335f3000 r--p 00003000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f3000-7fd4335f4000 rw-p 00004000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f4000-7fd4335f8000 r-xp 00000000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4335f8000-7fd4337f7000 ---p 00004000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f7000-7fd4337f8000 r--p 00003000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f8000-7fd4337f9000 rw-p 00004000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f9000-7fd4337fa000 r-xp 00000000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4337fa000-7fd4339f9000 ---p 00001000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339f9000-7fd4339fa000 r--p 00000000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339fa000-7fd4339fb000 rw-p 00001000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339fb000-7fd4339fe000 r-xp 00000000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd4339fe000-7fd433bfd000 ---p 00003000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bfd000-7fd433bfe000 r--p 00002000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bfe000-7fd433bff000 rw-p 00003000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bff000-7fd433c00000 r-xp 00000000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433c00000-7fd433e00000 ---p 00001000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e00000-7fd433e01000 r--p 00001000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e01000-7fd433e02000 rw-p 00002000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e02000-7fd433e05000 r-xp 00000000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd433e05000-7fd434004000 ---p 00003000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434004000-7fd434005000 r--p 00002000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434005000-7fd434006000 rw-p 00003000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434006000-7fd43400b000 r-xp 00000000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43400b000-7fd43420a000 ---p 00005000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420a000-7fd43420b000 r--p 00004000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420b000-7fd43420c000 rw-p 00005000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420c000-7fd43420d000 rw-p 00000000 00:00 0 7fd43420d000-7fd43420e000 ---p 00000000 00:00 0 7fd43420e000-7fd434a0e000 rw-p 00000000 00:00 0 7fd434a0e000-7fd434a14000 r-xp 00000000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434a14000-7fd434c13000 ---p 00006000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c13000-7fd434c14000 r--p 00005000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c14000-7fd434c15000 rw-p 00006000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c15000-7fd434c40000 r-xp 00000000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434c40000-7fd434e3f000 ---p 0002b000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e3f000-7fd434e40000 r--p 0002a000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e40000-7fd434e41000 rw-p 0002b000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e41000-7fd4350f4000 r-xp 00000000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd4350f4000-7fd4352f3000 ---p 002b3000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd4352f3000-7fd43530f000 r--p 002b2000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd43530f000-7fd435310000 rw-p 002ce000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd435310000-7fd435358000 r-xp 00000000 08:03 663073 /usr/lib/x86_64-linux-gnu/libFLAC.so.8.2.0 7fd435358000-7fd435558000 ---p 00048000 08:03 663073 /usr/lib/x86_64-linux-gnu/libFLAC.so.8.2.0Aborted (core dumped)
I suppose we should move this to an issue on github at some point. . .
michael
Yuck, it behaves badly on Mac, but even worse on RPi. I get to maybe 30 shreds before it tanks... rs
On Mon, Jun 23, 2014 at 5:33 PM, Michael Heuer
wrote: Oops, forgot to increment count
<<<"count", count++>>>;
...
$ chuck --silent examples/dmxBug.ck [chuck](VM): removing shred: 2 (spork~exp)... count 0 [chuck](VM): removing shred: 3 (spork~exp)... count 1 ... [chuck](VM): removing shred: 144 (spork~exp)... count 142 [chuck](VM): removing shred: 145 (spork~exp)... count 143 [chuck](VM): removing shred: 146 (spork~exp)... Segmentation fault: 11
On Mon, Jun 23, 2014 at 5:31 PM, Michael Heuer
wrote:
Interesting find, even this simple example blows for me
dmxBug.ck:
fun void blink() { while (true) { 50::ms => now; } }
Shred shred; spork ~ blink() @=> shred;
0 => int count;
while (true) { 200::ms => now; shred.id() => Machine.remove; spork ~ blink() @=> shred; <<<"count", count>>>; }
$ chuck --silent examples/dmxBug.ck ... [chuck](VM): removing shred: 144 (spork~exp)... count 0 [chuck](VM): removing shred: 145 (spork~exp)... count 0 [chuck](VM): removing shred: 146 (spork~exp)... Segmentation fault: 11
michael
On Mon, Jun 23, 2014 at 5:17 PM, Ryan Supak
wrote: Update: I eliminated everything I could from the Shreds that were being Sporked, and I still get the exact same error (at exactly 147 Shreds.)
Here is what I shortened the Shreds to:
fun void Blink() { while( true ) { 50::ms => now; } }
fun void LFOMod() { while( true ) { 50::ms => now; } }
On Mon, Jun 23, 2014 at 4:22 PM, Ryan Supak
wrote: > > Thanks for the thorough reply. I'm doing one safer, even than "voice > stealing": each Spork is, at most, reconfiguring a single global > oscillator. > > Attached is the entire source. Lines 128-142 contain initialization > code > that creates a Shred to make an LED blink by sending a MIDI message > within a > time loop, and another Shred that sets the frequency of an LFO, > it > every ten milliseconds, and sends some Serial output based on the LFO > position. > > Anytime that the parameters controlling the blinking rate and the LFO > rate/phase have occasion to change (when MIDI events come in to change > them), the "old" Shreds are Machine.Remove'd and they're recreated > immediately following. You can see this at lines 343 and 589. > > Notice that the LFOMod function and the Blink function aren't creating > anything new (with the exception of local arguments being > instantiated), but > if you think those local arguments could be causing my problem I'll > eliminate them too. > > Please see the attached. > rs > > > On Mon, Jun 23, 2014 at 11:59 AM, Perry R Cook <
On Mon, Jun 23, 2014 at 9:17 PM, Ryan Supak
wrote: polls prc@cs.princeton.edu> > wrote: >> >> I have lots of programs that spork hundreds or thousands >> of shreds without this error. So, without seeing your >> code, my guesses (and questions) are as follows: >> >> Are you running this on a small memory architecture? Since >> you say headless, I'm guessing maybe Raspberry Pi? It >> could be that you're running out of memory, so see next >> question. >> >> Does the shred that you're sporking declare new UGs or >> require memory to be allocated (arrays, lots of string >> manipulation, etc.)? In general, this is a bad idea if you >> can avoid it. ChucK does no garbage collection, which >> means that you need to be cautious about declaring memory. >> >> So even a shred as simple as: >> >> fun void mySine() { >> SinOsc s => dac; >> Math.random2f(100,1000) => s.freq; >> second => now; >> s =< dac; >> } >> >> will eat up memory, because even though the SinOsc >> is unchucked and never computes again, the memory >> for that structure is still around. We want, someday >> to make ChucK a proper garbage collecting language, >> but it's hard, especially for real-time systems. >> >> If this turns out to be your issue, then one way to >> handle this is to make a global pool of fixed >> resources and have your shred grab from that. >> Like classic "round robin voice stealing" in >> synthesizers: >> >> SinOsc s[100]; >> 0 => int next2Use; >> >> fun void mySine() { >> next2Use => int thisOne; >> 1 +=> next2Use; >> if (next2Use > 99) 0 => next2Use; >> s[thisOne] => dac; >> Math.random2f(100,1000) => s[thisOne].freq; >> second => now; >> s[thisOne] =< dac; >> } >> >> // to test: >> while (1) { >> Math.random2f(0.01,0.1) :: second => now; >> spork ~ mySine(); >> } >> >> I just fired up a few dozen of these running in >> parallel, VM showed 2600 total shreds running, >> no problem (and no clicks or dropouts!!). >> >> Hope this helps, if none of this applies, then you >> may have discovered a strange bug. Source code please, >> and we can all scratch our heads on it. >> >> Thanx!! PRC >> >> >> Today's Topics: >> >> 1. 147th shred removed...segmentation fault? (Ryan Supak) >> _______________________________________________ >> chuck-users mailing list >> chuck-users@lists.cs.princeton.edu >> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users > >
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Hooray! rs
On Sunday, June 29, 2014, Spencer Salazar
Hey y'all,
Think I figured this out, the internal message buffer (the one that says "sporking shred ...") was overflowing and randomly overwriting other parts of memory, causing crashes for seemingly unrelated reasons. Anyways, with the fix that is in the git repo, I can't get Michael's example to crash anymore. An updated release to come shortly!
spencer
On Tue, Jun 24, 2014 at 9:20 PM, Ryan Supak
javascript:_e(%7B%7D,'cvml','ryansupak@gmail.com');> wrote: I was able to work around it by not doing any Sporking in code, instead just updating global variables.
But, yeah, definite issue here. rs
On Tuesday, June 24, 2014, Michael Heuer
javascript:_e(%7B%7D,'cvml','heuermh@gmail.com');> wrote: On linux, my example works fine with 1.3.3.0
... [chuck](VM): removing shred: 35000 (spork~exp)... count 34998 [chuck](VM): removing shred: 35001 (spork~exp)... count 34999 ^C[chuck]: cleaning up...
but not with 1.3.4.0 built with alsa support
$ ./chuck --silent ~/working/lick/examples/dmxBug.ck [chuck](VM): removing shred: 2 (spork~exp)... count 0 [chuck](VM): removing shred: 3 (spork~exp)... count 1 [chuck](VM): removing shred: 4 (spork~exp)... count 2 [chuck](VM): removing shred: 5 (spork~exp)... count 3 [chuck](VM): removing shred: 6 (spork~exp)... count 4 [chuck](VM): removing shred: 7 (spork~exp)... count 5 [chuck](VM): removing shred: 8 (spork~exp)... count 6 [chuck](VM): removing shred: 9 (spork~exp)... count 7 [chuck](VM): removing shred: 10 (spork~exp)... count 8 [chuck](VM): removing shred: 11 (spork~exp)... count 9 [chuck](VM): removing shred: 12 (spork~exp)... count 10 [chuck](VM): removing shred: 13 (spork~exp)... count 11 [chuck](VM): removing shred: 14 (spork~exp)... count 12 [chuck](VM): removing shred: 15 (spork~exp)... count 13 [chuck](VM): removing shred: 16 (spork~exp)... count 14 [chuck](VM): removing shred: 17 (spork~exp)... count 15 [chuck](VM): removing shred: 18 (spork~exp)... count 16 [chuck](VM): removing shred: 19 (spork~exp)... count 17 [chuck](VM): removing shred: 20 (spork~exp)... count 18 [chuck](VM): removing shred: 21 (spork~exp)... count 19 [chuck](VM): removing shred: 22 (spork~exp)... count 20 [chuck](VM): removing shred: 23 (spork~exp)...*** buffer overflow detected ***: ./chuck terminated ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7fd43586cf47] /lib/x86_64-linux-gnu/libc.so.6(+0x109e40)[0x7fd43586be40] /lib/x86_64-linux-gnu/libc.so.6(+0x108d13)[0x7fd43586ad13] ./chuck[0x41585a] ./chuck[0x41cabb] ./chuck[0x46d898] ./chuck[0x50517f] ./chuck[0x4245d0] ./chuck[0x418d0e] ./chuck[0x41dbd2] ./chuck[0x41e077] ./chuck[0x40b6fd] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7fd43578376d] ./chuck[0x40dc55] ======= Memory map: ======== 00400000-0059d000 r-xp 00000000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 0079d000-0079e000 r--p 0019d000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 0079e000-007c5000 rw-p 0019e000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 007c5000-0084a000 rw-p 00000000 00:00 0 01db2000-020f9000 rw-p 00000000 00:00 0 [heap] 7fd428000000-7fd428021000 rw-p 00000000 00:00 0 7fd428021000-7fd42c000000 ---p 00000000 00:00 0 7fd42f3d8000-7fd42f3d9000 ---p 00000000 00:00 0 7fd42f3d9000-7fd42fbd9000 rw-p 00000000 00:00 0 7fd42fbd9000-7fd42fbdd000 r-xp 00000000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fbdd000-7fd42fddd000 ---p 00004000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fddd000-7fd42fdde000 r--p 00004000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fdde000-7fd42fddf000 rw-p 00005000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fddf000-7fd42fde1000 r-xp 00000000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42fde1000-7fd42ffe0000 ---p 00002000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe0000-7fd42ffe1000 r--p 00001000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe1000-7fd42ffe2000 rw-p 00002000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe2000-7fd42fff0000 r-xp 00000000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd42fff0000-7fd4301ef000 ---p 0000e000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301ef000-7fd4301f0000 r--p 0000d000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301f0000-7fd4301f1000 rw-p 0000e000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301f1000-7fd430209000 r-xp 00000000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd430209000-7fd430409000 ---p 00018000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd430409000-7fd43040a000 r--p 00018000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd43040a000-7fd43040b000 rw-p 00019000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd43040b000-7fd43040d000 rw-p 00000000 00:00 0 7fd43040d000-7fd430424000 r-xp 00000000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430424000-7fd430623000 ---p 00017000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430623000-7fd430624000 r--p 00016000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430624000-7fd430625000 rw-p 00017000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430625000-7fd430627000 rw-p 00000000 00:00 0 7fd430627000-7fd43062c000 r-xp 00000000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43062c000-7fd43082b000 ---p 00005000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082b000-7fd43082c000 r--p 00004000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082c000-7fd43082d000 rw-p 00005000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082d000-7fd43082f000 r-xp 00000000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd43082f000-7fd430a2e000 ---p 00002000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a2e000-7fd430a2f000 r--p 00001000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a2f000-7fd430a30000 rw-p 00002000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a30000-7fd430a35000 r-xp 00000000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430a35000-7fd430c34000 ---p 00005000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c34000-7fd430c35000 r--p 00004000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c35000-7fd430c36000 rw-p 00005000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c36000-7fd430c3e000 r-xp 00000000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430c3e000-7fd430e3d000 ---p 00008000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3d000-7fd430e3e000 r--p 00007000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3e000-7fd430e3f000 rw-p 00008000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3f000-7fd430e5c000 r-xp 00000000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd430e5c000-7fd43105b000 ---p 0001d000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105b000-7fd43105c000 r--p 0001c000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105c000-7fd43105d000 rw-p 0001d000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105d000-7fd431064000 r-xp 00000000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431064000-7fd431263000 ---p 00007000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431263000-7fd431264000 r--p 00006000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431264000-7fd431265000 rw-p 00007000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431265000-7fd431287000 r-xp 00000000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd431287000-7fd431487000 ---p 00022000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd431487000-7fd43148b000 r--p 00022000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd43148b000-7fd43148c000 rw-p 00026000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd43148c000-7fd4314e8000 r-xp 00000000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4314e8000-7fd4316e8000 ---p 0005c000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316e8000-7fd4316e9000 r--p 0005c000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316e9000-7fd4316ea000 rw-p 0005d000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316ea000-7fd431730000 r-xp 00000000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431730000-7fd431930000 ---p 00046000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431930000-7fd431931000 r--p 00046000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431931000-7fd431932000 rw-p 00047000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431932000-7fd43196e000 r-xp 00000000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd43196e000-7fd431b6d000 ---p 0003c000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6d000-7fd431b6e000 r--p 0003b000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6e000-7fd431b6f000 rw-p 0003c000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6f000-7fd431ba8000 r-xp 00000000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431ba8000-7fd431da8000 ---p 00039000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431da8000-7fd431daa000 r--p 00039000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431daa000-7fd431db0000 rw-p 0003b000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431db0000-7fd431db1000 rw-p 00000000 00:00 0 7fd431db1000-7fd431df3000 r-xp 00000000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431df3000-7fd431ff3000 ---p 00042000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff3000-7fd431ff4000 r--p 00042000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff4000-7fd431ff5000 rw-p 00043000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff5000-7fd431ff8000 r-xp 00000000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd431ff8000-7fd4321f7000 ---p 00003000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f7000-7fd4321f8000 r--p 00002000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f8000-7fd4321f9000 rw-p 00003000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f9000-7fd43220c000 r-xp 00000000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43220c000-7fd43240b000 ---p 00013000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240b000-7fd43240c000 r--p 00012000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240c000-7fd43240d000 rw-p 00013000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240d000-7fd432416000 rw-p 00000000 00:00 0 7fd432416000-7fd432508000 r-xp 00000000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432508000-7fd432708000 ---p 000f2000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432708000-7fd432709000 r--p 000f2000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432709000-7fd43270a000 rw-p 000f3000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd43270a000-7fd43270b000 rw-p 00000000 00:00 0 7fd43270b000-7fd43275f000 r-xp 00000000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd43275f000-7fd43295f000 ---p 00054000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd43295f000-7fd432960000 r--p 00054000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd432960000-7fd432962000 rw-p 00055000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd432962000-7fd4329d0000 rw-p 00000000 00:00 0 7fd4329d0000-7fd4329d2000 r-xp 00000000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd4329d2000-7fd432bd1000 ---p 00002000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd1000-7fd432bd2000 r--p 00001000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd2000-7fd432bd3000 rw-p 00002000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd3000-7fd432bda000 r-xp 00000000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432bda000-7fd432dd9000 ---p 00007000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432dd9000-7fd432dda000 r--p 00006000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432dda000-7fd432ddb000 rw-p 00007000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432ddb000-7fd432de6000 r-xp 00000000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432de6000-7fd432fe5000 ---p 0000b000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe5000-7fd432fe6000 r--p 0000a000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe6000-7fd432fe7000 rw-p 0000b000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe7000-7fd432fe9000 r-xp 00000000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd432fe9000-7fd4331e9000 ---p 00002000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331e9000-7fd4331ea000 r--p 00002000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331ea000-7fd4331eb000 rw-p 00003000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331eb000-7fd4331ed000 r-xp 00000000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4331ed000-7fd4333ed000 ---p 00002000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ed000-7fd4333ee000 r--p 00002000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ee000-7fd4333ef000 rw-p 00003000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ef000-7fd4333f3000 r-xp 00000000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4333f3000-7fd4335f2000 ---p 00004000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f2000-7fd4335f3000 r--p 00003000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f3000-7fd4335f4000 rw-p 00004000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f4000-7fd4335f8000 r-xp 00000000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4335f8000-7fd4337f7000 ---p 00004000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f7000-7fd4337f8000 r--p 00003000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f8000-7fd4337f9000 rw-p 00004000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f9000-7fd4337fa000 r-xp 00000000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4337fa000-7fd4339f9000 ---p 00001000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339f9000-7fd4339fa000 r--p 00000000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339fa000-7fd4339fb000 rw-p 00001000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339fb000-7fd4339fe000 r-xp 00000000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd4339fe000-7fd433bfd000 ---p 00003000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bfd000-7fd433bfe000 r--p 00002000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bfe000-7fd433bff000 rw-p 00003000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bff000-7fd433c00000 r-xp 00000000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433c00000-7fd433e00000 ---p 00001000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e00000-7fd433e01000 r--p 00001000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e01000-7fd433e02000 rw-p 00002000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e02000-7fd433e05000 r-xp 00000000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd433e05000-7fd434004000 ---p 00003000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434004000-7fd434005000 r--p 00002000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434005000-7fd434006000 rw-p 00003000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434006000-7fd43400b000 r-xp 00000000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43400b000-7fd43420a000 ---p 00005000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420a000-7fd43420b000 r--p 00004000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420b000-7fd43420c000 rw-p 00005000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420c000-7fd43420d000 rw-p 00000000 00:00 0 7fd43420d000-7fd43420e000 ---p 00000000 00:00 0 7fd43420e000-7fd434a0e000 rw-p 00000000 00:00 0 7fd434a0e000-7fd434a14000 r-xp 00000000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434a14000-7fd434c13000 ---p 00006000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c13000-7fd434c14000 r--p 00005000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c14000-7fd434c15000 rw-p 00006000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c15000-7fd434c40000 r-xp 00000000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434c40000-7fd434e3f000 ---p 0002b000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e3f000-7fd434e40000 r--p 0002a000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e40000-7fd434e41000 rw-p 0002b000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e41000-7fd4350f4000 r-xp 00000000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd4350f4000-7fd4352f3000 ---p 002b3000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd4352f3000-7fd43530f000 r--p 002b2000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd43530f000-7fd435310000 rw-p 002ce000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd435310000-7fd435358000 r-xp 00000000 08:03 663073 /usr/lib/x86_64-linux-gnu/libFLAC.so.8.2.0 7fd435358000-7fd435558000 ---p 00048000 08:03 663073 /usr/lib/x86_64-linux-gnu/libFLAC.so.8.2.0Aborted (core dumped)
I suppose we should move this to an issue on github at some point. . .
michael
Yuck, it behaves badly on Mac, but even worse on RPi. I get to maybe 30 shreds before it tanks... rs
On Mon, Jun 23, 2014 at 5:33 PM, Michael Heuer
wrote: Oops, forgot to increment count
<<<"count", count++>>>;
...
$ chuck --silent examples/dmxBug.ck [chuck](VM): removing shred: 2 (spork~exp)... count 0 [chuck](VM): removing shred: 3 (spork~exp)... count 1 ... [chuck](VM): removing shred: 144 (spork~exp)... count 142 [chuck](VM): removing shred: 145 (spork~exp)... count 143 [chuck](VM): removing shred: 146 (spork~exp)... Segmentation fault: 11
On Mon, Jun 23, 2014 at 5:31 PM, Michael Heuer
wrote:
Interesting find, even this simple example blows for me
dmxBug.ck:
fun void blink() { while (true) { 50::ms => now; } }
Shred shred; spork ~ blink() @=> shred;
0 => int count;
while (true) { 200::ms => now; shred.id() => Machine.remove; spork ~ blink() @=> shred; <<<"count", count>>>; }
$ chuck --silent examples/dmxBug.ck ... [chuck](VM): removing shred: 144 (spork~exp)... count 0 [chuck](VM): removing shred: 145 (spork~exp)... count 0 [chuck](VM): removing shred: 146 (spork~exp)... Segmentation fault: 11
michael
On Mon, Jun 23, 2014 at 5:17 PM, Ryan Supak
wrote: > Update: I eliminated everything I could from the Shreds that were being > Sporked, and I still get the exact same error (at exactly 147 Shreds.) > > Here is what I shortened the Shreds to: > > fun void Blink() > { > while( true ) > { > 50::ms => now; > } > } > > fun void LFOMod() > { > while( true ) > { > 50::ms => now; > } > } > > > On Mon, Jun 23, 2014 at 4:22 PM, Ryan Supak > wrote: >> >> Thanks for the thorough reply. I'm doing one safer, even than "voice >> stealing": each Spork is, at most, reconfiguring a single global >> oscillator. >> >> Attached is the entire source. Lines 128-142 contain initialization >> code >> that creates a Shred to make an LED blink by sending a MIDI message >> within a >> time loop, and another Shred that sets the frequency of an LFO, >> it >> every ten milliseconds, and sends some Serial output based on the LFO >> position. >> >> Anytime that the parameters controlling the blinking rate and the LFO >> rate/phase have occasion to change (when MIDI events come in to change >> them), the "old" Shreds are Machine.Remove'd and they're recreated >> immediately following. You can see this at lines 343 and 589. >> >> Notice that the LFOMod function and the Blink function aren't creating >> anything new (with the exception of local arguments being >> instantiated), but >> if you think those local arguments could be causing my problem I'll >> eliminate them too. >> >> Please see the attached. >> rs >> >> >> On Mon, Jun 23, 2014 at 11:59 AM, Perry R Cook <
On Mon, Jun 23, 2014 at 9:17 PM, Ryan Supak
wrote: polls prc@cs.princeton.edu> >> wrote: >>> >>> I have lots of programs that spork hundreds or thousands >>> of shreds without this error. So, without seeing your >>> code, my guesses (and questions) are as follows: >>> >>> Are you running this on a small memory architecture? Since >>> you say headless, I'm guessing maybe Raspberry Pi? It >>> could be that you're running out of memory, so see next >>> question. >>> >>> Does the shred that you're sporking declare new UGs or >>> require memory to be allocated (arrays, lots of string >>> manipulation, etc.)? In general, this is a bad idea if you >>> can avoid it. ChucK does no garbage collection, which >>> means that you need to be cautious about declaring memory. >>> >>> So even a shred as simple as: >>> >>> fun void mySine() { >>> SinOsc s => dac; >>> Math.random2f(100,1000) => s.freq; >>> second => now; >>> s =< dac; >>> } >>> >>> will eat up memory, because even though the SinOsc >>> is unchucked and never computes again, the memory >>> for that structure is still around. We want, someday >>> to make ChucK a proper garbage collecting language, >>> but it's hard, especially for real-time systems. >>> >>> If this turns out to be your issue, then one way to >>> handle this is to make a global pool of fixed >>> resources and have your shred grab from that. >>> Like classic "round robin voice stealing" in >>> synthesizers: >>> >>> SinOsc s[100]; >>> 0 => int next2Use; >>> >>> fun void mySine() { >>> next2Use => int thisOne; >>> 1 +=> next2Use; >>> if (next2Use > 99) 0 => next2Use; >>> s[thisOne] => dac; >>> Math.random2f(100,1000) => s[thisOne].freq; >>> second => now; >>> s[thisOne] =< dac; >>> } >>> >>> // to test: >>> while (1) { >>> Math.random2f(0.01,0.1) :: second => now; >>> spork ~ mySine(); >>> } >>> >>> I just fired up a few dozen of these running in >>> parallel, VM showed 2600 total shreds running, >>> no problem (and no clicks or dropouts!!). >>> >>> Hope this helps, if none of this applies, then you >>> may have discovered a strange bug. Source code please, >>> and we can all scratch our heads on it. >>> >>> Thanx!! PRC >>> >>> >>> Today's Topics: >>> >>> 1. 147th shred removed...segmentation fault? (Ryan Supak) >>> _______________________________________________ >>> chuck-users mailing list >>> chuck-users@lists.cs.princeton.edu >>> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users >> >> > > > _______________________________________________ > chuck-users mailing list > chuck-users@lists.cs.princeton.edu > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users >
chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu javascript:_e(%7B%7D,'cvml','chuck-users@lists.cs.princeton.edu'); https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Hello Spencer,
Your fix works for me for both this issue and issue #3 (chuck --probe
seg fault).
Thanks!
michael
On Sun, Jun 29, 2014 at 8:46 AM, Ryan Supak
Hooray! rs
On Sunday, June 29, 2014, Spencer Salazar
wrote: Hey y'all,
Think I figured this out, the internal message buffer (the one that says "sporking shred ...") was overflowing and randomly overwriting other parts of memory, causing crashes for seemingly unrelated reasons. Anyways, with the fix that is in the git repo, I can't get Michael's example to crash anymore. An updated release to come shortly!
spencer
On Tue, Jun 24, 2014 at 9:20 PM, Ryan Supak
wrote: I was able to work around it by not doing any Sporking in code, instead just updating global variables.
But, yeah, definite issue here. rs
On Tuesday, June 24, 2014, Michael Heuer
wrote: On linux, my example works fine with 1.3.3.0
... [chuck](VM): removing shred: 35000 (spork~exp)... count 34998 [chuck](VM): removing shred: 35001 (spork~exp)... count 34999 ^C[chuck]: cleaning up...
but not with 1.3.4.0 built with alsa support
$ ./chuck --silent ~/working/lick/examples/dmxBug.ck [chuck](VM): removing shred: 2 (spork~exp)... count 0 [chuck](VM): removing shred: 3 (spork~exp)... count 1 [chuck](VM): removing shred: 4 (spork~exp)... count 2 [chuck](VM): removing shred: 5 (spork~exp)... count 3 [chuck](VM): removing shred: 6 (spork~exp)... count 4 [chuck](VM): removing shred: 7 (spork~exp)... count 5 [chuck](VM): removing shred: 8 (spork~exp)... count 6 [chuck](VM): removing shred: 9 (spork~exp)... count 7 [chuck](VM): removing shred: 10 (spork~exp)... count 8 [chuck](VM): removing shred: 11 (spork~exp)... count 9 [chuck](VM): removing shred: 12 (spork~exp)... count 10 [chuck](VM): removing shred: 13 (spork~exp)... count 11 [chuck](VM): removing shred: 14 (spork~exp)... count 12 [chuck](VM): removing shred: 15 (spork~exp)... count 13 [chuck](VM): removing shred: 16 (spork~exp)... count 14 [chuck](VM): removing shred: 17 (spork~exp)... count 15 [chuck](VM): removing shred: 18 (spork~exp)... count 16 [chuck](VM): removing shred: 19 (spork~exp)... count 17 [chuck](VM): removing shred: 20 (spork~exp)... count 18 [chuck](VM): removing shred: 21 (spork~exp)... count 19 [chuck](VM): removing shred: 22 (spork~exp)... count 20 [chuck](VM): removing shred: 23 (spork~exp)...*** buffer overflow detected ***: ./chuck terminated ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7fd43586cf47] /lib/x86_64-linux-gnu/libc.so.6(+0x109e40)[0x7fd43586be40] /lib/x86_64-linux-gnu/libc.so.6(+0x108d13)[0x7fd43586ad13] ./chuck[0x41585a] ./chuck[0x41cabb] ./chuck[0x46d898] ./chuck[0x50517f] ./chuck[0x4245d0] ./chuck[0x418d0e] ./chuck[0x41dbd2] ./chuck[0x41e077] ./chuck[0x40b6fd] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7fd43578376d] ./chuck[0x40dc55] ======= Memory map: ======== 00400000-0059d000 r-xp 00000000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 0079d000-0079e000 r--p 0019d000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 0079e000-007c5000 rw-p 0019e000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 007c5000-0084a000 rw-p 00000000 00:00 0 01db2000-020f9000 rw-p 00000000 00:00 0 [heap] 7fd428000000-7fd428021000 rw-p 00000000 00:00 0 7fd428021000-7fd42c000000 ---p 00000000 00:00 0 7fd42f3d8000-7fd42f3d9000 ---p 00000000 00:00 0 7fd42f3d9000-7fd42fbd9000 rw-p 00000000 00:00 0 7fd42fbd9000-7fd42fbdd000 r-xp 00000000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fbdd000-7fd42fddd000 ---p 00004000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fddd000-7fd42fdde000 r--p 00004000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fdde000-7fd42fddf000 rw-p 00005000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fddf000-7fd42fde1000 r-xp 00000000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42fde1000-7fd42ffe0000 ---p 00002000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe0000-7fd42ffe1000 r--p 00001000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe1000-7fd42ffe2000 rw-p 00002000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe2000-7fd42fff0000 r-xp 00000000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd42fff0000-7fd4301ef000 ---p 0000e000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301ef000-7fd4301f0000 r--p 0000d000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301f0000-7fd4301f1000 rw-p 0000e000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301f1000-7fd430209000 r-xp 00000000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd430209000-7fd430409000 ---p 00018000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd430409000-7fd43040a000 r--p 00018000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd43040a000-7fd43040b000 rw-p 00019000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd43040b000-7fd43040d000 rw-p 00000000 00:00 0 7fd43040d000-7fd430424000 r-xp 00000000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430424000-7fd430623000 ---p 00017000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430623000-7fd430624000 r--p 00016000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430624000-7fd430625000 rw-p 00017000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430625000-7fd430627000 rw-p 00000000 00:00 0 7fd430627000-7fd43062c000 r-xp 00000000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43062c000-7fd43082b000 ---p 00005000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082b000-7fd43082c000 r--p 00004000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082c000-7fd43082d000 rw-p 00005000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082d000-7fd43082f000 r-xp 00000000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd43082f000-7fd430a2e000 ---p 00002000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a2e000-7fd430a2f000 r--p 00001000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a2f000-7fd430a30000 rw-p 00002000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a30000-7fd430a35000 r-xp 00000000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430a35000-7fd430c34000 ---p 00005000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c34000-7fd430c35000 r--p 00004000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c35000-7fd430c36000 rw-p 00005000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c36000-7fd430c3e000 r-xp 00000000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430c3e000-7fd430e3d000 ---p 00008000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3d000-7fd430e3e000 r--p 00007000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3e000-7fd430e3f000 rw-p 00008000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3f000-7fd430e5c000 r-xp 00000000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd430e5c000-7fd43105b000 ---p 0001d000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105b000-7fd43105c000 r--p 0001c000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105c000-7fd43105d000 rw-p 0001d000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105d000-7fd431064000 r-xp 00000000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431064000-7fd431263000 ---p 00007000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431263000-7fd431264000 r--p 00006000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431264000-7fd431265000 rw-p 00007000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431265000-7fd431287000 r-xp 00000000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd431287000-7fd431487000 ---p 00022000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd431487000-7fd43148b000 r--p 00022000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd43148b000-7fd43148c000 rw-p 00026000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd43148c000-7fd4314e8000 r-xp 00000000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4314e8000-7fd4316e8000 ---p 0005c000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316e8000-7fd4316e9000 r--p 0005c000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316e9000-7fd4316ea000 rw-p 0005d000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316ea000-7fd431730000 r-xp 00000000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431730000-7fd431930000 ---p 00046000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431930000-7fd431931000 r--p 00046000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431931000-7fd431932000 rw-p 00047000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431932000-7fd43196e000 r-xp 00000000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd43196e000-7fd431b6d000 ---p 0003c000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6d000-7fd431b6e000 r--p 0003b000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6e000-7fd431b6f000 rw-p 0003c000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6f000-7fd431ba8000 r-xp 00000000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431ba8000-7fd431da8000 ---p 00039000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431da8000-7fd431daa000 r--p 00039000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431daa000-7fd431db0000 rw-p 0003b000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431db0000-7fd431db1000 rw-p 00000000 00:00 0 7fd431db1000-7fd431df3000 r-xp 00000000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431df3000-7fd431ff3000 ---p 00042000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff3000-7fd431ff4000 r--p 00042000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff4000-7fd431ff5000 rw-p 00043000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff5000-7fd431ff8000 r-xp 00000000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd431ff8000-7fd4321f7000 ---p 00003000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f7000-7fd4321f8000 r--p 00002000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f8000-7fd4321f9000 rw-p 00003000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f9000-7fd43220c000 r-xp 00000000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43220c000-7fd43240b000 ---p 00013000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240b000-7fd43240c000 r--p 00012000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240c000-7fd43240d000 rw-p 00013000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240d000-7fd432416000 rw-p 00000000 00:00 0 7fd432416000-7fd432508000 r-xp 00000000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432508000-7fd432708000 ---p 000f2000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432708000-7fd432709000 r--p 000f2000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432709000-7fd43270a000 rw-p 000f3000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd43270a000-7fd43270b000 rw-p 00000000 00:00 0 7fd43270b000-7fd43275f000 r-xp 00000000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd43275f000-7fd43295f000 ---p 00054000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd43295f000-7fd432960000 r--p 00054000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd432960000-7fd432962000 rw-p 00055000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd432962000-7fd4329d0000 rw-p 00000000 00:00 0 7fd4329d0000-7fd4329d2000 r-xp 00000000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd4329d2000-7fd432bd1000 ---p 00002000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd1000-7fd432bd2000 r--p 00001000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd2000-7fd432bd3000 rw-p 00002000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd3000-7fd432bda000 r-xp 00000000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432bda000-7fd432dd9000 ---p 00007000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432dd9000-7fd432dda000 r--p 00006000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432dda000-7fd432ddb000 rw-p 00007000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432ddb000-7fd432de6000 r-xp 00000000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432de6000-7fd432fe5000 ---p 0000b000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe5000-7fd432fe6000 r--p 0000a000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe6000-7fd432fe7000 rw-p 0000b000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe7000-7fd432fe9000 r-xp 00000000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd432fe9000-7fd4331e9000 ---p 00002000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331e9000-7fd4331ea000 r--p 00002000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331ea000-7fd4331eb000 rw-p 00003000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331eb000-7fd4331ed000 r-xp 00000000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4331ed000-7fd4333ed000 ---p 00002000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ed000-7fd4333ee000 r--p 00002000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ee000-7fd4333ef000 rw-p 00003000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ef000-7fd4333f3000 r-xp 00000000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4333f3000-7fd4335f2000 ---p 00004000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f2000-7fd4335f3000 r--p 00003000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f3000-7fd4335f4000 rw-p 00004000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f4000-7fd4335f8000 r-xp 00000000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4335f8000-7fd4337f7000 ---p 00004000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f7000-7fd4337f8000 r--p 00003000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f8000-7fd4337f9000 rw-p 00004000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f9000-7fd4337fa000 r-xp 00000000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4337fa000-7fd4339f9000 ---p 00001000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339f9000-7fd4339fa000 r--p 00000000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339fa000-7fd4339fb000 rw-p 00001000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339fb000-7fd4339fe000 r-xp 00000000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd4339fe000-7fd433bfd000 ---p 00003000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bfd000-7fd433bfe000 r--p 00002000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bfe000-7fd433bff000 rw-p 00003000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bff000-7fd433c00000 r-xp 00000000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433c00000-7fd433e00000 ---p 00001000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e00000-7fd433e01000 r--p 00001000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e01000-7fd433e02000 rw-p 00002000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e02000-7fd433e05000 r-xp 00000000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd433e05000-7fd434004000 ---p 00003000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434004000-7fd434005000 r--p 00002000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434005000-7fd434006000 rw-p 00003000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434006000-7fd43400b000 r-xp 00000000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43400b000-7fd43420a000 ---p 00005000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420a000-7fd43420b000 r--p 00004000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420b000-7fd43420c000 rw-p 00005000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420c000-7fd43420d000 rw-p 00000000 00:00 0 7fd43420d000-7fd43420e000 ---p 00000000 00:00 0 7fd43420e000-7fd434a0e000 rw-p 00000000 00:00 0 7fd434a0e000-7fd434a14000 r-xp 00000000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434a14000-7fd434c13000 ---p 00006000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c13000-7fd434c14000 r--p 00005000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c14000-7fd434c15000 rw-p 00006000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c15000-7fd434c40000 r-xp 00000000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434c40000-7fd434e3f000 ---p 0002b000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e3f000-7fd434e40000 r--p 0002a000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e40000-7fd434e41000 rw-p 0002b000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e41000-7fd4350f4000 r-xp 00000000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd4350f4000-7fd4352f3000 ---p 002b3000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd4352f3000-7fd43530f000 r--p 002b2000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd43530f000-7fd435310000 rw-p 002ce000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd435310000-7fd435358000 r-xp 00000000 08:03 663073 /usr/lib/x86_64-linux-gnu/libFLAC.so.8.2.0 7fd435358000-7fd435558000 ---p 00048000 08:03 663073 /usr/lib/x86_64-linux-gnu/libFLAC.so.8.2.0Aborted (core dumped)
I suppose we should move this to an issue on github at some point. . .
michael
On Mon, Jun 23, 2014 at 9:17 PM, Ryan Supak
wrote: Yuck, it behaves badly on Mac, but even worse on RPi. I get to maybe 30 shreds before it tanks... rs
On Mon, Jun 23, 2014 at 5:33 PM, Michael Heuer
wrote: Oops, forgot to increment count
<<<"count", count++>>>;
...
$ chuck --silent examples/dmxBug.ck [chuck](VM): removing shred: 2 (spork~exp)... count 0 [chuck](VM): removing shred: 3 (spork~exp)... count 1 ... [chuck](VM): removing shred: 144 (spork~exp)... count 142 [chuck](VM): removing shred: 145 (spork~exp)... count 143 [chuck](VM): removing shred: 146 (spork~exp)... Segmentation fault: 11
On Mon, Jun 23, 2014 at 5:31 PM, Michael Heuer
wrote: > Interesting find, even this simple example blows for me > > dmxBug.ck: > > fun void blink() > { > while (true) > { > 50::ms => now; > } > } > > Shred shred; > spork ~ blink() @=> shred; > > 0 => int count; > > while (true) > { > 200::ms => now; > shred.id() => Machine.remove; > spork ~ blink() @=> shred; > <<<"count", count>>>; > } > > $ chuck --silent examples/dmxBug.ck > ... > [chuck](VM): removing shred: 144 (spork~exp)... > count 0 > [chuck](VM): removing shred: 145 (spork~exp)... > count 0 > [chuck](VM): removing shred: 146 (spork~exp)... > Segmentation fault: 11 > > michael > > > On Mon, Jun 23, 2014 at 5:17 PM, Ryan Supak > wrote: >> Update: I eliminated everything I could from the Shreds that were >> being >> Sporked, and I still get the exact same error (at exactly 147 >> Shreds.) >> >> Here is what I shortened the Shreds to: >> >> fun void Blink() >> { >> while( true ) >> { >> 50::ms => now; >> } >> } >> >> fun void LFOMod() >> { >> while( true ) >> { >> 50::ms => now; >> } >> } >> >> >> On Mon, Jun 23, 2014 at 4:22 PM, Ryan Supak >> wrote: >>> >>> Thanks for the thorough reply. I'm doing one safer, even than >>> "voice >>> stealing": each Spork is, at most, reconfiguring a single global >>> oscillator. >>> >>> Attached is the entire source. Lines 128-142 contain >>> initialization >>> code >>> that creates a Shred to make an LED blink by sending a MIDI >>> message >>> within a >>> time loop, and another Shred that sets the frequency of an LFO, >>> polls >>> it >>> every ten milliseconds, and sends some Serial output based on the >>> LFO >>> position. >>> >>> Anytime that the parameters controlling the blinking rate and the >>> LFO >>> rate/phase have occasion to change (when MIDI events come in to >>> change >>> them), the "old" Shreds are Machine.Remove'd and they're >>> recreated >>> immediately following. You can see this at lines 343 and 589. >>> >>> Notice that the LFOMod function and the Blink function aren't >>> creating >>> anything new (with the exception of local arguments being >>> instantiated), but >>> if you think those local arguments could be causing my problem >>> I'll >>> eliminate them too. >>> >>> Please see the attached. >>> rs >>> >>> >>> On Mon, Jun 23, 2014 at 11:59 AM, Perry R Cook >>> >>> wrote: >>>> >>>> I have lots of programs that spork hundreds or thousands >>>> of shreds without this error. So, without seeing your >>>> code, my guesses (and questions) are as follows: >>>> >>>> Are you running this on a small memory architecture? Since >>>> you say headless, I'm guessing maybe Raspberry Pi? It >>>> could be that you're running out of memory, so see next >>>> question. >>>> >>>> Does the shred that you're sporking declare new UGs or >>>> require memory to be allocated (arrays, lots of string >>>> manipulation, etc.)? In general, this is a bad idea if you >>>> can avoid it. ChucK does no garbage collection, which >>>> means that you need to be cautious about declaring memory. >>>> >>>> So even a shred as simple as: >>>> >>>> fun void mySine() { >>>> SinOsc s => dac; >>>> Math.random2f(100,1000) => s.freq; >>>> second => now; >>>> s =< dac; >>>> } >>>> >>>> will eat up memory, because even though the SinOsc >>>> is unchucked and never computes again, the memory >>>> for that structure is still around. We want, someday >>>> to make ChucK a proper garbage collecting language, >>>> but it's hard, especially for real-time systems. >>>> >>>> If this turns out to be your issue, then one way to >>>> handle this is to make a global pool of fixed >>>> resources and have your shred grab from that. >>>> Like classic "round robin voice stealing" in >>>> synthesizers: >>>> >>>> SinOsc s[100]; >>>> 0 => int next2Use; >>>> >>>> fun void mySine() { >>>> next2Use => int thisOne; >>>> 1 +=> next2Use; >>>> if (next2Use > 99) 0 => next2Use; >>>> s[thisOne] => dac; >>>> Math.random2f(100,1000) => s[thisOne].freq; >>>> second => now; >>>> s[thisOne] =< dac; >>>> } >>>> >>>> // to test: >>>> while (1) { >>>> Math.random2f(0.01,0.1) :: second => now; >>>> spork ~ mySine(); >>>> } >>>> >>>> I just fired up a few dozen of these running in >>>> parallel, VM showed 2600 total shreds running, >>>> no problem (and no clicks or dropouts!!). >>>> >>>> Hope this helps, if none of this applies, then you >>>> may have discovered a strange bug. Source code please, >>>> and we can all scratch our heads on it. >>>> >>>> Thanx!! PRC >>>> >>>> >>>> Today's Topics: >>>> >>>> 1. 147th shred removed...segmentation fault? (Ryan Supak) >>>> _______________________________________________ >>>> chuck-users mailing list >>>> chuck-users@lists.cs.princeton.edu >>>> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users >>> >>> >> >> >> _______________________________________________ >> chuck-users mailing list >> chuck-users@lists.cs.princeton.edu >> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users >> _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Great, thanks!
On Mon, Jun 30, 2014 at 11:31 PM, Michael Heuer
Hello Spencer,
Your fix works for me for both this issue and issue #3 (chuck --probe seg fault).
Thanks!
michael
Hooray! rs
On Sunday, June 29, 2014, Spencer Salazar
wrote: Hey y'all,
Think I figured this out, the internal message buffer (the one that says "sporking shred ...") was overflowing and randomly overwriting other
of memory, causing crashes for seemingly unrelated reasons. Anyways, with the fix that is in the git repo, I can't get Michael's example to crash anymore. An updated release to come shortly!
spencer
On Tue, Jun 24, 2014 at 9:20 PM, Ryan Supak
wrote: I was able to work around it by not doing any Sporking in code, instead just updating global variables.
But, yeah, definite issue here. rs
On Tuesday, June 24, 2014, Michael Heuer
wrote: On linux, my example works fine with 1.3.3.0
... [chuck](VM): removing shred: 35000 (spork~exp)... count 34998 [chuck](VM): removing shred: 35001 (spork~exp)... count 34999 ^C[chuck]: cleaning up...
but not with 1.3.4.0 built with alsa support
$ ./chuck --silent ~/working/lick/examples/dmxBug.ck [chuck](VM): removing shred: 2 (spork~exp)... count 0 [chuck](VM): removing shred: 3 (spork~exp)... count 1 [chuck](VM): removing shred: 4 (spork~exp)... count 2 [chuck](VM): removing shred: 5 (spork~exp)... count 3 [chuck](VM): removing shred: 6 (spork~exp)... count 4 [chuck](VM): removing shred: 7 (spork~exp)... count 5 [chuck](VM): removing shred: 8 (spork~exp)... count 6 [chuck](VM): removing shred: 9 (spork~exp)... count 7 [chuck](VM): removing shred: 10 (spork~exp)... count 8 [chuck](VM): removing shred: 11 (spork~exp)... count 9 [chuck](VM): removing shred: 12 (spork~exp)... count 10 [chuck](VM): removing shred: 13 (spork~exp)... count 11 [chuck](VM): removing shred: 14 (spork~exp)... count 12 [chuck](VM): removing shred: 15 (spork~exp)... count 13 [chuck](VM): removing shred: 16 (spork~exp)... count 14 [chuck](VM): removing shred: 17 (spork~exp)... count 15 [chuck](VM): removing shred: 18 (spork~exp)... count 16 [chuck](VM): removing shred: 19 (spork~exp)... count 17 [chuck](VM): removing shred: 20 (spork~exp)... count 18 [chuck](VM): removing shred: 21 (spork~exp)... count 19 [chuck](VM): removing shred: 22 (spork~exp)... count 20 [chuck](VM): removing shred: 23 (spork~exp)...*** buffer overflow detected ***: ./chuck terminated ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7fd43586cf47] /lib/x86_64-linux-gnu/libc.so.6(+0x109e40)[0x7fd43586be40] /lib/x86_64-linux-gnu/libc.so.6(+0x108d13)[0x7fd43586ad13] ./chuck[0x41585a] ./chuck[0x41cabb] ./chuck[0x46d898] ./chuck[0x50517f] ./chuck[0x4245d0] ./chuck[0x418d0e] ./chuck[0x41dbd2] ./chuck[0x41e077] ./chuck[0x40b6fd]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7fd43578376d]
./chuck[0x40dc55] ======= Memory map: ======== 00400000-0059d000 r-xp 00000000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 0079d000-0079e000 r--p 0019d000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 0079e000-007c5000 rw-p 0019e000 08:03 269080 /home/heuermh/bin/chuck-1.3.4.0/src/chuck 007c5000-0084a000 rw-p 00000000 00:00 0 01db2000-020f9000 rw-p 00000000 00:00 0 [heap] 7fd428000000-7fd428021000 rw-p 00000000 00:00 0 7fd428021000-7fd42c000000 ---p 00000000 00:00 0 7fd42f3d8000-7fd42f3d9000 ---p 00000000 00:00 0 7fd42f3d9000-7fd42fbd9000 rw-p 00000000 00:00 0 7fd42fbd9000-7fd42fbdd000 r-xp 00000000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fbdd000-7fd42fddd000 ---p 00004000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fddd000-7fd42fdde000 r--p 00004000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fdde000-7fd42fddf000 rw-p 00005000 08:03 802428 /usr/lib/chuck/GVerb.chug 7fd42fddf000-7fd42fde1000 r-xp 00000000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42fde1000-7fd42ffe0000 ---p 00002000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe0000-7fd42ffe1000 r--p 00001000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe1000-7fd42ffe2000 rw-p 00002000 08:03 802423 /usr/lib/chuck/KasFilter.chug 7fd42ffe2000-7fd42fff0000 r-xp 00000000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd42fff0000-7fd4301ef000 ---p 0000e000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301ef000-7fd4301f0000 r--p 0000d000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301f0000-7fd4301f1000 rw-p 0000e000 08:03 802430 /usr/lib/chuck/Spectacle.chug 7fd4301f1000-7fd430209000 r-xp 00000000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd430209000-7fd430409000 ---p 00018000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd430409000-7fd43040a000 r--p 00018000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd43040a000-7fd43040b000 rw-p 00019000 08:03 3411496 /lib/x86_64-linux-gnu/libresolv-2.15.so 7fd43040b000-7fd43040d000 rw-p 00000000 00:00 0 7fd43040d000-7fd430424000 r-xp 00000000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430424000-7fd430623000 ---p 00017000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430623000-7fd430624000 r--p 00016000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430624000-7fd430625000 rw-p 00017000 08:03 3411602 /lib/x86_64-linux-gnu/libnsl-2.15.so 7fd430625000-7fd430627000 rw-p 00000000 00:00 0 7fd430627000-7fd43062c000 r-xp 00000000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43062c000-7fd43082b000 ---p 00005000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082b000-7fd43082c000 r--p 00004000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082c000-7fd43082d000 rw-p 00005000 08:03 663153 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0 7fd43082d000-7fd43082f000 r-xp 00000000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd43082f000-7fd430a2e000 ---p 00002000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a2e000-7fd430a2f000 r--p 00001000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a2f000-7fd430a30000 rw-p 00002000 08:03 663140 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 7fd430a30000-7fd430a35000 r-xp 00000000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430a35000-7fd430c34000 ---p 00005000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c34000-7fd430c35000 r--p 00004000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c35000-7fd430c36000 rw-p 00005000 08:03 663205 /usr/lib/x86_64-linux-gnu/libasyncns.so.0.3.1 7fd430c36000-7fd430c3e000 r-xp 00000000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430c3e000-7fd430e3d000 ---p 00008000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3d000-7fd430e3e000 r--p 00007000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3e000-7fd430e3f000 rw-p 00008000 08:03 3411651 /lib/x86_64-linux-gnu/libwrap.so.0.7.6 7fd430e3f000-7fd430e5c000 r-xp 00000000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd430e5c000-7fd43105b000 ---p 0001d000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105b000-7fd43105c000 r--p 0001c000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105c000-7fd43105d000 rw-p 0001d000 08:03 657105 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 7fd43105d000-7fd431064000 r-xp 00000000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431064000-7fd431263000 ---p 00007000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431263000-7fd431264000 r--p 00006000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431264000-7fd431265000 rw-p 00007000 08:03 663531 /usr/lib/x86_64-linux-gnu/libjson.so.0.0.1 7fd431265000-7fd431287000 r-xp 00000000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd431287000-7fd431487000 ---p 00022000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd431487000-7fd43148b000 r--p 00022000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd43148b000-7fd43148c000 rw-p 00026000 08:03 3411639 /lib/x86_64-linux-gnu/libtinfo.so.5.9 7fd43148c000-7fd4314e8000 r-xp 00000000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4314e8000-7fd4316e8000 ---p 0005c000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316e8000-7fd4316e9000 r--p 0005c000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316e9000-7fd4316ea000 rw-p 0005d000 08:03 662027 /usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so 7fd4316ea000-7fd431730000 r-xp 00000000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431730000-7fd431930000 ---p 00046000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431930000-7fd431931000 r--p 00046000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431931000-7fd431932000 rw-p 00047000 08:03 661818 /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.5 7fd431932000-7fd43196e000 r-xp 00000000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd43196e000-7fd431b6d000 ---p 0003c000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6d000-7fd431b6e000 r--p 0003b000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6e000-7fd431b6f000 rw-p 0003c000 08:03 3411615 /lib/x86_64-linux-gnu/libpcre.so.3.12.1 7fd431b6f000-7fd431ba8000 r-xp 00000000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431ba8000-7fd431da8000 ---p 00039000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431da8000-7fd431daa000 r--p 00039000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431daa000-7fd431db0000 rw-p 0003b000 08:03 3411625 /lib/x86_64-linux-gnu/libreadline.so.6.2 7fd431db0000-7fd431db1000 rw-p 00000000 00:00 0 7fd431db1000-7fd431df3000 r-xp 00000000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431df3000-7fd431ff3000 ---p 00042000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff3000-7fd431ff4000 r--p 00042000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff4000-7fd431ff5000 rw-p 00043000 08:03 3407910 /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8 7fd431ff5000-7fd431ff8000 r-xp 00000000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd431ff8000-7fd4321f7000 ---p 00003000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f7000-7fd4321f8000 r--p 00002000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f8000-7fd4321f9000 rw-p 00003000 08:03 662026 /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3 7fd4321f9000-7fd43220c000 r-xp 00000000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43220c000-7fd43240b000 ---p 00013000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240b000-7fd43240c000 r--p 00012000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240c000-7fd43240d000 rw-p 00013000 08:03 656534 /usr/lib/x86_64-linux-gnu/libjack.so.0.0.28 7fd43240d000-7fd432416000 rw-p 00000000 00:00 0 7fd432416000-7fd432508000 r-xp 00000000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432508000-7fd432708000 ---p 000f2000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432708000-7fd432709000 r--p 000f2000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd432709000-7fd43270a000 rw-p 000f3000 08:03 3407908 /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4 7fd43270a000-7fd43270b000 rw-p 00000000 00:00 0 7fd43270b000-7fd43275f000 r-xp 00000000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd43275f000-7fd43295f000 ---p 00054000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd43295f000-7fd432960000 r--p 00054000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd432960000-7fd432962000 rw-p 00055000 08:03 671207 /usr/lib/x86_64-linux-gnu/libfluidsynth.so.1.5.1 7fd432962000-7fd4329d0000 rw-p 00000000 00:00 0 7fd4329d0000-7fd4329d2000 r-xp 00000000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd4329d2000-7fd432bd1000 ---p 00002000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd1000-7fd432bd2000 r--p 00001000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd2000-7fd432bd3000 rw-p 00002000 08:03 802431 /usr/lib/chuck/FluidSynth.chug 7fd432bd3000-7fd432bda000 r-xp 00000000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432bda000-7fd432dd9000 ---p 00007000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432dd9000-7fd432dda000 r--p 00006000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432dda000-7fd432ddb000 rw-p 00007000 08:03 796739 /usr/lib/chuck/Sigmund.chug 7fd432ddb000-7fd432de6000 r-xp 00000000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432de6000-7fd432fe5000 ---p 0000b000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe5000-7fd432fe6000 r--p 0000a000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe6000-7fd432fe7000 rw-p 0000b000 08:03 802429 /usr/lib/chuck/Mesh2D.chug 7fd432fe7000-7fd432fe9000 r-xp 00000000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd432fe9000-7fd4331e9000 ---p 00002000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331e9000-7fd4331ea000 r--p 00002000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331ea000-7fd4331eb000 rw-p 00003000 08:03 802426 /usr/lib/chuck/PanN.chug 7fd4331eb000-7fd4331ed000 r-xp 00000000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4331ed000-7fd4333ed000 ---p 00002000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ed000-7fd4333ee000 r--p 00002000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ee000-7fd4333ef000 rw-p 00003000 08:03 797714 /usr/lib/chuck/ExpDelay.chug 7fd4333ef000-7fd4333f3000 r-xp 00000000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4333f3000-7fd4335f2000 ---p 00004000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f2000-7fd4335f3000 r--p 00003000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f3000-7fd4335f4000 rw-p 00004000 08:03 802427 /usr/lib/chuck/PitchTrack.chug 7fd4335f4000-7fd4335f8000 r-xp 00000000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4335f8000-7fd4337f7000 ---p 00004000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f7000-7fd4337f8000 r--p 00003000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f8000-7fd4337f9000 rw-p 00004000 08:03 799399 /usr/lib/chuck/Ladspa.chug 7fd4337f9000-7fd4337fa000 r-xp 00000000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4337fa000-7fd4339f9000 ---p 00001000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339f9000-7fd4339fa000 r--p 00000000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339fa000-7fd4339fb000 rw-p 00001000 08:03 802424 /usr/lib/chuck/MagicSine.chug 7fd4339fb000-7fd4339fe000 r-xp 00000000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd4339fe000-7fd433bfd000 ---p 00003000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bfd000-7fd433bfe000 r--p 00002000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bfe000-7fd433bff000 rw-p 00003000 08:03 802421 /usr/lib/chuck/ABSaturator.chug 7fd433bff000-7fd433c00000 r-xp 00000000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433c00000-7fd433e00000 ---p 00001000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e00000-7fd433e01000 r--p 00001000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e01000-7fd433e02000 rw-p 00002000 08:03 802422 /usr/lib/chuck/Bitcrusher.chug 7fd433e02000-7fd433e05000 r-xp 00000000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd433e05000-7fd434004000 ---p 00003000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434004000-7fd434005000 r--p 00002000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434005000-7fd434006000 rw-p 00003000 08:03 802425 /usr/lib/chuck/FIR.chug 7fd434006000-7fd43400b000 r-xp 00000000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43400b000-7fd43420a000 ---p 00005000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420a000-7fd43420b000 r--p 00004000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420b000-7fd43420c000 rw-p 00005000 08:03 802432 /usr/lib/chuck/Elliptic.chug 7fd43420c000-7fd43420d000 rw-p 00000000 00:00 0 7fd43420d000-7fd43420e000 ---p 00000000 00:00 0 7fd43420e000-7fd434a0e000 rw-p 00000000 00:00 0 7fd434a0e000-7fd434a14000 r-xp 00000000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434a14000-7fd434c13000 ---p 00006000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c13000-7fd434c14000 r--p 00005000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c14000-7fd434c15000 rw-p 00006000 08:03 663601 /usr/lib/x86_64-linux-gnu/libogg.so.0.7.1 7fd434c15000-7fd434c40000 r-xp 00000000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434c40000-7fd434e3f000 ---p 0002b000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e3f000-7fd434e40000 r--p 0002a000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e40000-7fd434e41000 rw-p 0002b000 08:03 663780 /usr/lib/x86_64-linux-gnu/libvorbis.so.0.4.5 7fd434e41000-7fd4350f4000 r-xp 00000000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd4350f4000-7fd4352f3000 ---p 002b3000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd4352f3000-7fd43530f000 r--p 002b2000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd43530f000-7fd435310000 rw-p 002ce000 08:03 663782 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2.0.8 7fd435310000-7fd435358000 r-xp 00000000 08:03 663073 /usr/lib/x86_64-linux-gnu/libFLAC.so.8.2.0 7fd435358000-7fd435558000 ---p 00048000 08:03 663073 /usr/lib/x86_64-linux-gnu/libFLAC.so.8.2.0Aborted (core dumped)
I suppose we should move this to an issue on github at some point. . .
michael
On Mon, Jun 23, 2014 at 9:17 PM, Ryan Supak
wrote: Yuck, it behaves badly on Mac, but even worse on RPi. I get to maybe 30 shreds before it tanks... rs
On Mon, Jun 23, 2014 at 5:33 PM, Michael Heuer
wrote: > > Oops, forgot to increment count > > <<<"count", count++>>>; > > ... > > $ chuck --silent examples/dmxBug.ck > [chuck](VM): removing shred: 2 (spork~exp)... > count 0 > [chuck](VM): removing shred: 3 (spork~exp)... > count 1 > ... > [chuck](VM): removing shred: 144 (spork~exp)... > count 142 > [chuck](VM): removing shred: 145 (spork~exp)... > count 143 > [chuck](VM): removing shred: 146 (spork~exp)... > Segmentation fault: 11 > > > On Mon, Jun 23, 2014 at 5:31 PM, Michael Heuer > wrote: > > Interesting find, even this simple example blows for me > > > > dmxBug.ck: > > > > fun void blink() > > { > > while (true) > > { > > 50::ms => now; > > } > > } > > > > Shred shred; > > spork ~ blink() @=> shred; > > > > 0 => int count; > > > > while (true) > > { > > 200::ms => now; > > shred.id() => Machine.remove; > > spork ~ blink() @=> shred; > > <<<"count", count>>>; > > } > > > > $ chuck --silent examples/dmxBug.ck > > ... > > [chuck](VM): removing shred: 144 (spork~exp)... > > count 0 > > [chuck](VM): removing shred: 145 (spork~exp)... > > count 0 > > [chuck](VM): removing shred: 146 (spork~exp)... > > Segmentation fault: 11 > > > > michael > > > > > > On Mon, Jun 23, 2014 at 5:17 PM, Ryan Supak > > wrote: > >> Update: I eliminated everything I could from the Shreds that were > >> being > >> Sporked, and I still get the exact same error (at exactly 147 > >> Shreds.) > >> > >> Here is what I shortened the Shreds to: > >> > >> fun void Blink() > >> { > >> while( true ) > >> { > >> 50::ms => now; > >> } > >> } > >> > >> fun void LFOMod() > >> { > >> while( true ) > >> { > >> 50::ms => now; > >> } > >> } > >> > >> > >> On Mon, Jun 23, 2014 at 4:22 PM, Ryan Supak < ryansupak@gmail.com> > >> wrote: > >>> > >>> Thanks for the thorough reply. I'm doing one safer, even than > >>> "voice > >>> stealing": each Spork is, at most, reconfiguring a single global > >>> oscillator. > >>> > >>> Attached is the entire source. Lines 128-142 contain > >>> initialization > >>> code > >>> that creates a Shred to make an LED blink by sending a MIDI > >>> message > >>> within a > >>> time loop, and another Shred that sets the frequency of an LFO, > >>> polls > >>> it > >>> every ten milliseconds, and sends some Serial output based on
> >>> LFO > >>> position. > >>> > >>> Anytime that the parameters controlling the blinking rate and
On Sun, Jun 29, 2014 at 8:46 AM, Ryan Supak
wrote: parts the the > >>> LFO > >>> rate/phase have occasion to change (when MIDI events come in to > >>> change > >>> them), the "old" Shreds are Machine.Remove'd and they're > >>> recreated > >>> immediately following. You can see this at lines 343 and 589. > >>> > >>> Notice that the LFOMod function and the Blink function aren't > >>> creating > >>> anything new (with the exception of local arguments being > >>> instantiated), but > >>> if you think those local arguments could be causing my problem > >>> I'll > >>> eliminate them too. > >>> > >>> Please see the attached. > >>> rs > >>> > >>> > >>> On Mon, Jun 23, 2014 at 11:59 AM, Perry R Cook > >>>
> >>> wrote: > >>>> > >>>> I have lots of programs that spork hundreds or thousands > >>>> of shreds without this error. So, without seeing your > >>>> code, my guesses (and questions) are as follows: > >>>> > >>>> Are you running this on a small memory architecture? Since > >>>> you say headless, I'm guessing maybe Raspberry Pi? It > >>>> could be that you're running out of memory, so see next > >>>> question. > >>>> > >>>> Does the shred that you're sporking declare new UGs or > >>>> require memory to be allocated (arrays, lots of string > >>>> manipulation, etc.)? In general, this is a bad idea if you > >>>> can avoid it. ChucK does no garbage collection, which > >>>> means that you need to be cautious about declaring memory. > >>>> > >>>> So even a shred as simple as: > >>>> > >>>> fun void mySine() { > >>>> SinOsc s => dac; > >>>> Math.random2f(100,1000) => s.freq; > >>>> second => now; > >>>> s =< dac; > >>>> } > >>>> > >>>> will eat up memory, because even though the SinOsc > >>>> is unchucked and never computes again, the memory > >>>> for that structure is still around. We want, someday > >>>> to make ChucK a proper garbage collecting language, > >>>> but it's hard, especially for real-time systems. > >>>> > >>>> If this turns out to be your issue, then one way to > >>>> handle this is to make a global pool of fixed > >>>> resources and have your shred grab from that. > >>>> Like classic "round robin voice stealing" in > >>>> synthesizers: > >>>> > >>>> SinOsc s[100]; > >>>> 0 => int next2Use; > >>>> > >>>> fun void mySine() { > >>>> next2Use => int thisOne; > >>>> 1 +=> next2Use; > >>>> if (next2Use > 99) 0 => next2Use; > >>>> s[thisOne] => dac; > >>>> Math.random2f(100,1000) => s[thisOne].freq; > >>>> second => now; > >>>> s[thisOne] =< dac; > >>>> } > >>>> > >>>> // to test: > >>>> while (1) { > >>>> Math.random2f(0.01,0.1) :: second => now; > >>>> spork ~ mySine(); > >>>> } > >>>> > >>>> I just fired up a few dozen of these running in > >>>> parallel, VM showed 2600 total shreds running, > >>>> no problem (and no clicks or dropouts!!). > >>>> > >>>> Hope this helps, if none of this applies, then you > >>>> may have discovered a strange bug. Source code please, > >>>> and we can all scratch our heads on it. > >>>> > >>>> Thanx!! PRC > >>>> > >>>> > >>>> Today's Topics: > >>>> > >>>> 1. 147th shred removed...segmentation fault? (Ryan Supak) > >>>> _______________________________________________ > >>>> chuck-users mailing list > >>>> chuck-users@lists.cs.princeton.edu > >>>> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users > >>> > >>> > >> > >> > >> _______________________________________________ > >> chuck-users mailing list > >> chuck-users@lists.cs.princeton.edu > >> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users > >> > _______________________________________________ > chuck-users mailing list > chuck-users@lists.cs.princeton.edu > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
I am testing this on Mac with the latest ChucK binary, FWIW.
rs
On Monday, June 23, 2014, Michael Heuer
Interesting find, even this simple example blows for me
dmxBug.ck:
fun void blink() { while (true) { 50::ms => now; } }
Shred shred; spork ~ blink() @=> shred;
0 => int count;
while (true) { 200::ms => now; shred.id() => Machine.remove; spork ~ blink() @=> shred; <<<"count", count>>>; }
$ chuck --silent examples/dmxBug.ck ... [chuck](VM): removing shred: 144 (spork~exp)... count 0 [chuck](VM): removing shred: 145 (spork~exp)... count 0 [chuck](VM): removing shred: 146 (spork~exp)... Segmentation fault: 11
michael
On Mon, Jun 23, 2014 at 5:17 PM, Ryan Supak
javascript:;> wrote: Update: I eliminated everything I could from the Shreds that were being Sporked, and I still get the exact same error (at exactly 147 Shreds.)
Here is what I shortened the Shreds to:
fun void Blink() { while( true ) { 50::ms => now; } }
fun void LFOMod() { while( true ) { 50::ms => now; } }
On Mon, Jun 23, 2014 at 4:22 PM, Ryan Supak
javascript:;> wrote: Thanks for the thorough reply. I'm doing one safer, even than "voice stealing": each Spork is, at most, reconfiguring a single global
oscillator.
Attached is the entire source. Lines 128-142 contain initialization code that creates a Shred to make an LED blink by sending a MIDI message
within a
time loop, and another Shred that sets the frequency of an LFO, polls it every ten milliseconds, and sends some Serial output based on the LFO position.
Anytime that the parameters controlling the blinking rate and the LFO rate/phase have occasion to change (when MIDI events come in to change them), the "old" Shreds are Machine.Remove'd and they're recreated immediately following. You can see this at lines 343 and 589.
Notice that the LFOMod function and the Blink function aren't creating anything new (with the exception of local arguments being instantiated), but if you think those local arguments could be causing my problem I'll eliminate them too.
Please see the attached. rs
On Mon, Jun 23, 2014 at 11:59 AM, Perry R Cook
javascript:;> wrote: I have lots of programs that spork hundreds or thousands of shreds without this error. So, without seeing your code, my guesses (and questions) are as follows:
Are you running this on a small memory architecture? Since you say headless, I'm guessing maybe Raspberry Pi? It could be that you're running out of memory, so see next question.
Does the shred that you're sporking declare new UGs or require memory to be allocated (arrays, lots of string manipulation, etc.)? In general, this is a bad idea if you can avoid it. ChucK does no garbage collection, which means that you need to be cautious about declaring memory.
So even a shred as simple as:
fun void mySine() { SinOsc s => dac; Math.random2f(100,1000) => s.freq; second => now; s =< dac; }
will eat up memory, because even though the SinOsc is unchucked and never computes again, the memory for that structure is still around. We want, someday to make ChucK a proper garbage collecting language, but it's hard, especially for real-time systems.
If this turns out to be your issue, then one way to handle this is to make a global pool of fixed resources and have your shred grab from that. Like classic "round robin voice stealing" in synthesizers:
SinOsc s[100]; 0 => int next2Use;
fun void mySine() { next2Use => int thisOne; 1 +=> next2Use; if (next2Use > 99) 0 => next2Use; s[thisOne] => dac; Math.random2f(100,1000) => s[thisOne].freq; second => now; s[thisOne] =< dac; }
// to test: while (1) { Math.random2f(0.01,0.1) :: second => now; spork ~ mySine(); }
I just fired up a few dozen of these running in parallel, VM showed 2600 total shreds running, no problem (and no clicks or dropouts!!).
Hope this helps, if none of this applies, then you may have discovered a strange bug. Source code please, and we can all scratch our heads on it.
Thanx!! PRC
Today's Topics:
1. 147th shred removed...segmentation fault? (Ryan Supak) _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu javascript:; https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu javascript:; https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu javascript:; https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
participants (4)
-
Michael Heuer
-
Perry R Cook
-
Ryan Supak
-
Spencer Salazar