Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 917326 - dev-java/java-config: gjl produces wrong library path for 64-bit systems
Summary: dev-java/java-config: gjl produces wrong library path for 64-bit systems
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2023-11-14 09:59 UTC by Florian Schmaus
Modified: 2023-11-16 20:30 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Schmaus gentoo-dev 2023-11-14 09:59:19 UTC
Starting an application via the lauchner created by java-pkg_dolauncher on a 64-bit system invokes the Java VM with only a 32-bit library path:

GJL_DEBUG=1 sandmann -p
Calling: gjl --package sandmann-bin --get-args --get-jar /usr/share/sandmann-bin/lib/sandmann.jar --get-vm
Using: openjdk-17
Running: exec java  -classpath /usr/share/sandmann-bin/lib/sandmann.jar -Djava.library.path=/lib:/usr/lib  -jar /usr/share/sandmann-bin/lib/sandmann.jar  -p
Exception in thread "main" java.lang.UnsatisfiedLinkError: /lib/libsystemd.so.0.37.0: wrong ELF class: ELFCLASS32
Library names
[systemd]
Search paths:
[/lib, /usr/lib, /usr/local/lib, /usr/lib64, /usr/local/lib64, /usr/lib/rust/lib, /usr/lib/llvm/16/lib, /usr/lib/llvm/16/lib64, /usr/lib/llvm/15/lib, /usr/lib/llvm/15/lib64, /usr/lib64/opencascade, /usr/lib/gcc/x86_64-pc-linux-gnu/13, /usr/lib/gcc/x86_64-pc-linux-gnu/13/32]
	at jnr.ffi.provider.jffi.NativeLibrary.loadNativeLibraries(NativeLibrary.java:111)
	at jnr.ffi.provider.jffi.NativeLibrary.getNativeLibraries(NativeLibrary.java:85)
	at jnr.ffi.provider.jffi.NativeLibrary.getSymbolAddress(NativeLibrary.java:64)
	at jnr.ffi.provider.jffi.NativeLibrary.findSymbolAddress(NativeLibrary.java:74)
	at jnr.ffi.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:141)
	at jnr.ffi.provider.jffi.AsmLibraryLoader.loadLibrary(AsmLibraryLoader.java:87)
	at jnr.ffi.provider.jffi.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:44)
	at jnr.ffi.LibraryLoader.load(LibraryLoader.java:420)
	at jnr.ffi.LibraryLoader.load(LibraryLoader.java:399)
	at eu.geekplace.systemd.Systemd$.<clinit>(Systemd.scala:32)
	at eu.geekplace.sandmann.Logging$.<clinit>(Logging.scala:41)
	at eu.geekplace.sandmann.Sandmann$.<clinit>(Sandmann.scala:32)
	at eu.geekplace.sandmann.Sandmann.main(Sandmann.scala)


Note the "Djava.library.path=/lib:/usr/lib" above. Substituting 'lib' with 'lib64' allows the application to run.
Comment 1 Larry the Git Cow gentoo-dev 2023-11-14 13:52:16 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/java-config.git/commit/?id=951de94124539904d9aa498d89ae8f0daf8aa508

commit 951de94124539904d9aa498d89ae8f0daf8aa508
Author:     Florian Schmaus <flow@gentoo.org>
AuthorDate: 2023-11-14 11:36:15 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2023-11-14 11:38:42 +0000

    gjl: obtain library directory via LIBDIR
    
    Newer versions of java-config-2.eclass will record LIBDIR in
    package.env, which we obtain in gjl and use to set java.library.path
    when invoking the Java VM.
    
    Bug: https://bugs.gentoo.org/917326
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 src/gjl | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Comment 2 Larry the Git Cow gentoo-dev 2023-11-14 14:11:40 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=725274b578ca59a164f7837fcc546e4559ad7286

commit 725274b578ca59a164f7837fcc546e4559ad7286
Author:     Florian Schmaus <flow@gentoo.org>
AuthorDate: 2023-11-14 11:35:46 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2023-11-14 14:11:27 +0000

    java-utils-2.eclass: record LIBDIR in package.env
    
    Bug: https://bugs.gentoo.org/917326
    Closes: https://github.com/gentoo/gentoo/pull/33821
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 eclass/java-utils-2.eclass | 3 +++
 1 file changed, 3 insertions(+)
Comment 3 Larry the Git Cow gentoo-dev 2023-11-16 20:30:44 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6978c5a64afc8a18bf6567e558f9807f66211bda

commit 6978c5a64afc8a18bf6567e558f9807f66211bda
Author:     Florian Schmaus <flow@gentoo.org>
AuthorDate: 2023-11-16 20:28:47 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2023-11-16 20:30:16 +0000

    dev-java/java-config: add 2.3.3
    
    Closes: https://bugs.gentoo.org/830860
    Closes: https://bugs.gentoo.org/909905
    Closes: https://bugs.gentoo.org/917326
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 dev-java/java-config/Manifest                 |  1 +
 dev-java/java-config/java-config-2.3.3.ebuild | 75 +++++++++++++++++++++++++++
 2 files changed, 76 insertions(+)