Unable to load libjava.so in fakechroot

Bug #1383687 reported by Robin McCorkell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openjdk-7 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

When running java inside a chroot run through fakechroot, initialization fails with the following messages (assuming chroot is set up at /var/lib/foo/chroot):

OpenJDK 64-Bit Server VM warning: No monotonic clock was available - timed services may be adversely affected if the time-of-day clock changes
Error occurred during initialization of VM
Unable to load native library: /var/lib/foo/chroot/var/libjava.so: cannot open shared object file: No such file or directory

The path is completely wrong, since although it contains the path to the chroot the library location is [chroot]/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libjava.so, not [chroot]/var/libjava.so. I turned on fakechroot debugging to test this - there is a realpath command being called with the correct path, but the following stat's and fopen's are completely wrong:

fakechroot: realpath("/var/lib/foo/chroot/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so", &resolved)
fakechroot: __lxstat64_rel(1, "/var", &buf)
fakechroot: __lxstat64_rel(1, "/var/lib", &buf)
fakechroot: __lxstat64_rel(1, "/var/lib/foo", &buf)
fakechroot: fopen("/var/libverify.so", "r")
fakechroot: rel2abs("/var/libverify.so", &resolved)
fakechroot: rel2abs("/var/libverify.so", "/var/libverify.so")
fakechroot: dlopen("/var/libverify.so", 1)
fakechroot: rel2abs("/var/libverify.so", &resolved)
fakechroot: rel2abs("/var/libverify.so", "/var/libverify.so")
fakechroot: open("/var/libverify.so", 2048, ...)
fakechroot: rel2abs("/var/libverify.so", &resolved)
fakechroot: rel2abs("/var/libverify.so", "/var/libverify.so")
fakechroot: fopen("/var/libjava.so", "r")
fakechroot: rel2abs("/var/libjava.so", &resolved)
fakechroot: rel2abs("/var/libjava.so", "/var/libjava.so")
fakechroot: dlopen("/var/libjava.so", 1)
fakechroot: rel2abs("/var/libjava.so", &resolved)
fakechroot: rel2abs("/var/libjava.so", "/var/libjava.so")
fakechroot: open("/var/libjava.so", 2048, ...)
fakechroot: rel2abs("/var/libjava.so", &resolved)
fakechroot: rel2abs("/var/libjava.so", "/var/libjava.so")

Setting JAVA_HOME did not fix the issue, in fact the debug output showed nothing even changed.

This was seen on Ubuntu 14.04, package version 7u65-2.5.2-3~14.04 on amd64

Revision history for this message
Robin McCorkell (xenopathic) wrote :

Sorry, this isn't a problem with OpenJDK but rather with fakechroot not implementing dladdr and dl_iterate_phdr

Changed in openjdk-7 (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.