-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: None
-
Component/s: javafx
-
None
-
master
-
iOS
After https://bugs.openjdk.org/browse/JDK-8124033, a call to pthread_key_create() was added to initialize the thread local, but it was done inside an assertion:
assert(pthread_key_create(&GlassThreadDataKey, NULL) == 0);
This expression fails to be evaluated when assertions are not enabled. This happens when compiling with clang and -DNDEBUG option.
In this case, the thread local is not initialized and the app crashes at runtime:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001f3a98c20
Termination Reason: Namespace SIGNAL, Code 5, Trace/BPT trap: 5
Terminating Process: exc handler [13641]
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_pthread.dylib 0x1f3a98c20 pthread_self + 44
1 Foundation 0x19483580c _NSThreadGet0 + 27
2 HelloFXMobileApp 0x100673d28 Java_com_sun_glass_ui_ios_IosWindow__1createWindow + 460
3 HelloFXMobileApp 0x100644050 ffi_call_SYSV + 80
4 HelloFXMobileApp 0x10064c818 ffi_call_int + 1388
5 HelloFXMobileApp 0x1006423b8 ZeroInterpreter::native_entry(Method*, long, JavaThread*) + 828
6 HelloFXMobileApp 0x100641e00 ZeroInterpreter::main_loop(int, JavaThread*) + 576
7 HelloFXMobileApp 0x100641940 ZeroInterpreter::normal_entry(Method*, long, JavaThread*) + 72
...
52 HelloFXMobileApp 0x1006418b4 ZeroInterpreter::invoke_method(Method*, unsigned char*, JavaThread*) + 24
53 HelloFXMobileApp 0x1005a5334 StubGenerator::call_stub(JavaCallWrapper*, long*, BasicType, Method*, unsigned char*, long*, int, JavaThread*) + 524
54 HelloFXMobileApp 0x1003234bc JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) + 908
55 HelloFXMobileApp 0x10033b564 jni_invoke_nonstatic(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, JavaThread*) + 852
56 HelloFXMobileApp 0x10033fc64 jni_CallVoidMethod + 248
57 HelloFXMobileApp 0x100667e28 -[GlassRunnable run] + 136
58 Foundation 0x19485c1d0 __NSThreadPerformPerform + 263
59 CoreFoundation 0x197217f10 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 27
60 CoreFoundation 0x197217e84 __CFRunLoopDoSource0 + 171
61 CoreFoundation 0x1971f5acc __CFRunLoopDoSources0 + 231
62 CoreFoundation 0x1971cc6d8 __CFRunLoopRun + 819
63 CoreFoundation 0x1971cba6c _CFRunLoopRunSpecificWithOptions + 531
64 GraphicsServices 0x238df8498 GSEventRunModal + 119
65 UIKitCore 0x19cba6df8 -[UIApplication _run] + 791
66 UIKitCore 0x19cb4fe54 UIApplicationMain + 335
67 HelloFXMobileApp 0x1001381b8 main + 88
68 dyld 0x1941dee28 start + 7115
Workaround: When not using NDEBUG in the compilation, the app doesn't crash. Alternatively, this could be undefined in GlassApplication.m:
#ifdef NDEBUG
#undef NDEBUG
#endif
#import <UIKit/UIKit.h>
#import "GlassMacros.h"
...
But ideally, the fix should move the expression out of the assert.
assert(pthread_key_create(&GlassThreadDataKey, NULL) == 0);
This expression fails to be evaluated when assertions are not enabled. This happens when compiling with clang and -DNDEBUG option.
In this case, the thread local is not initialized and the app crashes at runtime:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001f3a98c20
Termination Reason: Namespace SIGNAL, Code 5, Trace/BPT trap: 5
Terminating Process: exc handler [13641]
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_pthread.dylib 0x1f3a98c20 pthread_self + 44
1 Foundation 0x19483580c _NSThreadGet0 + 27
2 HelloFXMobileApp 0x100673d28 Java_com_sun_glass_ui_ios_IosWindow__1createWindow + 460
3 HelloFXMobileApp 0x100644050 ffi_call_SYSV + 80
4 HelloFXMobileApp 0x10064c818 ffi_call_int + 1388
5 HelloFXMobileApp 0x1006423b8 ZeroInterpreter::native_entry(Method*, long, JavaThread*) + 828
6 HelloFXMobileApp 0x100641e00 ZeroInterpreter::main_loop(int, JavaThread*) + 576
7 HelloFXMobileApp 0x100641940 ZeroInterpreter::normal_entry(Method*, long, JavaThread*) + 72
...
52 HelloFXMobileApp 0x1006418b4 ZeroInterpreter::invoke_method(Method*, unsigned char*, JavaThread*) + 24
53 HelloFXMobileApp 0x1005a5334 StubGenerator::call_stub(JavaCallWrapper*, long*, BasicType, Method*, unsigned char*, long*, int, JavaThread*) + 524
54 HelloFXMobileApp 0x1003234bc JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) + 908
55 HelloFXMobileApp 0x10033b564 jni_invoke_nonstatic(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, JavaThread*) + 852
56 HelloFXMobileApp 0x10033fc64 jni_CallVoidMethod + 248
57 HelloFXMobileApp 0x100667e28 -[GlassRunnable run] + 136
58 Foundation 0x19485c1d0 __NSThreadPerformPerform + 263
59 CoreFoundation 0x197217f10 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 27
60 CoreFoundation 0x197217e84 __CFRunLoopDoSource0 + 171
61 CoreFoundation 0x1971f5acc __CFRunLoopDoSources0 + 231
62 CoreFoundation 0x1971cc6d8 __CFRunLoopRun + 819
63 CoreFoundation 0x1971cba6c _CFRunLoopRunSpecificWithOptions + 531
64 GraphicsServices 0x238df8498 GSEventRunModal + 119
65 UIKitCore 0x19cba6df8 -[UIApplication _run] + 791
66 UIKitCore 0x19cb4fe54 UIApplicationMain + 335
67 HelloFXMobileApp 0x1001381b8 main + 88
68 dyld 0x1941dee28 start + 7115
Workaround: When not using NDEBUG in the compilation, the app doesn't crash. Alternatively, this could be undefined in GlassApplication.m:
#ifdef NDEBUG
#undef NDEBUG
#endif
#import <UIKit/UIKit.h>
#import "GlassMacros.h"
...
But ideally, the fix should move the expression out of the assert.
- links to
-
Commit(master)
openjdk/jfx/60139bd0
-
Review(master)
openjdk/jfx/2065