JuceDemoPlugin crashes under Tiger Mac OSX

Excellent detective work finding that interpolation problem! That’s an easy fix because there’s no reason why it’d need to be set to high quality for the gradients anyway - I’ll just set it to default mode.

I’ll try to do some more AU testing today and see if I can reproduce your crash.

Hmm. Not sure how to debug the crash now… I don’t have 10.4, and it’s all fine on later OSes. As you say, the crash log is pretty useless.

Have you tried with yesterday’s tip? My changes to the way the mac messaging works could have some relevance to this.

I have the same class_respondsToMethod crash on 10.4 with Logic 8.

I can perform tests if needed, will follow this topic for further details on the subject

A possible workaround might be to simply turn off the cocoa UI when running in 10.4…

If it’s a crash when it’s trying to load the obj-c UI class object, then a quick test would be to comment-out the kAudioUnitProperty_CocoaUI options in GetPropertyInfo and GetProperty. (Of course, it might be nothing to do with that - it’s impossible to tell from the stack trace)

Will try the CocoaUI thing in minutes.

Anyway, if it can be helpful, I found that the same error happens even if you compile the plugin in 10.5 and then load it in 10.4.

In addition, I’ve found that Live 6 and Live 7 load both AU and the VST without problems, while Logic 8 fails in loading the same AU.

Good to know I have only Live 8 on Tiger. It can proof that actually Cocoa UI is the problem for Tiger because as far as I remember Live supports Cocoa from 8.x

I’ve made the comments suggested by Jules and now it doesn’t crash :slight_smile: I’ll test it more to check all the functionality.

I noticed also that if we want to run it on 10.4 we have to build the component with 10.5 SDK and compatibility set to 10.4. When I compiled it with 10.6 it still crashes on 10.4. The crash log is very similar as before.

Anyway we are on very good way! YES :smiley:

Confirmed. With the parts commented out as suggested by jules, loading the AU in Logic under 10.4 does not crash here too.

Good. Well I’ve no qualms about nuking cocoa support on 10.4. I’d suggest these changes:

            else if (inID == kAudioUnitProperty_CocoaUI)
            {
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
                if (CFStringCreateWithBytesNoCopy != 0) // (Just a way of finding out if we're running in 10.5 or later)
#endif
                {
                    outDataSize = sizeof (AudioUnitCocoaViewInfo);
                    outWritable = true;
                    return noErr;
                }
            }

and

[code] else if (inID == kAudioUnitProperty_CocoaUI)
{
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
if (CFStringCreateWithBytesNoCopy != 0) // (Just a way of finding out if we’re running in 10.5 or later)
#endif
{
const ScopedAutoReleasePool pool;

                AudioUnitCocoaViewInfo* info = (AudioUnitCocoaViewInfo*) outData;

                const File bundleFile (File::getSpecialLocation (File::currentApplicationFile));
                NSString* bundlePath = [NSString stringWithUTF8String: (const char*) bundleFile.getFullPathName().toUTF8()];
                NSBundle* b = [NSBundle bundleWithPath: bundlePath];

                info->mCocoaAUViewClass[0] = (CFStringRef) [[[JuceUICreationClass class] className] retain];
                info->mCocoaAUViewBundleLocation = (CFURLRef) [[NSURL fileURLWithPath: [b bundlePath]] retain];

                return noErr;
            }
        }[/code]

BTW, are you both running on PPC machines? It might just be that we’d need to disable it on PPC and not intel…

Mine is an intel, I haven’t tried on PPC

I’ve tested it on Intel too… We’ll dig PPC from the dust and check it too.

I’ve tested the patch but it does not seem to work, I obtain the same crash.
Will do some more investigations.

Probably my dodgy method for testing whether it’s 10.4… I can’t seem to find an “official” way of finding out the OS version.

I searched a bit and found this one:

http://www.cocoadev.com/index.pl?DeterminingOSVersion

I think it’s worth reading.

Thanks! I guess Getstalt is the way to go then:

[code]#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
SInt32 versionMinor = 5;
Gestalt (gestaltSystemVersionMinor, &versionMinor);

            if (versionMinor >= 5)

#endif
[/code]

Maybe it would be nice to have those functions available as part of the SystemStats class, for a more complete control over MacOS X version returned by getOperatingSystemType

Yep. If it works on your 10.4 machine I’ll probably do just that.

I’m actually busy with some other jobs but I’ll check it too on 10.4.11 (Intel & PPC) when I finish…

the gestalt patch does work: no crash on 10.4 and correct behaviour (tested with the debugger) in 10.5. I vote for committing this change to the tip