It has been a bit of a memory management weekend. I tried out clang’s Address Sanitizer for the first time, which pretty much immediatly halted execution telling me my program is attempting to allocate terrabytes of memory. Um!
I haven’t solved that mystery yet. There are no such giant allocations after some frustrated double-checking, but I think it might be seeing a leak and peering into the future where it sees a gigantic cumulative total of unfreed allocations?
In the process I found a number of places missing checks for NULL pointers or forgetting to initialize memory before sending it off somewhere else. There’s still one instance of uninitialized memory valgrind has been shaming me with – “go fix your program!”. I haven’t been able to track it down yet.
At some point during this spring cleaning the stack smashing bug in my test program went away. I’m not sure when! It only occurred to me this morning that I didn’t remember seeing it recently. There was an instance of the program running overnight (a practical test for memory leaks, why not) so I sent it a shutdown message and hey indeed, it no longer barfs.
There’s ongoing dropouts unless I increase the jack block size to more than 1024 frames. The test program runs smoothly with a larger block size (somewhere between ~2000 and ~4000 frames, I haven’t found the edge) but there’s only 20 pulsar oscs running in it. Doesn’t seem like that’s enough computation to cause dropouts from just running out of time trying to compute a block of samples, but… there it is.