/usr/lib/jvm/java-6-openjdk/bin/java: error while loading shared libraries: libjli.so: cannot openshared object file: No such file or directory - /proc/self/exe fullpath error on stackable filesystem

Bug #224110 reported by Loïc Minier
14
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Triaged
Medium
Unassigned
Hardy
Won't Fix
Undecided
Unassigned
openjdk-6 (Ubuntu)
Fix Released
Undecided
Unassigned
Hardy
Fix Released
Undecided
Unassigned

Bug Description

Hi,

When running java from openjdk-6-jre-headless with an unionfs-ed /, it fails to append the proper library path to locate the libs it needs.

10:48 < StevenK> The problem is this:
10:49 < StevenK> java reads /proc/self/exe and comes up with the full path,
                 including the bits that are hidden under unionfs, like
                 /squashmnt or /persistmnt, and returns
                 /squashmnt/usr/lib/jvm/java-6-openjdk/jre/bin/java
10:50 < StevenK> java then looks for it's libraries in
                 /squashmnt/usr/lib/jvm/java-6-openjdk/jre/lib, and can't find
                 them.

Adding /squashmnt -> / and /persistmnt -> / symlinks works around the issue.

This typically affects UME and live CDs.

Bye,

Tags: cft-2.6.27 ume

Related branches

Revision history for this message
Loïc Minier (lool) wrote :

I've added a kernel task as I think the kernel should mask the unionfs setup, transparently rewriting pathnames.

Revision history for this message
Loïc Minier (lool) wrote :

Hmm moving to linux-ubuntu-modules-2.6.24 as it's where unionfs lives.

Revision history for this message
Matti Lindell (mlind) wrote :

Thanks for the insight Loïc, this would also fix (duplicate) bug #103933 and its numerous duplicates which is about the same issue for all Sun related java packages. If fix can be applied to lum, it would be great.

Please push this as a SRU.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openjdk-6 - 6b09dfsg-1ubuntu1

---------------
openjdk-6 (6b09dfsg-1ubuntu1) intrepid; urgency=low

  * Rebuild source tarball with some questionable files removed.
  * Update IcedTea build infrastructure (20080514).
  * 6636469_v4.diff: Remove, committed in IcedTea.
  * debian/control: Update Vcs-* attributes.
  * debian/JB-jre-headless.p*.in: Fix update-binfmts calls.
  * Compress the man pages, fixing the slave symlinks of the alternatives.
  * javaws.desktop: Add `%u' to the Exec key, remove -viewer option.
  * openjdk-6-jre-headless: Recommends libnss-mdns.
  * openjdk-6-jre-headless: Warn about unmounted /proc file system.
  * debian/JB-jre.mime.in: Remove the -viewer option from command (Tan Rui
    Boon).
  * Add a `docs' symlink pointing to /usr/share/doc/openjdk-6. LP: #218405.
  * Set maintainer to the team list.
  * Add copyright notices for patches and generated files.
  * Add helper scripts to modify upstream tarball and generate the debian
    tarball.
  * Fix names for browser alternatives in jinfo file, set browser_plugin_dirs
    unconditionally.
  * Recommend the ttf-wqy-zenhei font instead of ttf-arphic-uming, if the
    latter is available in Truetype Collection (TTC) format only, add the
    fontconfig changes as a patch.
  * Make the cjk font packages configurable in the control file.
  * Use GCC-4.3 on all platforms where available.
  * Install a config file swing.properties, allowing a user to change
    the default look and feel. LP: #229112.
  * When trying to determine the executable name reading /proc/self/exe,
    discard known prefixes used for unionfs mounts. LP: #224110.
  * Explicitely configure with --disable-zero on hotspot architectures.
  * Add fix for issue 6659207, access violation in CompilerThread0.
    Addresses #478560. Needs checking: LP: #229207.
  * Disable building the docs on ia64, powerpc and sparc, we don't build
    architecture independent packages on these architectures.
  * Explicitely configure --with-parallel-jobs, needed by the updated IcedTea.
  * Backport the linux-sparc patches, enable building on sparc. LP: #154080.
  * Don't use an absolute path calling the compiler.

 -- Matthias Klose <email address hidden> Wed, 14 May 2008 19:39:29 +0200

Changed in openjdk-6:
status: New → Fix Released
Changed in linux-ubuntu-modules-2.6.24:
assignee: nobody → colin-king
status: New → In Progress
Revision history for this message
Colin Ian King (colin-king) wrote :

Hi,

My current hypothesis is that this bug is caused because unionfs specific mmap'ing operations are not turned on, causing readlink() to operate on the mmap'd files outside of the unionfs, rather than the unionfs view of the file. I hope to get a fixed lum build in my PPA before long.

Colin

Revision history for this message
Colin Ian King (colin-king) wrote :

This bug occurs on a readlink() of /proc/self/exe - the kernel implements readlink() of /proc/pid/exe by getting the file from the first executable VMA. The path to the file is reconstructed and returned as the result. This does not identify the correct path on stackable file systems, such as unionfs, hence it's not a unionfs bug per se.

A patch for this does exist to fix the correct handling of /proc/self/exe, namely http://marc.info/?l=linux-mm-commits&m=120141116911711 however it is fairly intrusive - it modifies some of the more critical parts of the kernel and I believe it is not yet currently upstream, hence it's far too much of a risk to patch a stable release of Hardy and keep the kernel maintainable over the hardy LTS lifetime.

Revision history for this message
Loïc Minier (lool) wrote :

Colin, thanks a lot for your research; I'm not too surprized the problem was already known and the change is intrusive; I hope it will make it upstream soon, I understand why we wouldn't want a too intrusive patch in the Ubuntu tree before it's upstream -- especially not for hardy. Thanks for looking into it!

Changed in linux-ubuntu-modules-2.6.24:
status: In Progress → Won't Fix
Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Just fixing up the status to reflect we'll be keeping this open for Intrepid. Thanks.

Changed in linux:
importance: Undecided → Medium
status: Won't Fix → Triaged
Changed in openjdk-6:
status: New → Invalid
Changed in linux:
status: New → Won't Fix
Revision history for this message
Matthias Klose (doko) wrote :

no, we will fix this for hardy

Changed in openjdk-6:
status: Invalid → In Progress
Revision history for this message
Andreas Schildbach (schildbach) wrote :

I'm not sure if this is the same error, but I get

"Setting up openjdk-6-jre-headless (6b09-0ubuntu2) ...
/usr/lib/jvm/java-6-openjdk/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory"

when trying to install openjdk-6 in a Hardy chroot.

Revision history for this message
Max Bowsher (maxb) wrote :

Andreas: It sounds like you've not mounted /proc in your chroot. That's different from this bug, which is about a mounted /proc giving incorrect results when used with unionfs.

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

The Ubuntu Kernel Team is planning to move to the 2.6.27 kernel for the upcoming Intrepid Ibex 8.10 release. As a result, the kernel team would appreciate it if you could please test this newer 2.6.27 Ubuntu kernel. There are one of two ways you should be able to test:

1) If you are comfortable installing packages on your own, the linux-image-2.6.27-* package is currently available for you to install and test.

--or--

2) The upcoming Alpha5 for Intrepid Ibex 8.10 will contain this newer 2.6.27 Ubuntu kernel. Alpha5 is set to be released Thursday Sept 4. Please watch http://www.ubuntu.com/testing for Alpha5 to be announced. You should then be able to test via a LiveCD.

Please let us know immediately if this newer 2.6.27 kernel resolves the bug reported here or if the issue remains. More importantly, please open a new bug report for each new bug/regression introduced by the 2.6.27 kernel and tag the bug report with 'linux-2.6.27'. Also, please specifically note if the issue does or does not appear in the 2.6.26 kernel. Thanks again, we really appreicate your help and feedback.

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

the worharound is applied in the openjdk-6 package uploaded to hardy-proposed and now in hardy-updates.

Changed in openjdk-6:
status: In Progress → Fix Released
amygalloway89 (amy-731)
Changed in openjdk-6 (Ubuntu):
assignee: nobody → amygalloway89 (amy-731)
Revision history for this message
Max Bowsher (maxb) wrote :

Hi Amy,

I'm assuming you assigned this bug to yourself erroneously, and am reverting the change. If that is not the case, please be sure to leave an explanatory comment when assigning a bug.

Changed in openjdk-6 (Ubuntu):
assignee: amygalloway89 (amy-731) → nobody
Changed in linux (Ubuntu):
assignee: Colin King (colin-king) → nobody
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.