GNOME Bugzilla – Bug 698095
ATK Wrapper makes java applications crash
Last modified: 2015-06-06 08:44:31 UTC
Hello, Openjdk is disabling accessibility by default because the atk wrapper is making applications crash. See notably https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/935296 This is pretty bad, because this prevents distributions from being accessible by default. It seems to all boil down to a single issue: java-atk-wrapper uses threads, and thus uses XInitThreads to attempt to initialize a thread-safe libX11, but whenever the application initializes X11 before java-atk-wrapper gets to call XInitThreads, libX11 is kept initialized in a non-threadsafe way, resulting into all kinds of races and odd issues. I'm not sure whether the JNI provides any way to be sure of calling XInitThreads before anything else in the application initializes libX11. The safest way would of course be that java-atk-wrapper does not use threads at all, or at least perform all X11 operations in the main thread. Samuel
[Mass-resetting default assignee, see bug 705890. Please reclaim this bug report by setting the assignee to yourself if you still plan to work on this. Thanks!]
Which kind of information is missing? There was no question asked to this bug report.
[Moving at-spi/java-atk-wrapper bugs to separate product. See bug 740075]
(In reply to Samuel Thibault from comment #2) > Which kind of information is missing? There was no question asked to this > bug report. Thanks for getting back to me about this Samuel. Sorry, for not making the NEEDINFO clear sooner. Essentially, I was not ever able to recreate the issue in your report, so I just wanted to check what version you are having trouble with. The whole approach to initialisation and threading has been updated fairly substantially since this bug was first filed, so I am hoping the changes may have dealt with your issue (hopefully without replacing it with any new issue). Latest version is at: https://git.gnome.org/browse/java-atk-wrapper/ Thanks again.
I have now tried version 0.32.92, running the arduino application, getting: (java:11546): Gdk-CRITICAL **: IA__gdk_threads_set_lock_functions: assertion 'gdk_threads_lock == NULL && gdk_threads_unlock == NULL' failed (java:11546): GLib-GObject-WARNING **: cannot register existing type 'JawImpl_2' (java:11546): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed (java:11546): GLib-GObject-WARNING **: invalid cast from 'JawImpl_2' to '<invalid>' etc. and eventually crash Commenting assistive_technologies=org.GNOME.Accessibility.AtkWrapper makes the application work fine (and the atk wrapper not get loaded of course).
These warnings seem to be addressed with attachment 304294 [details] [review] for bug 750128. The stack I have for the crash itself:
+ Trace 235103
Is that consistent with what you're seeing?
It's a bit different here, but that's the idea, yes:
+ Trace 235104
Created attachment 304453 [details] [review] patch to fix bug
I think this can be closed now as it seems to have addressed the crash for me, but feel free to re-open if you are still having the same problem.
Created attachment 304529 [details] [review] missed a couple in jawutil crash doesn't seem to be caused without this patch but I have amended the g_hash_table_lookup arguments just for the sake of it.
Yes, with these patches applied, I don't get the crash any more.