Hi,
A customer has a (non-reproducable) crash of our Cocoa-App which
instantiates a JavaVM when starting up. The app crashes in the main
thread
while processing the OpenApp AppleEvent while in another thread the
JavaVM
is just being instantiated. For me it looks like the AWTStarter is not
thread-safe in the method [AWTStarter appKitIsRunning:] when the
method
[AWTStarter start:swtMode:swtModeForWebStart:] is being executed.
Here is the crashlog (reduced):
OS Version: Mac OS X 10.5.7 (9J61)
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread: 0
Thread 0 Crashed:
0 JavaNativeFoundation 0x17a7d836 JNFLookupClass + 23
1 JavaNativeFoundation 0x17a7d8ea JNFLookupMemberID +
49
2 JavaNativeFoundation 0x17a7f4fa
JNFCallStaticBooleanMethod
+ 52
3 libawt.jnilib 0x1d1e0676 +[AWTStarter
appKitIsRunning:] + 282
...
18 com.apple.HIToolbox 0x9388a961 AEProcessAppleEvent
+ 38
...
21 com.apple.AppKit 0x9117f5fb -[NSApplication
run] + 795
...
25 com.canto.cumulus 0x000026f5 start + 41
Thread 6:
0 libSystem.B.dylib 0x9728746e __semwait_signal + 10
1 libSystem.B.dylib 0x972b1dcd pthread_cond_wait
$UNIX2003
+ 73
2 libawt.jnilib 0x1d1de42c +[AWTStarter
start:swtMode:swtModeForWebStart:] + 537
3 libawt.jnilib 0x1d1f7de5 JNI_OnLoad + 625
4 libjava.jnilib 0x17a8de88
Java_java_lang_ClassLoader_00024NativeLibrary_load + 175
...
42 libjvm.dylib 0x188d226b
JNI_CreateJavaVM_Impl +
3995
...
47 libSystem.B.dylib 0x972b1155 _pthread_start + 321
48 libSystem.B.dylib 0x972b1012 thread_start + 34
Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x1d361b76 ebx: 0x17a7d8d0 ecx: 0xbfffeba8 edx: 0x00000001
edi: 0x00000000 esi: 0xbfffeba8 ebp: 0xbfffea98 esp: 0xbfffea70
ss: 0x0000001f efl: 0x00010282 eip: 0x17a7d836 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
cr2: 0x00000000
Binary Images:
0x46b000 - 0x471ffd com.apple.JavaVM 12.2.2 (12.2.2)
<9ad39149cc7ecc91da3e93df7f61d315>
/System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM
Does anyone know a way to work around this problem?