Mesa8 release-context implementation attempts to access the TLS u_current_user 'field'.
For some reason, an already existing thread like AWT-EDT [0.1] cannot use libGL's global TLS [3]
when the latter was initialized by a later running thread [0.2] + [1].
Prove that this is the root cause can be made by it's remedies:
R1: Set java system property 'sun.java2d.opengl' to 'true', which loads and
uses libGL from the start.
R2: Load the libraries [1] from the AWT-EDT
+++
R2 is our workaround in JOGL and works fine w/ Ubuntu 12.04 & Mesa8
+++
Nevertheless, it is unclear whether the above behavior is intrinsic to
tls_model("global-dynamic") and hence a restriction or other special
circumstances
lead to an erroneous behavior.
Note:tls_model("initial-exec") works fine, i.e. w/o patch 113_fix_tls.diff
Allow me to copy my analysis of this bug here /jogamp. org/bugzilla/ show_bug. cgi?id= 566#c13
from https:/
This bug affects all Mesa8 w/ the tls_model( "global- dynamic" ) patch enabled!
+++
Analysis of patch 113_fix_tls.diff and it's freezing impact:
+++ _((tls_ model(" initial- exec")) ); _((tls_ model(" global- dynamic" )));
extern __thread void *u_current_user
- __attribute_
+ __attribute_
+++
the above changes the TLS behavior of libGL.
Note: u_current_user reflects the current context urrent( ..).
changed by glXMakeContextC
Phenomenon of AWT-EDT glXMakeContextC urrent( ) freeze:
[0] Java launches
[0.1] starts new AWT-EDT thread
[0.2] starts main thread and hands over execution of main
[1] JOGL loads and initializes the libGL via 1st call of GLProfile. initSingleton( )
incl. lib loading via dlopen() and symbol lookup etc.
[2] Step [1] kicks of the shared resource runner, which creates the very 1st
JOGL GL context while probing all profiles.
[3] At some point, AWT-EDT runs a JOGL Runnable:
[3.1] ctx = createContext()
[3.2] makeCurrent(dpy, read, write, ctx);
[3.3] makeCurrent(dpy, 0, 0, 0); -> release context *** Freeze ***
glx/glxcurrent. c/MakeContextCu rrent() :...... ......_ _glXSetCurrentC ontextNull( ) c/__glXSetCurre ntContextNull( ): ....... ..._glapi_ set_context( NULL); mapi/mapi_ glapi.c/ _glapi_ set_context( NULL):. ....... u_current_ set_user( NULL); mapi/u_ current. c/u_current_ set_user( NULL):. ....... .....u_ current_ init(); mapi/u_ current. c/u_current_ set_user( NULL): ....... ......u_ current_ user =(void *) ptr; ***** FREEZE ***
glx/glxcurrent.
./mapi/
./mapi/
./mapi/
Mesa8 release-context implementation attempts to access the TLS u_current_user 'field'.
For some reason, an already existing thread like AWT-EDT [0.1] cannot use libGL's global TLS [3]
when the latter was initialized by a later running thread [0.2] + [1].
Prove that this is the root cause can be made by it's remedies:
R1: Set java system property 'sun.java2d.opengl' to 'true', which loads and
uses libGL from the start.
R2: Load the libraries [1] from the AWT-EDT
+++
R2 is our workaround in JOGL and works fine w/ Ubuntu 12.04 & Mesa8
+++
Nevertheless, it is unclear whether the above behavior is intrinsic to "global- dynamic" ) and hence a restriction or other special
tls_model(
circumstances
lead to an erroneous behavior.
Note:tls_ model(" initial- exec") works fine, i.e. w/o patch 113_fix_tls.diff