Description of problem: I started libreoffice-gtk3 with a java-based extension (LanguageTool, see https://languagetool.org/ ). When I tried to open the extensions' GUI from menu ("Tools" → "LanguageTool" → "Options…") libreoffice crashed. This crash is expected since 1. libreoffice uses gtk3 2. libreoffice runs java in its own process 3. java builds GUIs based on AWT or Swing based on gtk2 4. gtk2 and gtk3 libraries must not be loaded into the same process Looks like libreoffice needs to a) disable AWT/Swing GUIs for extensions b) keep using gtk2 until java is ported to gtk3 or at least away from gtk2 c) put extensions or java code in a separate subprocess like firefox does with its plugins Version-Release number of selected component: libreoffice-core-5.0.3.2-4.fc23 Additional info: reporter: libreport-2.6.3 backtrace_rating: 4 cmdline: /usr/lib64/libreoffice/program/soffice.bin --splash-pipe=5 crash_function: CallSystemHandler(int) executable: /usr/lib64/libreoffice/program/soffice.bin kernel: 4.2.6-300.fc23.x86_64 runlevel: N 5 type: CCpp Truncated backtrace: Thread no. 1 (2 frames) #2 CallSystemHandler(int) at /usr/src/debug/libreoffice-5.0.3.2/sal/osl/unx/signal.cxx:367 #3 SignalHandlerFunction(int) at /usr/src/debug/libreoffice-5.0.3.2/sal/osl/unx/signal.cxx:452
Created attachment 1098799 [details] File: backtrace
Created attachment 1098800 [details] File: core_backtrace
Created attachment 1098801 [details] File: dso_list
Created attachment 1098802 [details] File: limits
Created attachment 1098803 [details] File: maps
Created attachment 1098804 [details] File: namespaces
Created attachment 1098805 [details] File: open_fds
Created attachment 1098806 [details] File: proc_pid_status
caolanm->ahughes: longer term do we expect the swing/awt stuff to be implemented via gtk3 ? caolanm->sbergman: shorter term any ideas about how to detect/head-off this problem ?
It's been talked about a couple of times in the past, but it always seems to diverge into the idea of a long-term project that would replace rather than update the existing one. One was even attempted as part of Google's Summer of Code, but I see no sign of it being integrated. I would like to look at just getting it to build against Gtk+ 3 as a start, even if it's not optimal on that version. Would this solve your problem? You can turn Gtk+ off by setting a different default look and feel. Maybe it should not even be the default on GNOME 3? Oddly, it's not the default on other Gtk+ desktops like Xfce. There's another long-standing bug for that.
I think either ahughes or me is missing the point here. (In reply to Andrew John Hughes from comment #10) > I would like to look at just getting it to build against Gtk+ 3 as a start, even if it's not optimal on that version. Would this solve your problem? It already does build. The issue is that at runtime libreoffice loads java (JVM + standard library) which can load GUI code using Swing based on Gtk2. If libreoffice is started with a Gtk3 backend both Gtk2 and Gtk3 code would reside in the same process, which is disallowed and will always crash. > You can turn Gtk+ off by setting a different default look and feel. How would you be able to do that? Afaik all (Java+)Swing LookAndFeels are implemented using Gtk3. For example LanguageTool (the extension mentioned above) is using the Nimbus LookAndFeel and crashes anyway.
a workaround is to set SAL_USE_VCLPLUGIN=gtk (to use gtk2 plugin) or SAL_USE_VCLPLUGIN=gen (to use generic X11 plugin) in the environment for LibreOffice. does the JRE have a similar architecture with different back-ends for the UI? would it be possible to select a non-gtk2 plugin with an environment variable or command line paramater?
(In reply to Christian Stadelmann from comment #11) > > You can turn Gtk+ off by setting a different default look and feel. > > How would you be able to do that? Afaik all (Java+)Swing LookAndFeels are > implemented using Gtk3. For example LanguageTool (the extension mentioned > above) is using the Nimbus LookAndFeel and crashes anyway. I meant Gtk2, sorry. Java is based on Gtk2 on Linux. And it looks like there has been some work to port Swing/AWT to gtk3 but it has not been merged upstream.
(In reply to Christian Stadelmann from comment #11) > I think either ahughes or me is missing the point here. > > (In reply to Andrew John Hughes from comment #10) > > I would like to look at just getting it to build against Gtk+ 3 as a start, even if it's not optimal on that version. Would this solve your problem? > > It already does build. The issue is that at runtime libreoffice loads java > (JVM + standard library) which can load GUI code using Swing based on Gtk2. > If libreoffice is started with a Gtk3 backend both Gtk2 and Gtk3 code would > reside in the same process, which is disallowed and will always crash. > I'm referring to OpenJDK and porting its Gtk+ 2 look and feel to Gtk+ 3. > > You can turn Gtk+ off by setting a different default look and feel. > > How would you be able to do that? Afaik all (Java+)Swing LookAndFeels are > implemented using Gtk3. For example LanguageTool (the extension mentioned > above) is using the Nimbus LookAndFeel and crashes anyway. Nothing in OpenJDK is based on Gtk 3. The Gtk+ look and feel uses Gtk+ 2. The rest are a mix of X and native Java. AIUI, it would be enough for one piece of Java code in the process to load Gtk+ 2 to cause the issue.
I have a bodge for this on our side to disable swing using gtk2 if we are using gtk3
What does that mean? will gtk2 UIs be blocked? Or will swing stop using gtk2?
It's possible to use Swing without Gtk+ at all. It's just used for an optional look and feel (i.e. to make the widgets look like Gtk+ widgets rather than Java widgets). Caolan, can you share this 'bodge'? Off-hand, I think just avoiding the system look and feel should be enough, but, if not, that's something we can look at in OpenJDK.
Yeah, I'm just trying to force swing not to use gtk2 if it gets asked to use the SystemLookAndFeel when launched from a gtk3-using LibreOffice i.e. -Dswing.systemlaf=something_or_other https://gerrit.libreoffice.org/#/c/22433/2/stoc/source/javavm/javavm.cxx caolanm->ahughes: It's not LibreOffice that uses swing, it's random java extensions that are launched from LibreOffice via the Java VM integration that might or might not attempt to use the native look. Perhaps it would work on the openjdk side to dlsym(NULL, "gtk_widget_get_path") or some other gtk3-only symbol to detect if its unsafe to try and load any gtk2 libs.
Since this issue can also happen in eclipse (SWT is based on Gtk+ 3 too) a solution in openjdk would be useful.
(In reply to Caolan McNamara from comment #18) > Yeah, I'm just trying to force swing not to use gtk2 if it gets asked to use > the SystemLookAndFeel when launched from a gtk3-using LibreOffice > > i.e. -Dswing.systemlaf=something_or_other > > https://gerrit.libreoffice.org/#/c/22433/2/stoc/source/javavm/javavm.cxx > > caolanm->ahughes: It's not LibreOffice that uses swing, it's random java > extensions that are launched from LibreOffice via the Java VM integration > that might or might not attempt to use the native look. > Ah, I see. > Perhaps it would work on the openjdk side to dlsym(NULL, > "gtk_widget_get_path") or some other gtk3-only symbol to detect if its > unsafe to try and load any gtk2 libs. That's a good test. I look at getting it into OpenJDK.
libreoffice-5.0.5.2-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-ad89a358ff
libreoffice-5.0.5.2-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-ad89a358ff
libreoffice-5.0.5.2-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.