Hi,
AU plugins built with JUCE or otherwise based on the CoreAudio SDK crash auval on OS X 10.6.8 (bus error / segmentation fault), if they are built using OS X SDK 10.9 or above.
Just run auval -v PLUGINID -r 100 (100 repeats) and it will crash.
This is due to how auval reads the kAudioUnitProperty_HostCallbacks property. This property changed in OS X SDK 10.9 to add the HostCallback_GetTransportState2 callback (https://developer.apple.com/library/mac/releasenotes/General/APIDiffsMacOSX10_9/AudioUnit.html), so the property size (in 32-bits) grew from 16 bytes to 20 bytes.
auval gets the property info telling it that the buffer is 20 bytes, and then gets the property into a 16 bytes buffer, but tells the AU that the buffer is large enough, so the AU overwrites the buffer given to it.
A patch to the CoreAudio SDK to work around this auval bug:
typedef struct {
void * hostUserData;
HostCallback_GetBeatAndTempo beatAndTempoProc;
HostCallback_GetMusicalTimeLocation musicalTimeLocationProc;
HostCallback_GetTransportState transportStateProc;
} OldHostCallbackInfo;
at AUBase::DispatchGetPropertyInfo:
case kAudioUnitProperty_HostCallbacks:
ca_require(inScope == kAudioUnitScope_Global, InvalidScope);
- outDataSize = sizeof(mHostCallbackInfo);
+ outDataSize = sizeof(OldHostCallbackInfo);
outWritable = true;
break;
at AUBase::DispatchGetProperty:
case kAudioUnitProperty_HostCallbacks:
- memcpy(outData, &mHostCallbackInfo, sizeof(mHostCallbackInfo));
+ memcpy(outData, &mHostCallbackInfo, sizeof(OldHostCallbackInfo));
break;
I also verified on other parties' plugins and saw that other plugins from several different devs also crash on 10.6.8's auval. Picked ones from new devs or that I guessed that they use new Xcode. Tokyo Dawn Labs TDR Kotelnikov, tunefish4, A1Audio A1StereoControl - all crash too.
and a relevant request:
Now that there's no canonical location to put the CoreAudio SDK (as was with really old Xcodes), it would be nice if the location of the SDK was a parameter to Introjucer like the other SDKs. Then I could be sure that there's no confusion and I'm using the fixed CoreAudio SDK from my source dirs..
Cheers, Yair
