Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#69507 - [jre-openjdk] unlisted libxtst dependency

Attached to Project: Arch Linux
Opened by M. (Tomsod) - Tuesday, 02 February 2021, 13:18 GMT
Last edited by Doug Newgard (Scimmia) - Tuesday, 02 February 2021, 14:53 GMT
Task Type Bug Report
Category Packages: Extra
Status Assigned
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

ghidra 9.2.2 fails to start without libxtst installed.
From what I can gather, it makes use of Java AWT, which is linked to libXtst.so, so ghidra quits with an error when that library isn't found.

With libxtst, ghidra seems to work correctly.
The bug part is that neither the ghidra package itself nor its dependencies are listed as requiring libxtst. Although jdk-openjdk has it as a make dependency, it's not required for a prebuild package.

To see the precise error message, run ghidra in foreground mode:
/opt/ghidra/support/launch.sh fg Ghidra "" "" ghidra.GhidraRun
This task depends upon

Comment by Doug Newgard (Scimmia) - Tuesday, 02 February 2021, 13:50 GMT
What binary, exactly, needs the lib? Use lddtree from the pax-utils package to help you track it down.
Comment by M. (Tomsod) - Tuesday, 02 February 2021, 14:41 GMT
According to the error message, it's /usr/lib/jvm/java-15-openjdk/lib/libawt_xawt.so from jre-openjdk. lddtree says it requires libXtst.so.6 directly. jre-openjdk also has libxtst as a make dependency, but not as an install dependency.

I might as well post the entire error message here (wish I knew how to create hidable text):

> LC_ALL=C /opt/ghidra/support/launch.sh fg Ghidra "" "" ghidra.GhidraRun
OpenJDK 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "ghidra.GhidraClassLoader"). To use archived non-system classes, this property must not be set
openjdk version "15.0.2" 2021-01-19
OpenJDK Runtime Environment (build 15.0.2+7)
OpenJDK 64-Bit Server VM (build 15.0.2+7, mixed mode)
Error: Uncaught Exception!
UnsatisfiedLinkError - /usr/lib/jvm/java-15-openjdk/lib/libawt_xawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-15-openjdk/lib/libawt_xawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2407)
at java.base/java.lang.Runtime.load0(Runtime.java:747)
at java.base/java.lang.System.load(System.java:1857)
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169)
at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:310)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:280)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2416)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:809)
at java.base/java.lang.System.loadLibrary(System.java:1893)
at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1380)
at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1378)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1377)
at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1410)
at java.desktop/java.awt.Component.<clinit>(Component.java:622)
at ghidra.StatusReportingTaskMonitor.setMessage(GhidraRun.java:254)
at ghidra.framework.Application.initializeLogging(Application.java:144)
at ghidra.framework.Application.initialize(Application.java:94)
at ghidra.framework.Application.initializeApplication(Application.java:114)
at ghidra.GhidraRun.lambda$launch$1(GhidraRun.java:78)
at java.base/java.lang.Thread.run(Thread.java:832)
Comment by M. (Tomsod) - Wednesday, 03 February 2021, 15:06 GMT
I actually suspect that jre-openjdk in particular not requiring libxtst may be intentional? I've seen this before -- some program is dynamically linked to a library that provides an optional feature, and then that library is only listed as an optional dependency, with the expectation that without it the rest of the program's features will work correctly. JRE is evidently linked to a lot of libraries, and requiring the user to install them all could be a burden, especially if most of them end up not being used. On the other hand, this strategy requires the maintainers of all packages that use JRE to faithfully check which of the libraries are needed for the features that are used by the package in question, which can lead to the bugs like this one.
Comment by Doug Newgard (Scimmia) - Wednesday, 03 February 2021, 15:15 GMT
That's what optional deps are for.
Comment by Arsenii (ettavolt) - Wednesday, 28 April 2021, 15:32 GMT
I've tried main packages (java-openjdk and java-openjfx) upgraded to 16th release.

Did test java-openjdk rebuild with itself, i.e. built rel=1 with current 15th, got 16th with tweaked dependencies, built rel=2 with rel=1. Logs included.

This task's dependency change is included as non-optional. The thing is, libxtst (https://archlinux.org/packages/extra/x86_64/libxtst/) is required by gnome-session, pulseaudio, qt5-webengine, thus, I suspect, noone usually notices it's missing. However, if something tries to load jawt_xawt (any GUI java, I suspect, maybe even SWT ones), linux linker would require libxtst present unconditionally.

I did review couple of other dependencies and moved them around basing on inclusion of requiring SOs in one or the other package.

libnet was removed because OpenJDK builds some libnet.so itself. I've specifically tried a network+JFX application with my packages and without libnet - and it worked.

OpenJDK patch also includes 'install fix' from https://bugs.archlinux.org/task/69853.

Loading...