summaryrefslogtreecommitdiffstats
path: root/src/test-native/bug1398/make-bug1398.sh
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-02-22 15:11:17 +0100
committerSven Gothel <[email protected]>2020-02-22 15:11:17 +0100
commit78b96b89a68ff35969aea83de294cd3cc1178f26 (patch)
treea1c63979d777bb52b2e365bdd3fd7e62c99c410d /src/test-native/bug1398/make-bug1398.sh
parentff780fc11602fb79a7ce1dcf879fdaeb865b9fa8 (diff)
Bug 1398: Crash only occurs @ -[NSOpenGLContext setView:] when using XCode 11 _and_ its default SDK 'macosx10.15'
This patch demonstrates that using the SDK 'macosx10.11' does not cause the crash @ -[NSOpenGLContext setView:]. SDK 'macosx10.15' enforces Apple's own Cargo Cult of 'main-thread' by throwing a SIGILL signal (or SIGABRT) - essentially an exception. This surely renders our code officially invalid due to this policy, i.e. we are not allowed to issue [* setView] on any non main-thread. +++ The crash occurs independently of used Java version on Java 8 - 11, as well as on JogAmp 2.3.2 - current master tip. +++ The initial remedy to issue said action on the main-thread in a blocking/wait manner has the risk to deadlock, due to 1) [NSOpenGLContext setView:] itself using a mutex (Thanks to Ken Harris's analysis) and (2) in case where we are 'thread hopping': - [main-thread] Event like 'window ready' -> kick off action on EDT-thread *blocking* - [EDT-thread] Create stuff incl OpenGLContext -> kick off setView on main-thread *blocking* This has to be further investigated. This crash finally has been reliably reproduced now.
Diffstat (limited to 'src/test-native/bug1398/make-bug1398.sh')
-rwxr-xr-xsrc/test-native/bug1398/make-bug1398.sh16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/test-native/bug1398/make-bug1398.sh b/src/test-native/bug1398/make-bug1398.sh
index 7ec9935d9..bf2367313 100755
--- a/src/test-native/bug1398/make-bug1398.sh
+++ b/src/test-native/bug1398/make-bug1398.sh
@@ -5,15 +5,25 @@ set -x
JOGAMP_VERSION=v2.3.2
#JOGAMP_VERSION=v2.2.4
+unset SDKROOT
+
CLASSPATH=".:/Users/jogamp/projects/JogAmp/builds/$JOGAMP_VERSION/jogamp-all-platforms/jar/gluegen-rt.jar:/Users/jogamp/projects/JogAmp/builds/$JOGAMP_VERSION/jogamp-all-platforms/jar/jogl-all.jar"
+#CLASSPATH=".:/Users/jogamp/projects/JogAmp/gluegen/build/gluegen-rt.jar:/Users/jogamp/projects/JogAmp/jogl/build/jar/jogl-all.jar"
+
ok=0
-xcrun clang -x objective-c -framework Cocoa \
- -o Bug1398macOSContextOpsOnMainThread Bug1398macOSContextOpsOnMainThread.c \
+# Default macosx10.15 SDK on XCode 11
+xcrun --sdk macosx10.15 clang -x objective-c -framework Cocoa \
+ -o Bug1398LauncherSDK1015 Bug1398Launcher.c \
+ && ok=1
+
+# Non-Default macosx10.11 SDK (JogAmp builds)
+xcrun --sdk macosx10.11 clang -x objective-c -framework Cocoa \
+ -o Bug1398LauncherSDK1011 Bug1398Launcher.c \
&& ok=1
if [ $ok -eq 1 ] ; then
- javac -source 1.8 -target 1.8 -classpath $CLASSPATH RedSquareES2.java Bug1398macOSContextOpsOnMainThread.java
+ javac -source 1.8 -target 1.8 -classpath $CLASSPATH RedSquareES2.java Bug1398MainClass.java
fi