Obscure crash when using modal windows

I am encountering a really frustrating bug that occurs only on certain conditions:

- OSX (no problem on Windows) - I am using 10.7 with XCode 4.63 and the latest JUCE tip.

- application compiled in Release mode with link time optimizations enabled => PITA to debug

- application is executed as 64bit (if I tick the 32bit flag in the executables properties, everything works fine).

So whenever I run the app under those conditions and open a modal window (I know evil, but I want the native FileChooser) my application crashes.

This is the report:

Crashed Thread:  0  Juce Message Thread  Dispatch queue: com.apple.main-thread
Exception Codes: 0x000000000000000d, 0x0000000000000000
VM Regions Near 0:
    __TEXT                 0000000103103000-0000000103853000 [ 7488K] r-x/rwx SM=COW  /Users/USER/Documents/*/HISE Standalone.app/Contents/MacOS/HISE Standalone
Application Specific Information:
objc[584]: garbage collection is OFF
Thread 0 Crashed:: Juce Message Thread  Dispatch queue: com.apple.main-thread
0   libunwind.dylib                   0x00007fff8e755fe6 libunwind::CompactUnwinder_x86_64<libunwind::LocalAddressSpace>::stepWithCompactEncodingFrameless(unsigned int, unsigned long long, libunwind::LocalAddressSpace&, libunwind::Registers_x86_64&, bool) + 630
1   libunwind.dylib                   0x00007fff8e75420c libunwind::CompactUnwinder_x86_64<libunwind::LocalAddressSpace>::stepWithCompactEncoding(unsigned int, unsigned long long, libunwind::LocalAddressSpace&, libunwind::Registers_x86_64&) + 52
2   libunwind.dylib                   0x00007fff8e754171 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step() + 69
3   libobjc.A.dylib                   0x00007fff91d44294 objc_addExceptionHandler + 82
4   com.apple.CoreFoundation          0x00007fff93766a34 _CFDoExceptionOperation + 308
5   com.apple.AppKit                  0x00007fff92a74696 _NSAppKitLock + 73
6   com.apple.AppKit                  0x00007fff92b4d170 -[NSControl(NSControlAccessibility) accessibilityAttributeNames] + 62
7   com.apple.AppKit                  0x00007fff92b4d0ff NSAccessibilityIsSupportedAttribute + 60
8   com.apple.AppKit                  0x00007fff92b4d0a2 ValueOfAttributeWithDefault + 24
9   com.apple.AppKit                  0x00007fff92b4d06e NSAccessibilityChildrenOrEmptyArray + 19
10  com.apple.AppKit                  0x00007fff92b4d04d NSAccessibilityUnignoredChildrenForOnlyChild + 110
11  com.apple.AppKit                  0x00007fff92b4cf2e NSAccessibilityUnignoredDescendant + 41
12  com.apple.AppKit                  0x00007fff92cc279e -[NSNibAXRelationshipConnector establishConnection] + 124
13  com.apple.AppKit                  0x00007fff92a8b2a1 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1079
14  com.apple.AppKit                  0x00007fff92baae6b -[NSNib instantiateNibWithExternalNameTable:] + 606
15  com.apple.AppKit                  0x00007fff92baabd8 -[NSNib instantiateNibWithOwner:topLevelObjects:] + 251
16  com.apple.AppKit                  0x00007fff92fb80de -[NSSavePanel(NSSavePanelLayout) _initContentView] + 126
17  com.apple.AppKit                  0x00007fff92fb4f49 -[NSSavePanel initWithContentRect:styleMask:backing:defer:] + 320
18  com.apple.AppKit                  0x00007fff92faef43 +[NSSavePanel _crunchyRawUnbonedPanel] + 207
19  com.apple.AppKit                  0x00007fff92f53815 +[NSOpenPanel openPanel] + 18
20  com.yourcompany.HISEStandalone    0x00000001033a6a21 juce::FileChooser::showDialog(int, juce::FilePreviewComponent*) + 12209

It looks like there is something really weird going on. However, the JUCE demo app does work, which makes me totally angry, since I am doing nothing else than opening the file chooser.

Has anybody a clue what this could be?

Looks to me like something's screwed up in your program's linkage - maybe linking mis-matched headers/cpps or some other weird mix-up.

Weird, I was using a slightly older version of Introjucer (a few weeks old) and updating this solved it (the modules were from the tip as you adviced for any bug report, but I am a little bit lazy recompiling the Introjucer everytime i update the modules).

Still don't know what caused this (and why the Demo worked with the old Introjucer), but anyway, thanks for the hint - and from now on I will take the popup window more seriously that pop ups every time I loaded the Introjucer :)