Bug 1285356
| Summary: | [gtk3] gtk2 Swing/AWT GUIs in java-based extensions crash gtk3 libreoffice | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Christian Stadelmann <fedora> | ||||||||||||||||||
| Component: | libreoffice | Assignee: | Caolan McNamara <caolanm> | ||||||||||||||||||
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||||||||||||
| Severity: | unspecified | Docs Contact: | |||||||||||||||||||
| Priority: | unspecified | ||||||||||||||||||||
| Version: | 23 | CC: | ahughes, caolanm, dtardon, erack, mstahl, sbergman | ||||||||||||||||||
| Target Milestone: | --- | ||||||||||||||||||||
| Target Release: | --- | ||||||||||||||||||||
| Hardware: | x86_64 | ||||||||||||||||||||
| OS: | Unspecified | ||||||||||||||||||||
| URL: | https://retrace.fedoraproject.org/faf/reports/bthash/e0920278c7e5fbe03d86ec35ea45483aea393fb3 | ||||||||||||||||||||
| Whiteboard: | abrt_hash:254d4627532035d697583e85c4569cf670c32cb9;VARIANT_ID=workstation; | ||||||||||||||||||||
| Fixed In Version: | libreoffice-5.0.5.2-2.fc23 | Doc Type: | Bug Fix | ||||||||||||||||||
| Doc Text: | Story Points: | --- | |||||||||||||||||||
| Clone Of: | Environment: | ||||||||||||||||||||
| Last Closed: | 2016-02-23 01:23:42 UTC | Type: | --- | ||||||||||||||||||
| Regression: | --- | Mount Type: | --- | ||||||||||||||||||
| Documentation: | --- | CRM: | |||||||||||||||||||
| Verified Versions: | Category: | --- | |||||||||||||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||||||||||||
| Embargoed: | |||||||||||||||||||||
| Attachments: |
|
||||||||||||||||||||
|
Description
Christian Stadelmann
2015-11-25 12:59:21 UTC
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. |