JUCE AU crashes in Logic when compiled as ARM, while Intel works

Hi there; we’re currently trying to get our new (JUCE based) product ready for Apple Silicon and what I noticed, is this:

if I compile the product as ARM (I made sure during these tests I got the right architecture), it’ll crash in Logic pretty soon (sort of non-deterministic, but happens reliably after a short while). If I compile it as Intel on the other hand, everything works fine. I’ll paste the relevant crash log snippet below.

I filed a bug report in Apples feedback assistant and they got back to me with this answer: “Looks like a use-after-free in JUCE.”

Any help is greatly appreciated!

Here’s the crash log excerpt in question:

Thread 18 Crashed:: AUOOPRenderingServer-82817200
0 libsystem_kernel.dylib 0x00000001a42bccec __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001a42edc24 pthread_kill + 292
2 libsystem_c.dylib 0x00000001a4235864 abort + 104
3 libsystem_malloc.dylib 0x00000001a4120d08 malloc_vreport + 560
4 libsystem_malloc.dylib 0x00000001a4136a78 malloc_zone_error + 104
5 libsystem_malloc.dylib 0x00000001a4136814 free_list_checksum_botch + 40
6 libsystem_malloc.dylib 0x00000001a411805c tiny_free_no_lock + 2276
7 libsystem_malloc.dylib 0x00000001a41175f8 free_tiny + 428
8 com.eastwest.Opus 0x00000001076e21f8 juce::HeapBlock<MIDIPacketList, false>::~HeapBlock() + 8 (juce_HeapBlock.h:136) [inlined]

I’m afraid that stack trace isn’t particularly helpful. Can you reproduce the crash in the debugger and see what the other threads are doing?

We’re seeing other problems with MIDI in ARM Logic: Midi FX issue - Logic Pro and Mac M1

Which version of JUCE are you using? I fixed a bug to do with MIDI packet alignment on ARM which was producing similar-looking crashes a few weeks ago. If you’re not using the current develop branch, I’d recommend updating and checking whether you can still reproduce the issue.

Thanks a lot - that actually seems to fix it. I tried the current devleopment branch and the crashes are totally gone. Great stuff, thank you!

1 Like