JUCE crashes in Message Thread

My application crashes when I try to load a file. it only happens in Release build which makes it hard for me to navigate where the issue is. I have attached a screenshot of the error message. does anybody have experience with this and have any suggestions how I can debug this issue? thanks in advance!

Common debug vs release issues involve uninitialized variables. The other issue can be a memory overwrite. In debug builds, memory allocations have fences on either side to help diagnose memory access issues, but sometimes this also hides bad behavior if the bad access is not caught. So in release build, since those fences aren’t there, the overwrite will overwrite other actual data. It may be something else, but these are the first two to consider.

1 Like

Try enabling Address Sanitizer in Xcode and re-running the program. This should print some details of the failure when the crash occurs.

1 Like

By combining both @cpr2323 & @reuk 's advices I am able to find out where the issue is. Indeed it’s about the system trying to access an no longer existing memory in a thread. Strangely the code was written ages ago but was only crashing recently. Thank you both!

1 Like