JuceDemoPlugin crashes under Tiger Mac OSX

Hmmm … maybe try to download the latest XCode 3.2.1 … I tried one thing today. I thought that maybe my SDKs are corrupted so I removed the SDKs folder and reinstalled the XCode 3.2.1 which restored this directory with the MacOSX10.4u.sdk content too. The only thing to remember is probably to mark the checkbox with 10.4 support during installation.

Sorry to be that one who write about things that makes you feel bad :slight_smile: I would like personally to forget about OSX 10.4.x support (and earlier too). Unfortunately I know that some of our customers still use it and I guess that many other Mac users too.

Ok, I’ve checked in some code that seems to work, though would be interested to hear if it runs on a real 10.4 machine.

I’ve checked these changes and it seems to be better but it’s not perfect yet.

the problems can be still at:

  • juce_mac_Fonts.mm (l.335) - CGFontCopyTableForTag() method is available only on 10.5 and later. I know there is comparison to 0 one line below so if such method doesn’t exists it shouldn’t crash here but maybe we should have some bypass also here…

in file juce_mac_CoreGraphicsContext.mm

  • (l.425) - the structure gradientCallback uses CGFloat type which is available on 10.6 and later

  • (l.169) - the enumeration kCGBlendModeCopy (10.5 or later)

If you check in some new code I’ll test it and give some feedback. Thanks for your help Jules!

Cheers

The CGFontCopyTableForTag call should be safe because createGlyphsForString() does the check for 10.5 compatibility before calling it. Can’t see any way that’d fail.

Thanks for the other points, they’re easy to fix - I’ll check something in shortly!

It’s annoying - I tried to re-install the 10.4 SDK but it just won’t work. I think this must be because I installed XCode from the iphone dev package.

Maybe try to download XCode 3.2.1 (~750MB) from Mac Dev Center. I think it’ll add during installation all the 10.5 and 10.4 SDKs if they’re missed.

Hi, I’ve checked last tip and this is how the demo works now on Mac OSX 10.4.11

The issues we discussed about are solved I guess but there is still some problem with CoreGraphicsContext class. Here is the crash log.

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0x023fbad0

Thread 0 Crashed:
0   com.apple.CoreGraphics         	0x9fc666d9 getNextAxialShadingScanline + 913
1   com.apple.CoreGraphics         	0x9fc66c02 getBytesAxialShadingDataProvider + 84
2   com.apple.CoreGraphics         	0x9fb593c9 CGAccessSessionGetChunks + 474
3   com.apple.CoreGraphics         	0x9fb58e91 img_raw_read + 176
4   com.apple.CoreGraphics         	0x9fb70196 img_alphamerge_read + 86
5   com.apple.CoreGraphics         	0x9fb2eb44 img_data_lock + 2187
6   com.apple.CoreGraphics         	0x9fb2d40d CGSImageDataLockWithReference + 94
7   libRIP.A.dylib                 	0x942fd1dc ripc_AcquireImage + 662
8   libRIP.A.dylib                 	0x942faf42 ripc_DrawImage + 1833
9   com.apple.CoreGraphics         	0x9fb2bac1 CGContextDrawImage + 403
10  com.apple.CoreGraphics         	0x9fc65d83 drawAxialShading + 4869
11  com.apple.CoreGraphics         	0x9fc649fa CGContextDrawShading + 134
12  ...awmaterialsoftware.jucedemo 	0x00231cd9 juce::CoreGraphicsContext::drawGradient() const + 93
13  ...awmaterialsoftware.jucedemo 	0x0023312b juce::CoreGraphicsContext::fillPath(juce::Path const&, juce::AffineTransform const&) + 221
14  ...awmaterialsoftware.jucedemo 	0x00044c3e juce::Graphics::fillPath(juce::Path const&, juce::AffineTransform const&) const + 136
15  ...awmaterialsoftware.jucedemo 	0x0010355f juce::Graphics::fillEllipse(float, float, float, float) const + 291
16  ...awmaterialsoftware.jucedemo 	0x001a9afb juce::LookAndFeel::drawGlassSphere(juce::Graphics&, float, float, float, juce::Colour const&, float) + 815
17  ...awmaterialsoftware.jucedemo 	0x00266fb9 juce::GlassWindowButton::paintButton(juce::Graphics&, bool, bool) + 963
18  ...awmaterialsoftware.jucedemo 	0x00038d93 juce::Button::paint(juce::Graphics&) + 155
19  ...awmaterialsoftware.jucedemo 	0x00198546 juce::Component::paintEntireComponent(juce::Graphics&) + 866
20  ...awmaterialsoftware.jucedemo 	0x00198713 juce::Component::paintEntireComponent(juce::Graphics&) + 1327
21  ...awmaterialsoftware.jucedemo 	0x001988eb juce::ComponentPeer::handlePaint(juce::LowLevelGraphicsContext&) + 59
22  ...awmaterialsoftware.jucedemo 	0x001b1e9c juce::NSViewComponentPeer::drawRect(_NSRect) + 336
23  ...awmaterialsoftware.jucedemo 	0x00143ac4 -[JuceNSView_1_50_3 drawRect:] + 76
24  com.apple.AppKit               	0x932fde91 -[NSView _drawRect:clip:] + 3228
25  com.apple.AppKit               	0x932fceeb -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 614
26  com.apple.AppKit               	0x932fbf53 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 217
27  com.apple.AppKit               	0x932fcb21 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 3239
28  com.apple.AppKit               	0x933db2e5 -[NSNextStepFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 601
29  com.apple.AppKit               	0x932fae42 -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 523
30  com.apple.AppKit               	0x932fa76e -[NSView displayIfNeeded] + 439
31  com.apple.AppKit               	0x932fa512 -[NSWindow displayIfNeeded] + 168
32  com.apple.AppKit               	0x9334a798 _handleWindowNeedsDisplay + 206
33  com.apple.CoreFoundation       	0x9082dce2 __CFRunLoopDoObservers + 342
34  com.apple.CoreFoundation       	0x9082cd84 CFRunLoopRunSpecific + 827
35  com.apple.CoreFoundation       	0x9082ca42 CFRunLoopRunInMode + 61
36  com.apple.HIToolbox            	0x92df9878 RunCurrentEventLoopInMode + 285
37  com.apple.HIToolbox            	0x92df8eb9 ReceiveNextEventCommon + 184
38  com.apple.HIToolbox            	0x92df8dd9 BlockUntilNextEventMatchingListInMode + 81
39  com.apple.AppKit               	0x9327ef45 _DPSNextEvent + 572
40  com.apple.AppKit               	0x9327eb37 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 137
41  com.apple.AppKit               	0x932788c4 -[NSApplication run] + 512
42  ...awmaterialsoftware.jucedemo 	0x000f0651 juce::MessageManager::runDispatchLoop() + 161
43  ...awmaterialsoftware.jucedemo 	0x001c7016 juce::JUCEApplication::main(juce::String&, juce::JUCEApplication*) + 70
44  ...awmaterialsoftware.jucedemo 	0x001c71ff juce::JUCEApplication::main(int, char**, juce::JUCEApplication*) + 179
45  ...awmaterialsoftware.jucedemo 	0x00021cef main + 97
46  ...awmaterialsoftware.jucedemo 	0x00006d69 _start + 208
47  ...awmaterialsoftware.jucedemo 	0x00006c98 start + 40 

I got myself a 10.4 SDK and tidied it all up.

I haven’t seen that crash - what were you doing when it happened?

hmmm … nothing to be honest, I’ve cleaned up all juce dir, got new copy from tip, build up (on XCode 3.2.1 on 10.6.2) new juce demo without changing any settings and copy the file to 10.4.11 OSX.

Then just run the demo, the gui shows up for a while but before anything gets even repainted the crash occurs.

I forgot to add that I also tried to built demo with the Base SDK set to 10.4 - no compile errors in fact. The only problem is crash when running on 10.4.11

I can’t reproduce it, and it looks like it’s crashing deep inside Apple code… I wonder if it’s a bug in the 10.4 graphics kernel?

yes… it seems similar to me…

Have you tried building with the 10.5 SDK and setting compatibility to 10.4? You never know - they might have something in the SDK to work around bugs in older versions.

will try in in seconds…

so I have the same results, no matter if I build it against 10.4, 10.5 or 10.6 SDK. When running on real 10.4.11 it crashes.

Maybe you want me to try your build. There is always some possibility that something wrong is with my 10.4.11 or with the machine I build on. If so please put somewhere your build and I’ll test it.

I know that resigning from 10.4.x would not be good for Juce compatibility so maybe there is someone who could also check it on some Tiger machine.

That’s annoying… I’ve not got a 10.4 installation to test with myself, but there might be a workaround possible if we knew exactly what was making it crash.

If you want me to check something, I’ll help with pleasure. I have no idea atm what else I could check. It crashes before really startup…

Well it’s clearly trying to draw a gradient, but I can’t see anything remotely dangerous in the gradient code, which works flawlessly on 10.5 and above. You could step through the drawGradient() method in CoreGraphicsContext and see what happens? See if it calls back into the gradientCallback method, etc…

ok, will check it in the evening and let you know…

I found that the cause of these problems is in using of CGShadingCreateAxial() method in conjunction with CGContextSetInterpolationQuality() set to kCGInterpolationHigh.

When interpolation is set to kCGInterpolationLow or kCGInterpolationDefault everything is OK, also when radial shading is used it’s not sensitive to interpolation settings. But when we use axial shading and high interpolation it leads to crash. I’ve confirmed it with juce code and with some simple shading example code from web.

It’s described also at apple - http://lists.apple.com/archives/Quartz-dev/2007/Sep/msg00011.html - the crash log looks very similar :slight_smile: I suppose they’ve fixed it since 10.5 so we need probably some workaround under 10.4.

I think that adding some 10.4 case in CoreGraphicsContext::setInterpolationQuality() will do the thing and solve the problems of low interpolated tiger :wink:

… but after first happiness I remembered that the main reason to start this topic was that JuceDemoPlugin (AU version) crashes all the AU hosts. So after quick fix for the axial shading issue I tried to recompile the JuceDemoPlugin and unfortunately it’s still not working.

I have no idea this time what is the reason :frowning: The crash log doesn’t tell me nothing - maybe someone else have some clues - otherwise AU plugins based on juce plugin framework won’t run on 10.4.x

JuceDemoPlugin passes auval test on 10.4.11 in fact but when we try to load it to any host (I tried Logic 9, Live 8.0.4, GarageBand, AULab) it crash the host. I attach the actual crash logs from Logic and AULab for example…

Version:        8.0.2 (1502.22)
Build Version:  9
Project Name:   Logic
Source Version: 15022200

PID:    901
Thread: 0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0x534e6563

Thread 0 Crashed:
0   libobjc.A.dylib                	0x90a5b0d0 class_respondsToMethod + 120
1   com.apple.Foundation           	0x9280e3e4 -[NSBundle load] + 766
2   com.apple.Foundation           	0x92872e12 -[NSBundle classNamed:] + 41
3   com.apple.logic.pro            	0x00410193 0x1000 + 4256147
4   com.apple.logic.pro            	0x0010eef2 0x1000 + 1105650
5   com.apple.logic.pro            	0x000c075b 0x1000 + 784219
6   com.apple.logic.pro            	0x000251f3 0x1000 + 147955
7   com.apple.logic.pro            	0x0002538a 0x1000 + 148362
8   com.apple.logic.pro            	0x00029547 0x1000 + 165191
9   com.apple.logic.pro            	0x000299f7 0x1000 + 166391
10  com.apple.logic.pro            	0x0005a012 0x1000 + 364562
11  com.apple.logic.pro            	0x0005b734 0x1000 + 370484
12  com.apple.logic.pro            	0x003f6eb6 0x1000 + 4153014
13  com.apple.logic.pro            	0x003fbef0 0x1000 + 4173552
14  com.apple.logic.pro            	0x0007df31 0x1000 + 511793
15  com.apple.logic.pro            	0x000a2699 0x1000 + 661145
16  com.apple.logic.pro            	0x000a40c6 0x1000 + 667846
17  com.apple.logic.pro            	0x000804f5 0x1000 + 521461
18  com.apple.logic.pro            	0x0005b622 0x1000 + 370210
19  com.apple.logic.pro            	0x003fbcef 0x1000 + 4173039
20  com.apple.logic.pro            	0x003fde6b 0x1000 + 4181611
21  com.apple.logic.pro            	0x003f1e28 0x1000 + 4132392
22  com.apple.logic.pro            	0x0001220f 0x1000 + 70159
23  com.apple.logic.pro            	0x0019d797 0x1000 + 1689495
24  com.apple.logic.pro            	0x004d18a1 0x1000 + 5048481
25  com.apple.AppKit               	0x9335bdf3 -[NSWindow sendEvent:] + 5279
26  com.apple.prokit               	0x95311e74 -[NSProWindow sendEvent:] + 268
27  com.apple.logic.pro            	0x005c341b 0x1000 + 6038555
28  com.apple.AppKit               	0x9334dd8c -[NSApplication sendEvent:] + 5023
29  com.apple.logic.pro            	0x004df8a6 0x1000 + 5105830
30  com.apple.logic.pro            	0x004d968e 0x1000 + 5080718
31  com.apple.logic.pro            	0x004df87e 0x1000 + 5105790
32  com.apple.AppKit               	0x932788e7 -[NSApplication run] + 547
33  com.apple.prokit               	0x952ef1b3 NSProApplicationMain + 324
34  com.apple.logic.pro            	0x00003942 0x1000 + 10562
35  com.apple.logic.pro            	0x00003869 0x1000 + 10345

Thread 1:
0   libSystem.B.dylib              	0x90009817 mach_msg_trap + 7
1   com.apple.CoreFoundation       	0x9082d227 CFRunLoopRunSpecific + 2014
2   com.apple.CoreFoundation       	0x9082ca42 CFRunLoopRunInMode + 61
3   com.apple.audio.CoreAudio      	0x91469356 HALRunLoop::OwnThread(void*) + 158
4   com.apple.audio.CoreAudio      	0x91469171 CAPThread::Entry(CAPThread*) + 93
5   libSystem.B.dylib              	0x90023d67 _pthread_body + 84

Thread 2:
0   libSystem.B.dylib              	0x90024407 semaphore_wait_signal_trap + 7
1   com.apple.logic.pro            	0x00660d34 0x1000 + 6683956
2   com.apple.logic.pro            	0x00660dfb 0x1000 + 6684155
3   libSystem.B.dylib              	0x90023d67 _pthread_body + 84

Thread 3:
0   libSystem.B.dylib              	0x90024407 semaphore_wait_signal_trap + 7
1   com.apple.logic.pro            	0x00660d34 0x1000 + 6683956
2   com.apple.logic.pro            	0x00660dfb 0x1000 + 6684155
3   libSystem.B.dylib              	0x90023d67 _pthread_body + 84

Thread 4:
0   libSystem.B.dylib              	0x90047927 semaphore_timedwait_signal_trap + 7
1   com.apple.audio.CoreAudio      	0x914765a4 CAGuard::WaitFor(unsigned long long) + 212
2   com.apple.audio.CoreAudio      	0x914764c6 CAGuard::WaitUntil(unsigned long long) + 66
3   com.apple.audio.CoreAudio      	0x91474e42 HP_IOThread::WorkLoop() + 690
4   com.apple.audio.CoreAudio      	0x91474b8b HP_IOThread::ThreadEntry(HP_IOThread*) + 17
5   com.apple.audio.CoreAudio      	0x91469171 CAPThread::Entry(CAPThread*) + 93
6   libSystem.B.dylib              	0x90023d67 _pthread_body + 84

Thread 5:
0   libSystem.B.dylib              	0x90047927 semaphore_timedwait_signal_trap + 7
1   com.apple.audio.CoreAudio      	0x914765a4 CAGuard::WaitFor(unsigned long long) + 212
2   com.apple.audio.CoreAudio      	0x914764c6 CAGuard::WaitUntil(unsigned long long) + 66
3   com.apple.audio.CoreAudio      	0x91474e42 HP_IOThread::WorkLoop() + 690
4   com.apple.audio.CoreAudio      	0x91474b8b HP_IOThread::ThreadEntry(HP_IOThread*) + 17
5   com.apple.audio.CoreAudio      	0x91469171 CAPThread::Entry(CAPThread*) + 93
6   libSystem.B.dylib              	0x90023d67 _pthread_body + 84

Thread 6:
0   libSystem.B.dylib              	0x900376a7 mach_wait_until + 7
1   ...ple.CoreServices.CarbonCore 	0x90ce63c5 Delay + 118
2   ...opellerheads.rewire.library 	0x21dff7e8 RWPUnregisterDeviceImp + 21574
3   ...opellerheads.rewire.library 	0x21e1aa5c RWPUnregisterDeviceImp + 132794
4   libSystem.B.dylib              	0x90023d67 _pthread_body + 84

Thread 7:
0   libSystem.B.dylib              	0x9002447f semaphore_wait_trap + 7
1   com.ableton.live-engine        	0x21f329b2 ORoute::SOnBeginCreate(OThreadMessage&) + 1832
2   com.ableton.live-engine        	0x21ef584d TThread::Start() + 293
3   libSystem.B.dylib              	0x90023d67 _pthread_body + 84

Thread 8:
0   libSystem.B.dylib              	0x90047927 semaphore_timedwait_signal_trap + 7
1   ...ple.CoreServices.CarbonCore 	0x90ce1e60 TSWaitOnSemaphoreCommon + 163
2   ...ple.CoreServices.CarbonCore 	0x90ce8e40 TimerThread + 87
3   libSystem.B.dylib              	0x90023d67 _pthread_body + 84

Thread 9:
0   libSystem.B.dylib              	0x90024407 semaphore_wait_signal_trap + 7
1   com.apple.logic.pro            	0x00107f06 0x1000 + 1076998
2   libSystem.B.dylib              	0x90023d67 _pthread_body + 84

Thread 10:
0   libSystem.B.dylib              	0x90024407 semaphore_wait_signal_trap + 7
1   com.apple.logic.pro            	0x00107e2e 0x1000 + 1076782
2   libSystem.B.dylib              	0x90023d67 _pthread_body + 84

Thread 11:
0   libSystem.B.dylib              	0x90024407 semaphore_wait_signal_trap + 7
1   com.apple.logic.pro            	0x00108066 0x1000 + 1077350
2   libSystem.B.dylib              	0x90023d67 _pthread_body + 84

Thread 12:
0   libSystem.B.dylib              	0x90009817 mach_msg_trap + 7
1   com.apple.audio.midi.CoreMIDI  	0x95bfbadf XServerMachPort::ReceiveMessage(int&, void*, int&) + 101
2   com.apple.audio.midi.CoreMIDI  	0x95bf403b MIDIInPortThread::Run() + 113
3   com.apple.audio.midi.CoreMIDI  	0x95bf4d1b XThread::RunHelper(void*) + 17
4   com.apple.audio.midi.CoreMIDI  	0x95bfc617 CAPThread::Entry(CAPThread*) + 93
5   libSystem.B.dylib              	0x90023d67 _pthread_body + 84

Thread 13:
0   libSystem.B.dylib              	0x90024407 semaphore_wait_signal_trap + 7
1   com.apple.Foundation           	0x9284fc60 -[NSConditionLock lockWhenCondition:] + 39
2   com.apple.AppKit               	0x93355cb4 -[NSUIHeartBeat _heartBeatThread:] + 377
3   com.apple.Foundation           	0x927f9cfc forkThreadForFunction + 123
4   libSystem.B.dylib              	0x90023d67 _pthread_body + 84 
Command: AU Lab
Path:    /Developer/Applications/Audio/AU Lab.app/Contents/MacOS/AU Lab
Parent:  WindowServer [56]

Version:        1.0.3 (1.0.3)
Build Version:  106
Project Name:   PlayPen
Source Version: 250500

PID:    962
Thread: 0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0x534e6563

Thread 0 Crashed:
0   libobjc.A.dylib           	0x90a5b0d0 class_respondsToMethod + 120
1   com.apple.Foundation      	0x9280e3e4 -[NSBundle load] + 766
2   com.apple.Foundation      	0x92872e12 -[NSBundle classNamed:] + 41
3   com.apple.audio.aulab     	0x000a69fd 0x1000 + 678397
4   com.apple.audio.aulab     	0x0008dd54 0x1000 + 576852
5   com.apple.audio.aulab     	0x0008dc47 0x1000 + 576583
6   com.apple.audio.aulab     	0x000d31b6 0x1000 + 860598
7   com.apple.audio.aulab     	0x0007317e 0x1000 + 467326
8   com.apple.Foundation      	0x92812d91 __NSFireMainThreadPerform + 352
9   com.apple.CoreFoundation  	0x90860375 __CFRunLoopPerformPerform + 82
10  com.apple.CoreFoundation  	0x9082cf06 CFRunLoopRunSpecific + 1213
11  com.apple.CoreFoundation  	0x9082ca42 CFRunLoopRunInMode + 61
12  com.apple.HIToolbox       	0x92df9878 RunCurrentEventLoopInMode + 285
13  com.apple.HIToolbox       	0x92df8eb9 ReceiveNextEventCommon + 184
14  com.apple.HIToolbox       	0x92df8dd9 BlockUntilNextEventMatchingListInMode + 81
15  com.apple.AppKit          	0x9327ef45 _DPSNextEvent + 572
16  com.apple.AppKit          	0x9327eb37 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 137
17  com.apple.AppKit          	0x932788c4 -[NSApplication run] + 512
18  com.apple.AppKit          	0x9326c820 NSApplicationMain + 573
19  com.apple.audio.aulab     	0x0000251a 0x1000 + 5402
20  com.apple.audio.aulab     	0x00002441 0x1000 + 5185

Thread 1:
0   libSystem.B.dylib         	0x90024407 semaphore_wait_signal_trap + 7
1   com.apple.Foundation      	0x9284fc60 -[NSConditionLock lockWhenCondition:] + 39
2   com.apple.AppKit          	0x93355cb4 -[NSUIHeartBeat _heartBeatThread:] + 377
3   com.apple.Foundation      	0x927f9cfc forkThreadForFunction + 123
4   libSystem.B.dylib         	0x90023d67 _pthread_body + 84

Thread 2:
0   libSystem.B.dylib         	0x90009817 mach_msg_trap + 7
1   com.apple.CoreFoundation  	0x9082d227 CFRunLoopRunSpecific + 2014
2   com.apple.CoreFoundation  	0x9082ca42 CFRunLoopRunInMode + 61
3   com.apple.audio.CoreAudio 	0x91469356 HALRunLoop::OwnThread(void*) + 158
4   com.apple.audio.CoreAudio 	0x91469171 CAPThread::Entry(CAPThread*) + 93
5   libSystem.B.dylib         	0x90023d67 _pthread_body + 84