I’m currently having a hard time tracking down a bug that suddenly appears in the audio callback of a standalone application, after some code changes elsewhere. I suspect it to be some kind of race condition, deletion of an object while still being used by some other thread… something like that. However what makes it nearly impossible to track down is the following fact:
I get two assertion failure prints from within
AudioBuffer::copyFrom. However, the debugger does not stop there, instead I receive a SIGTRAP at that timepoint but the debugger points to some completely unrelated parts of the JUCE codebase (some low level GUI parts that blend some pixels). There are neither assertions in this part of the code, nor are there breakpoints. Furthermore, it does not always stop at the exact same line, sometimes it stops a few lines above or in the outer function that calls this function, so to me it seems that this is some part of the GUI rendering, happening on the MessageThread that is just always happening at the timepoint the real error happens on another thread by coincidence. Could that be possible that the SIGTRAP is received for a wrong thread? Did anyone encounter such a weird GDB behavior before and has some advice on how to fix this?