chuck
chuck copied to clipboard
ChucK program crashes after 8155 Machine.add() calls
While doing tests with ChucK I found that there seems to be a limit on how often Machine.add() can be called:
[chuck](VM): sporking incoming shred: 8151 (loop.ck)...
[chuck](VM): sporking incoming shred: 8152 (loop.ck)...
[chuck](VM): sporking incoming shred: 8153 (loop.ck)...
[chuck](VM): sporking incoming shred: 8154 (loop.ck)...
[chuck](VM): sporking incoming shred: 8155 (loop.ck)...
[chuck](VM): sporking incoming shred: 8156 (loop.ck)...
[loop.ck]: no such file or directory
[chuck](VM): NullPointerException: on line[30] in shred[id=1:main.ck]
Consistently, around 8155 times of adding a shred, ChucK will suddenly report "no such file or directory and my program will crash and output "no such file or directory".
loop.ck simply plays a sample for 10::ms and then exits. main.ck calls Machine.add("loop.ck") every 20::ms.
No matter how excited I am about ChucK, like, really excited, the above issue makes ChucK unusable for my application. Any help (or workarounds) would be greatly appreciated!
Also, when monitoring the chuck process with top
, I can see that the memory usage keeps on growing. I did see the issue report of #49 but in my case the shreds remove themselves. Does this point to a memory leak?
Hmm, I may have missed this, but on which operating system/version is this happening? memory could be one issue, another may be related to file handles if they are not closed properly (internally on ChucK) on certain platforms. If you would, can you create a minimal reproducible example code that exhibits this behavior? Thanks!
similar to what @benrogmans reported: https://lists.cs.princeton.edu/pipermail/chuck-users/2020-April/008790.html
While creating a simplified version, I found that it is actually around 1007 times (before I was using 8 different samples).
Ubuntu 20.10:
$ chuck --version
chuck version: 1.4.0.1 (numchucks)
linux (jack) : 64-bit
main.ck:
while(true) {
Machine.add(me.dir() + "loop.ck");
50::ms => now;
}
loop.ck:
SndBuf2 buffer => dac;
me.dir () + "soundfile.wav" => buffer.read;
10::ms => now;
tried on Ubuntu 20.04 LTS using ChucK 1.4.0.1 (with Jack as well) and I'm not getting this issue. of course I'm using a different sample though ;)