AU Demo Plugin crashing some hosts in Juce 1.50

The latest AU plugin Demo from 1.5 is crashing AUlab, logic and reaper when trying to launch the plugin after closing the UI.

To replicate, place the plugin to a channel then close the UI then try opening the UI again, it crashes. However it seems Fine in the latest version of Live.

Below is the Logic 8 crash log

Identifier: com.apple.logic.pro
Version: 8.0.0 (1437.23)
Build Info: Logic-14372300~12
Code Type: X86 (Native)
Parent Process: launchd [140]

Date/Time: 2009-08-23 21:20:08.949 +0930
OS Version: Mac OS X 10.5.6 (9G55)
Report Version: 6

Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread: 0

Thread 0 Crashed:
0 libSystem.B.dylib 0x90d4be42 __kill + 10
1 libSystem.B.dylib 0x90dbe23a raise + 26
2 libSystem.B.dylib 0x90dca622 __abort + 97
3 libSystem.B.dylib 0x90dca68a _cproc_fork_child + 0
4 com.apple.logic.pro 0x002b3462 0x1000 + 2827362
5 libSystem.B.dylib 0x90d4a2bb _sigtramp + 43
6 ??? 0xffffffff 0 + 4294967295
7 …rialsoftware.JuceDemoPlugin 0x2522c154 EditorCompHolder::EditorCompHolder(juce::AudioProcessorEditor*) + 158
8 …rialsoftware.JuceDemoPlugin 0x2522b261 -[JuceUIViewClass initWithFilter:withAU:withComponent:] + 59
9 …rialsoftware.JuceDemoPlugin 0x2522b1fb -[JucePlugin_AUExportPrefix_UICreationClass uiViewForAudioUnit:withSize:] + 163
10 com.apple.logic.pro 0x00408af9 0x1000 + 4225785
11 com.apple.logic.pro 0x00563446 0x1000 + 5645382
12 com.apple.logic.pro 0x004b80da 0x1000 + 4944090
13 com.apple.logic.pro 0x0050929f 0x1000 + 5276319
14 com.apple.logic.pro 0x0056dd7e 0x1000 + 5688702
15 com.apple.logic.pro 0x0056e1b8 0x1000 + 5689784
16 com.apple.logic.pro 0x000ffa68 0x1000 + 1043048
17 com.apple.logic.pro 0x0005752d 0x1000 + 353581
18 com.apple.logic.pro 0x003f662a 0x1000 + 4150826
19 com.apple.logic.pro 0x003f8469 0x1000 + 4158569
20 com.apple.logic.pro 0x003ec200 0x1000 + 4108800
21 com.apple.logic.pro 0x000121fa 0x1000 + 70138
22 com.apple.logic.pro 0x001a9ebb 0x1000 + 1740475
23 com.apple.logic.pro 0x004bf83f 0x1000 + 4974655
24 com.apple.AppKit 0x944f71a3 -[NSWindow sendEvent:] + 5381
25 com.apple.prokit 0x020eef17 -[NSProWindow sendEvent:] + 273
26 com.apple.logic.pro 0x005302b9 0x1000 + 5436089
27 com.apple.AppKit 0x944c3d49 -[NSApplication sendEvent:] + 2941
28 com.apple.logic.pro 0x004cced7 0x1000 + 5029591
29 com.apple.AppKit 0x9442169f -[NSApplication run] + 847
30 com.apple.prokit 0x020cc271 NSProApplicationMain + 325
31 com.apple.logic.pro 0x00003bf2 0x1000 + 11250
32 com.apple.logic.pro 0x00003b19 0x1000 + 11

I just tried the latest tip and it is still crashing when closing then opening the UI in Logic 8, latest demo of Reaper and AUlab. Have you had a chance to look at this yet Jules? as it is an easy problem to replicate and an important one.

Thanks, I’ve replicated the crash you mention - will try to debug it tomorrow. I just fixed the shut-down problem in reaper though, so that should be working fine in the tip (?)

Thanks Jules, I checked out the tip about two hours ago and using Reaper V3.102 and still crashing for me, I’ll check it out again and try, perhaps it wasn’t the latest tip, below is the Crash log from Reaper

Process: REAPER [7962]
Path: /Applications/REAPER.app/Contents/MacOS/REAPER
Identifier: com.cockos.reaper
Version: ??? (3.102)
Code Type: X86 (Native)
Parent Process: launchd [140]

Date/Time: 2009-08-24 20:00:34.231 +0930
OS Version: Mac OS X 10.5.6 (9G55)
Report Version: 6

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000c01afa07
Crashed Thread: 0

Thread 0 Crashed:
0 …rialsoftware.JuceDemoPlugin 0x1862c697 juce::Component::addAndMakeVisible(juce::Component*, int) + 41
1 …rialsoftware.JuceDemoPlugin 0x186bdfbc EditorCompHolder::EditorCompHolder(juce::AudioProcessorEditor*) + 146
2 …rialsoftware.JuceDemoPlugin 0x186bd0d5 -[JuceUIViewClass initWithFilter:withAU:withComponent:] + 59
3 …rialsoftware.JuceDemoPlugin 0x186bd06f -[JucePlugin_AUExportPrefix_UICreationClass uiViewForAudioUnit:withSize:] + 163
4 com.cockos.reaper 0x002d4feb SWELL_GetAudioUnitCocoaView(HWND__, ComponentInstanceRecord, AudioUnitCocoaViewInfo*, RECT*) + 325

Thread 1:
0 libSystem.B.dylib 0x90cde1c6 mach_msg_trap + 10
1 libSystem.B.dylib 0x90ce59bc mach_msg + 72
2 com.apple.audio.midi.CoreMIDI 0x0059af0f XServerMachPort::ReceiveMessage(int&, void*, int&) + 101
3 com.apple.audio.midi.CoreMIDI 0x0058d477 MIDIInPortThread::Run() + 111
4 com.apple.audio.midi.CoreMIDI 0x0059107d XThread::RunHelper(void*) + 17
5 com.apple.audio.midi.CoreMIDI 0x0059b9ee CAPThread::Entry(CAPThread*) + 96
6 libSystem.B.dylib 0x90d0f095 _pthread_start + 321
7 libSystem.B.dylib 0x90d0ef52 thread_start + 34

Looks like a different bug, but I’m using an older version of reaper - I’ll get the latest one and try again.

Actually, it was the VST version that I fixed in Reaper - looks like the AU had a similar issue, so I’ve sorted that out now.

The Logic crash was quite straightforward - the host seems to have been unhelpfully deleting the plugin before its UI, which I didn’t really expect to happen, but have made it more robust now.

It’s all checked-in - please try it out and see if I’ve missed anything…

ALL IS GOOD, both AU and VST working in all hosts tested, thanks! The only minor issue I can see at this stage is the info label doesn’t update in logic when playing? and the info label text is not visible on initial plugin launch in either Reaper and logic until the gain slider is moved or the play button is pressed in Reaper. Thanks again Jules.

Thanks. The demo only updates the info label when the host actually calls the process method (or when you move the slider). And Logic doesn’t seem to perform any audio callbacks unless there’s actually some audio data present, so on a blank track you won’t get much action.

Great thanks, I should have tested with an audio file dohh…

I’ve actually just checked in some more tweaks for some windowing problems I found. It’s a nightmare trying to keep all these hosts happy - you fix one of them and it breaks another one…