java -jamvm fails to run; couldn't open libjava.so

Bug #850433 reported by Xerxes Rånby
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Iced Tea
Fix Released
Medium
openjdk-7 (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Fix Released
Medium
Unassigned
Quantal
Fix Released
Undecided
Unassigned

Bug Description

tested on armel oneiric using testcase:
/usr/lib/jvm/java-7-openjdk-armel/bin/java -jamvm -verbose:jni -version

output:
xranby@ac100-oneiric:~$ /usr/lib/jvm/java-7-openjdk-armel/bin/java -jamvm -verbose:jni -version
[Failed to open library /usr/lib/jvm/java-7-openjdk-armel/jre/lib/arm/libjava.so: libjvm.so: cannot open shared object file: No such file or directory]
Error initialising natives: couldn't open libjava.so: use -verbose:jni for more information
Error initialising VM (initialiseNatives)
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

workaround:
cd /usr/lib/jvm/java-7-openjdk-armel/jre/lib/arm/
sudo ln -s jamvm/libjvm.so .

expected output:
xranby@ac100-oneiric:/usr/lib/jvm/java-7-openjdk-armel/jre/lib/arm$ /usr/lib/jvm/java-7-openjdk-armel/bin/java -jamvm -verbose:jni -version
[Opened native library /usr/lib/jvm/java-7-openjdk-armel/jre/lib/arm/libjava.so]
[Dynamic-linking native method java.lang.Object.registerNatives ... JNI]
...
[Dynamic-linking native method sun.misc.Unsafe.compareAndSwapObject ... internal]
OpenJDK Runtime Environment (IcedTea7 2.0pre) (7~b147-2.0~pre4-1)
JamVM (build 1.6.0-devel, inline-threaded interpreter with stack-caching)

Tags: jamvm
Xerxes Rånby (xranby)
tags: added: jamvm
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openjdk-7 (Ubuntu):
status: New → Confirmed
Revision history for this message
Martin Fox (belden-fox) wrote :

Encountered this bug not only on armel but i386 server (headless) installation.

Revision history for this message
Toby Corkindale (tjc-wintrmute) wrote :

Hi,
I've confirmed this bug is still present on 12.04 (Precise) with openjdk-7 and jamvm.

-Toby

Revision history for this message
Matthias Klose (doko) wrote :

building without any debian/ubuntu patches has the same result. building icedtea with --enable-jamvm and copying the resulting libjvm.so to an existing installation has the same result. so this is not related to the ubuntu package, but seen upstream as well.

Changed in openjdk-7 (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Xerxes Rånby (xranby) wrote :

building icedtea with --enable-jamvm == work
building icedtea with --with-additional-vms=jamvm == triggers this bug

Revision history for this message
In , Xerxes Rånby (xranby) wrote :

https://bugs.launchpad.net/ubuntu/+source/openjdk-7/+bug/850433

building icedtea with --enable-jamvm == work
building icedtea with --with-additional-vms=jamvm == triggers this bug

# testcase that fail:
# ../icedtea7-2.3/configure --with-additional-vms=jamvm
./j2sdk-image-additional-vms-jamvm/bin/java -jamvm -version
Error initialising natives: couldn't open libjava.so: use -verbose:jni for more information
Error initialising VM (initialiseNatives)
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

# testcase that work:
# ../icedtea7-2.3/configure --enable-jamvm
./j2sdk-image-enable-jamvm/bin/java -version
java version "1.7.0_07"
IcedTea7 Runtime Environment (2.3.2+re7117fcb33ed) (Ubuntu build 1.7.0_07-b30)
JamVM (build 1.6.0-devel, inline-threaded interpreter with stack-caching)

Changed in icedtea:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Xerxes Rånby (xranby) wrote :

libjava.so gets linked differently depending on the build

ldd j2sdk-image-additional-vms-jamvm/jre/lib/i386/libjava.so
 libjvm.so => not found
 libverify.so => /media/2d0c92b2-31e4-49ad-b101-e1584b930ca6/diff-enable-additional/j2sdk-image-additional-vms-jamvm/jre/lib/i386/libverify.so (0x006b0000)
 libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0x00c94000)
 libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x00a78000)
 /lib/ld-linux.so.2 (0x008c2000)
 libjvm.so => not found

ldd j2sdk-image-enable-jamvm/jre/lib/i386/libjava.so
 libjvm.so.0 => not found
 libverify.so => /media/2d0c92b2-31e4-49ad-b101-e1584b930ca6/diff-enable-additional/j2sdk-image-enable-jamvm/jre/lib/i386/libverify.so (0x00418000)
 libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0x00110000)
 libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x00cb7000)
 /lib/ld-linux.so.2 (0x00a46000)
 libjvm.so.0 => not found

Revision history for this message
In , Xerxes Rånby (xranby) wrote :

objdump -x icedtea7-2.3-server-jamvm/openjdk.build/j2sdk-image/jre/lib/i386/server/libjvm.so | grep SONAME
  SONAME libjvm.so

objdump -x icedtea7-2.3-server-jamvm/openjdk.build/j2sdk-image/jre/lib/i386/jamvm/libjvm.so | grep SONAME
  SONAME libjvm.so.0

To fix this bug we need to make sure that the JamVM libjvm.so SONAME matches the Hotspot server/client SONAME.

Revision history for this message
In , Xerxes Rånby (xranby) wrote :

Created attachment 750
jamvm-avoid-version-soname.patch by Matthias Klose

Pass -avoid-version to libtool to create a JamVM libjvm.so without SONAME version numbers to match the Hotspot Server/Client libjvm.so.

Revision history for this message
Matthias Klose (doko) wrote :

fixed in quantal

Changed in openjdk-7 (Ubuntu Precise):
importance: Undecided → Medium
milestone: none → precise-updates
status: New → In Progress
Changed in openjdk-7 (Ubuntu):
status: Incomplete → Fix Released
Matthias Klose (doko)
Changed in openjdk-7 (Ubuntu Quantal):
status: Fix Released → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.7 KiB)

This bug was fixed in the package openjdk-7 - 7u7-2.3.2-1ubuntu1

---------------
openjdk-7 (7u7-2.3.2-1ubuntu1) quantal; urgency=low

  * Fix 32bit hotspot build, don't set maximal heap space lower than
    minimal heap space for the docs build.
  * d/p/sane-library-paths.patch, d/p/ant-diagnostics.diff,
    d/p/fix-race-cond-print.diff, d/p/gcc-hotspot-opt-O[02].diff,
    d/p/gcc-mtune-generic.diff, d/p/openjdk-6986968.diff: Remove, not used.
  * Remove unused shark/llvm-3.0 patches.
  * d/p/zero-only-use-floating-point-if-floating-poi.patch: Remove, applied
    upstream.
  * Don't explicitly build with -march=i586 on i386 architectures.
  * Re-apply zero-missing-headers.diff.
  * Disable cacao builds, needs update for 7u7.
  * For Ubuntu quantal, set priorities for alternatives higher than for
    OpenJDK 6.
  * Call update-alternatives when the existing priority for the alternative
    is lower than the current one.
  * Configure with --disable-downloading.
  * Pass -avoid-version to libtool to create a JamVM libjvm.so without SONAME
    version numbers to match the Hotspot Server/Client libjvm.so. LP: #850433.
  * Revert the following change: Move libgnome2-0, libgnomevfs2-0, libgconf2-4
    from Depends of JRE package to Recommends (#661465).
    The proper fix is to create a -jdk-headless package, or not depending on
    these gnome packages at all (e.g. using XDG libraries).

openjdk-7 (7u7-2.3.2-1) experimental; urgency=low

  * New upstream IcedTea7 2.3.2 release.
  * Security fixes:
    - CVE-2012-4681: Reintroduce PackageAccessible checks removed in 6788531.
    - S7079902, CVE-2012-1711: Refine CORBA data models.
    - S7143606, CVE-2012-1717: File.createTempFile should be improved
      for temporary files created by the platform.
    - S7143614, CVE-2012-1716: SynthLookAndFeel stability improvement.
    - S7143617, CVE-2012-1713: Improve fontmanager layout lookup operations.
    - S7143851, CVE-2012-1719: Improve IIOP stub and tie generation in RMIC.
    - S7143872, CVE-2012-1718: Improve certificate extension processing.
    - S7152811, CVE-2012-1723: Issues in client compiler.
    - S7157609, CVE-2012-1724: Issues with loop.
    - S7160757, CVE-2012-1725: Problem with hotspot/runtime_classfile.
    - S7165628, CVE-2012-1726: Issues with java.lang.invoke.MethodHandles.Lookup.
  * Bump version to 7u7 (OpenJDK), 2.3.2 (IcedTea). Closes: #685276.
  * d/p/icedtea7-forest-jdk_7104625-XEvent_wrap_logging_calls_with_if.patch,
    d/p/hotspot-sparc.diff: Remove, integrated upstream.
  * d/p/{deb-multiarch,fix_extra_flags,hotspot-no-werror}.diff:
    Add variants for hotspot and zero builds.
  * d/p/default-jvm-cfg.diff, d/p/icedtea-4953367.patch,
    d/p/icedtea-patch.diff, d/p/icedtea-pretend-memory.diff,
    d/p/libpcsclite-dlopen.diff, d/p/nonreparenting-wm.diff:
    Update for 2.3.2.
  * Remove build support for Ubuntu releases earlier than hardy.
  * d/update-shasum.sh: Only update the shasums of the -dfsg tarballs.
  * Don't apply shark patches (not built anyway).

openjdk-7 (7~u3-2.1.1-3) unstable; urgency=low

  * d/rules: Ensure we don't remove -02 (default) when -03 is disabled
    (fix jamvm FTBFS on armhf without -02).
  *...

Read more...

Changed in openjdk-7 (Ubuntu Quantal):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.8 KiB)

This bug was fixed in the package openjdk-7 - 7u7-2.3.2-1ubuntu0.12.04.1

---------------
openjdk-7 (7u7-2.3.2-1ubuntu0.12.04.1) precise-security; urgency=low

  * Make the avian VM a known runtime.

openjdk-7 (7u7-2.3.2-1ubuntu1) quantal; urgency=low

  * Fix 32bit hotspot build, don't set maximal heap space lower than
    minimal heap space for the docs build.
  * d/p/sane-library-paths.patch, d/p/ant-diagnostics.diff,
    d/p/fix-race-cond-print.diff, d/p/gcc-hotspot-opt-O[02].diff,
    d/p/gcc-mtune-generic.diff, d/p/openjdk-6986968.diff: Remove, not used.
  * Remove unused shark/llvm-3.0 patches.
  * d/p/zero-only-use-floating-point-if-floating-poi.patch: Remove, applied
    upstream.
  * Don't explicitly build with -march=i586 on i386 architectures.
  * Re-apply zero-missing-headers.diff.
  * Disable cacao builds, needs update for 7u7.
  * For Ubuntu quantal, set priorities for alternatives higher than for
    OpenJDK 6.
  * Call update-alternatives when the existing priority for the alternative
    is lower than the current one.
  * Configure with --disable-downloading.
  * Pass -avoid-version to libtool to create a JamVM libjvm.so without SONAME
    version numbers to match the Hotspot Server/Client libjvm.so. LP: #850433.
  * Revert the following change: Move libgnome2-0, libgnomevfs2-0, libgconf2-4
    from Depends of JRE package to Recommends (#661465).
    The proper fix is to create a -jdk-headless package, or not depending on
    these gnome packages at all (e.g. using XDG libraries).

openjdk-7 (7u7-2.3.2-1) experimental; urgency=low

  * New upstream IcedTea7 2.3.2 release.
  * Security fixes:
    - CVE-2012-4681: Reintroduce PackageAccessible checks removed in 6788531.
    - S7079902, CVE-2012-1711: Refine CORBA data models.
    - S7143606, CVE-2012-1717: File.createTempFile should be improved
      for temporary files created by the platform.
    - S7143614, CVE-2012-1716: SynthLookAndFeel stability improvement.
    - S7143617, CVE-2012-1713: Improve fontmanager layout lookup operations.
    - S7143851, CVE-2012-1719: Improve IIOP stub and tie generation in RMIC.
    - S7143872, CVE-2012-1718: Improve certificate extension processing.
    - S7152811, CVE-2012-1723: Issues in client compiler.
    - S7157609, CVE-2012-1724: Issues with loop.
    - S7160757, CVE-2012-1725: Problem with hotspot/runtime_classfile.
    - S7165628, CVE-2012-1726: Issues with java.lang.invoke.MethodHandles.Lookup.
  * Bump version to 7u7 (OpenJDK), 2.3.2 (IcedTea). Closes: #685276.
  * d/p/icedtea7-forest-jdk_7104625-XEvent_wrap_logging_calls_with_if.patch,
    d/p/hotspot-sparc.diff: Remove, integrated upstream.
  * d/p/{deb-multiarch,fix_extra_flags,hotspot-no-werror}.diff:
    Add variants for hotspot and zero builds.
  * d/p/default-jvm-cfg.diff, d/p/icedtea-4953367.patch,
    d/p/icedtea-patch.diff, d/p/icedtea-pretend-memory.diff,
    d/p/libpcsclite-dlopen.diff, d/p/nonreparenting-wm.diff:
    Update for 2.3.2.
  * Remove build support for Ubuntu releases earlier than hardy.
  * d/update-shasum.sh: Only update the shasums of the -dfsg tarballs.
  * Don't apply shark patches (not built anyway).

openjdk-7 (7~u3-2.1.1-3) unstable; urgency=low

...

Read more...

Changed in openjdk-7 (Ubuntu Precise):
status: In Progress → Fix Released
Revision history for this message
In , Mercurial (mercurial) wrote :

details: http://icedtea.classpath.org//hg/icedtea7?cmd=changeset;node=1603e47bf631
author: Xerxes Ranby <email address hidden>
date: Tue Sep 25 14:34:52 2012 +0200

 JamVM PR1155: Do not put version number in libjvm.so SONAME

 2012-09-25 Xerxes Ranby <email address hidden>

  JamVM
  PR1155: Do not put version number in libjvm.so SONAME
  * NEWS: Updated.
  * Makefile.am
  (JAMVM_VERSION): Updated JamVM to 2012-09-25 revision.
  (JAMVM_SHA256SUM): Updated.

Revision history for this message
In , Mercurial (mercurial) wrote :

details: http://icedtea.classpath.org//hg/release/icedtea7-2.3?cmd=changeset;node=b5dcc4ea49a8
author: Xerxes Ranby <email address hidden>
date: Wed Sep 26 12:05:38 2012 +0200

 JamVM PR1155: Do not put version number in libjvm.so SONAME

 2012-09-26 Xerxes Ranby <email address hidden>

  JamVM
  PR1155: Do not put version number in libjvm.so SONAME
  * NEWS: Updated.
  * Makefile.am
  (JAMVM_VERSION): Updated JamVM to 2012-09-25 revision.
  (JAMVM_SHA256SUM): Updated.

Revision history for this message
In , Xerxes Rånby (xranby) wrote :

Now fixed in IcedTea 7 2.4 and 2.3.3 by pulling in the patched JamVM from upstream.
http://git.berlios.de/cgi-bin/cgit.cgi/jamvm/commit/?id=0972452d441544f7dd29c55d64f1ce3a5db90d82

Changed in icedtea:
status: Confirmed → Fix Released
Revision history for this message
In , Mercurial (mercurial) wrote :

details: http://icedtea.classpath.org//hg/icedtea6?cmd=changeset;node=bc8359665940
author: Andrew John Hughes <email address hidden>
date: Tue Jan 22 13:53:18 2013 +0000

 JamVM PR1155: Do not put version number in libjvm.so SONAME

 2012-09-25 Xerxes Ranby <email address hidden>

  JamVM
  PR1155: Do not put version number in libjvm.so SONAME
  * NEWS: Updated.
  * Makefile.am
  (JAMVM_VERSION): Updated JamVM to 2012-09-25 revision.
  (JAMVM_SHA256SUM): Updated.

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.