wrong hardcoded path to libjpeg.so

Bug #195458 reported by pl4nkton
6
Affects Status Importance Assigned to Milestone
icedtea-java7 (Ubuntu)
Fix Released
Undecided
Unassigned
openjdk-6 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: icedtea-java7-jre

openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c

void *handle = dlopen("/usr/lib/libjpeg.so", RTLD_LAZY | RTLD_GLOBAL);
if (handle == NULL)
handle = dlopen("/usr/lib64/libjpeg.so", RTLD_LAZY | RTLD_GLOBAL);

 jpegstderror = (fn_jpegstderror)dlsym(handle, "jpeg_std_error");
 if (jpegstderror == NULL) {
 dlclose(handle);
 }

example:
crash at open download dialog

http://josm.openstreetmap.de/download/josm-latest.jar

Revision history for this message
pl4nkton (pl4nkton) wrote :
Revision history for this message
pl4nkton (pl4nkton) wrote :

icedtea is searching for /usr/lib/libjpeg.so or /usr/lib64/libjpeg.so but ubuntu brings libjpeg.so.62 / libjpeg.so.62.0.0
a symlink helped as workaround

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

Can you reproduce this in Hardy with openjdk-6-jre ?

Changed in icedtea-java7:
status: New → Incomplete
Revision history for this message
pl4nkton (pl4nkton) wrote :

No with openjdk it works.

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

Thanks for confirming, closing the issue as fixed.

Changed in icedtea-java7:
status: Incomplete → Fix Released
Revision history for this message
Christophe Pierret (cpierret) wrote :

Just reproduced the issue on openjdk-6 on Intrepid JeOS Server+tomcat6+JIRA.
I implemented the workaround:
sudo apt-get install libjpeg62
sudo ln -s /usr/lib/libjpeg.so.62 /usr/lib/libjpeg.so

And it fixed the crash I always got in Java_sun_awt_image_JPEGImageDecoder_initIDs/dlclose when trying to display thumbnails of Jpeg files for JIRA running on tomcat6 with java-6-openjdk.

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

> I implemented the workaround:
> sudo apt-get install libjpeg62

openjdk-6-jre depends on libjpeg62, so this is meaningless.

> sudo ln -s /usr/lib/libjpeg.so.62 /usr/lib/libjpeg.so

wrong:
$ grep -r 'dlopen.*jpeg' openjdk/openjdk/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c: void *handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);
openjdk/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c: void *handle = dlopen("libjpeg.so.62", RTLD_LAZY | RTLD_GLOBAL);

closing again.

Changed in openjdk-6:
status: New → Fix Released
Revision history for this message
Christophe Pierret (cpierret) wrote :

As far as I understand, openjdk-6-jre-headless is the default JRE package pulled in by tomcat6 on Intrepid JeOS Server, not openjdk-6-jre.
The "-headless" version does not have a dependency on libjpeg62, which very likely explains the dozens of crashes I got from the JVM running tomcat6 on my JeOS 8.10 server (under VMWare).

On intrepid, if I follow the dependencies, here is the path:
tomcat6=>jsvc=>libcommons-daemon-java=>default-jre-headless=>openjdk-6-jre-headless

Revision history for this message
Christophe Pierret (cpierret) wrote :

Do I need to create a new bug for ?
"openjdk-6-jre-headless should depend on libjpeg62"
Or can we reopen this one ?

Revision history for this message
Thierry Carrez (ttx) wrote :

Christophe: I would indeed open a separate bug since it is a very different problem than the one fixed here (a problem of headless vs full JRE dependencies rather than a problem of wrong hardcoded path)

Revision history for this message
Christophe Pierret (cpierret) wrote : Re: [Bug 195458] Re: wrong hardcoded path to libjpeg.so

Thierry Carrez a écrit :
> Christophe: I would indeed open a separate bug since it is a very
> different problem than the one fixed here (a problem of headless vs full
> JRE dependencies rather than a problem of wrong hardcoded path)
>
>
Thanks for the feedback, it's done.
https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/318383

I personally think that it is the same issue/bug.
The original issue should have been labeled "openJDK crashes JVM when
libjpeg cannot be found" even if the title is misleading "wrong
hardcoded path", changing the hardcoded path from libjpeg.so to
libjpeg62.so and adding a dependency on libjpeg62 in openjdk-6-jre was
the fix.
The dependency has been put in the wrong place, it should have been
open-jdk-6-jre-*headless*. IMHO, it is the same bug.
But developers are sensitive persons, and it was out for this reason
that I asked the question :-)
I basically don't care as long as someone fixes the issue and no other
person making a choice of going Ubuntu or Windows goes back to Windows
because of such bugs.
I decided to switch to Ubuntu Server from Windows for our prod JIRA
server and was very close to go back because of this bug (20 JVM crashes
a day does not make you confident about a system).

Best regards,
Christophe Pierret

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.