JPEG2000 thumbnail causes browser to crash

Bug #427100 reported by Mike Waters
104
This bug affects 21 people
Affects Status Importance Assigned to Milestone
jasper (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Binary package hint: nautilus

Attached file was generated by the Meerkat Second Life viewer.

THe file is a "texture" file in JPEG2000 format. The file reads properly with the Meerkat viewer (Linux and Windows) and with IrfanView (Windows). Nautilus correctly lists this file unless the thumbnail function is enabled.

With thumbnail enabled Nautilus reads about 70% of the JPEG2000 files then crashes. No crash report is generated.

However the SECOND time that the file is listed the thumbnail works!

This is a problem since there are several hundred of these files in a directory.

I have been unable to find a validation tool for JPEG2000 to rule out format errors in the file itself.

I can supply many more examples of these files if it would help trace the problem!

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
ExecutablePath: /usr/bin/nautilus
NonfreeKernelModules: nvidia
Package: nautilus 1:2.26.2-0ubuntu2
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: nautilus
Uname: Linux 2.6.28-14-generic i686

Revision history for this message
Mike Waters (mikewatersaz) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please try to obtain a backtrace following the instructions at http://wiki.ubuntu.com/DebuggingProgramCrash and upload the backtrace (as an attachment) to the bug report. This will greatly help us in tracking down your problem.

Changed in nautilus (Ubuntu):
assignee: nobody → Ubuntu Desktop Bugs (desktop-bugs)
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Pedro Villavicencio (pedro) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to New. Thanks again!.

Changed in nautilus (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Orr Dvory (gnudles) wrote :

it also happens to me, after saving a file with blender in jpeg 2000 format.
error message:
cannot get header
nautilus: jp2_dec.c:294: jp2_decode: Assertion `iccprof' failed.
Aborted

Revision history for this message
Mike Waters (mikewatersaz) wrote : Re: [Bug 427100] Re: JPEG2000 thumbnail causes browser to crash

Unfortunately I was unable to get a crash dump so the bug report was closed.

Maybe you will be able to do better - this does seem to be a reasonably common bug.

--- On Sat, 10/24/09, Orr Dvory <email address hidden> wrote:

From: Orr Dvory <email address hidden>
Subject: [Bug 427100] Re: JPEG2000 thumbnail causes browser to crash
To: <email address hidden>
Date: Saturday, October 24, 2009, 11:34 PM

it also happens to me, after saving a file with blender in jpeg 2000 format.
error message:
cannot get header
nautilus: jp2_dec.c:294: jp2_decode: Assertion `iccprof' failed.
Aborted

--
JPEG2000 thumbnail causes browser to crash
https://bugs.launchpad.net/bugs/427100
You received this bug notification because you are a direct subscriber
of the bug.

Status in “nautilus” package in Ubuntu: Invalid

Bug description:
Binary package hint: nautilus

Attached file was generated by the Meerkat Second Life viewer.

THe file is a "texture" file in JPEG2000 format.  The file reads properly with the Meerkat viewer (Linux and Windows) and with IrfanView (Windows). Nautilus correctly lists this file unless the thumbnail function is enabled.

With thumbnail enabled Nautilus reads about 70% of the JPEG2000 files then crashes. No crash report is generated.

However the SECOND time that the file is listed the thumbnail works!

This is a problem since there are several hundred of these files in a directory.

I have been unable to find a validation tool for JPEG2000 to rule out format errors in the file itself.

I can supply many more examples of these files if it would help trace the problem!

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
ExecutablePath: /usr/bin/nautilus
NonfreeKernelModules: nvidia
Package: nautilus 1:2.26.2-0ubuntu2
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: nautilus
Uname: Linux 2.6.28-14-generic i686

Revision history for this message
Orr Dvory (gnudles) wrote :

I checked it again, nautilus crashes only on JPEG2000 images with alpha channel...

Revision history for this message
Orr Dvory (gnudles) wrote :

by the way, nautilus version is 1:2.28.1-0ubuntu1
it also causes firefox to crash when the image selected in a file select dialog.
the image is attached

Revision history for this message
Sebastien Bacher (seb128) wrote :

the issue is one in libjasper which is used for jpeg2000 reading

affects: nautilus (Ubuntu) → jasper (Ubuntu)
Changed in jasper (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody
status: Invalid → New
Revision history for this message
Mike Waters (mikewatersaz) wrote :

Some observations which may help:

1) All of the library "textures" have an alpha channel, but only a few cause this crash.

2) Irfanview (Windoews) flags the files which cause crashes as "improper channel number 5", but does not crash.

3) Once the crash occurs then all thumbnails including the desktop thumbnails do not display. (This is consistent with a library problem).

Revision history for this message
BuM (bumaw) wrote :

the problem is only 9.10 in the previous version of such problems was not I put a file which is a problem

http://launchpadlibrarian.net/34920743/relax.jp2

Revision history for this message
Mike Waters (mikewatersaz) wrote :

I am not sure just what your question intends to say.

I downloaded the example (Ubuntu 9.10) and Nautilus crashed, the Gnome Image Viewer also crashes. Irfanview running with Wine V1.1.32 shows the image with no problem.

The examples generated using the OpenMetaverse software are unchanged between 9.04 (original testing) and 9.10 they crash all Linux based image viewers (including the Icon view of Nautilus), but display using IrfanView under wine.

All of the files can be listed with Nautilus provided no Icons are displayed.

Does this answer your question?

Mike Waters

--- On Fri, 11/6/09, BuM <email address hidden> wrote:

From: BuM <email address hidden>
Subject: [Bug 427100] Re: JPEG2000 thumbnail causes browser to crash
To: <email address hidden>
Date: Friday, November 6, 2009, 8:52 AM

the problem is only 9.10 in the previous version of such problems was
not I put a file which is a problem

http://launchpadlibrarian.net/34920743/relax.jp2

--
JPEG2000 thumbnail causes browser to crash
https://bugs.launchpad.net/bugs/427100
You received this bug notification because you are a direct subscriber
of the bug.

Status in “jasper” package in Ubuntu: New

Bug description:
Binary package hint: nautilus

Attached file was generated by the Meerkat Second Life viewer.

THe file is a "texture" file in JPEG2000 format.  The file reads properly with the Meerkat viewer (Linux and Windows) and with IrfanView (Windows). Nautilus correctly lists this file unless the thumbnail function is enabled.

With thumbnail enabled Nautilus reads about 70% of the JPEG2000 files then crashes. No crash report is generated.

However the SECOND time that the file is listed the thumbnail works!

This is a problem since there are several hundred of these files in a directory.

I have been unable to find a validation tool for JPEG2000 to rule out format errors in the file itself.

I can supply many more examples of these files if it would help trace the problem!

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
ExecutablePath: /usr/bin/nautilus
NonfreeKernelModules: nvidia
Package: nautilus 1:2.26.2-0ubuntu2
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: nautilus
Uname: Linux 2.6.28-14-generic i686

Revision history for this message
matangdilis (matangdilis) wrote :

Affected me too as of today. Crashed nautilus when opening a folder with xxx.jp2 file rendered by blender.

Revision history for this message
Stian Soiland-Reyes (soiland-reyes) wrote :

Also occurs in 10.04, using http://www.fnordware.com/j2k/relax.jp2 downloaded from http://www.fnordware.com/j2k/jp2samples.html

gdb does not give any stack trace, but ~/.xsession-errors says:

Initializing nautilus-dropbox 0.6.1
Initializing nautilus-gdu extension
Nautilus-Share-Message: Called "net usershare info" but it failed: 'net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error No such file or directory
Please ask your system administrator to enable user sharing.

ICC Profile CS 52474220
nautilus: jp2_dec.c:299: jp2_decode: Assertion `dec->image->cmprof_' failed.

Revision history for this message
Stian Soiland-Reyes (soiland-reyes) wrote :

My error message matches the one in #475488 - for a bit of extra fun, use a browser like Chromium who prefers to save downloads to ~/Desktop, this will cause Nautilus to go in an infinite loop, blanking and restarting the desktop.

Perhaps assertion failures in jp2_decode should just give a blank preview instead of crashing the file browser. If you rename to .jpeg the problem persists, but rename to .txt or disable previews and everything is fine again.

Revision history for this message
Sebastien Bacher (seb128) wrote :

the issue is a libjasper one not a nautilus one

Changed in nautilus (Ubuntu):
importance: Undecided → Low
status: New → Invalid
Revision history for this message
thandermax (aniruddha-aot) wrote :

Happend to me today for a specific folder.

Similar stack trace:
May 9 20:13:17 ubuntu kernel: [ 326.119672] nautilus[3492]: segfault at 7fd5638b3000 ip 00007fd561cec414 sp 00007fd56389b1c0 error 6 in libjasper.so.1.0.0[7fd561cc5000+4c000]
May 9 20:13:30 ubuntu kernel: [ 338.825941] nautilus[3622]: segfault at 7effebe981c0 ip 00007effea798414 sp 00007effebe981c0 error 6 in libjasper.so.1.0.0[7effea771000+4c000]
May 9 20:14:02 ubuntu kernel: [ 371.400333] nautilus[3830]: segfault at 7f0c87f941c0 ip 00007f0c87b53414 sp 00007f0c87f941c0 error 6 in libjasper.so.1.0.0[7f0c87b2c000+4c000]
May 9 20:14:24 ubuntu kernel: [ 392.837835] nautilus[3956]: segfault at 7f63c40791c0 ip 00007f63c219d414 sp 00007f63c40791c0 error 6 in libjasper.so.1.0.0[7f63c2176000+4c000]

It happend while I opened my old Windows partition's folder (having a symbolic link to it, it might not be linked).
The folder contains a large no of items (mostly documents, images, pdf etc)

Somehow the libJasper failed to parse the image/icon of those items.

Its very sporadic error, happening only on that folder (in my case).
Stacktrace points to same offset : 4c000

Platform: Linux ubuntu 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
Nautilus 2.32.2.1

Anybody need more information on this ?

Revision history for this message
iSingle (river-dolphin) wrote :

same problem here.

OS:ubuntu 11.10 64bit

comfire that nautilus crashes when browsing an .jp2 file , delete the .jp2 file and everything goes fine.

Revision history for this message
iSingle (river-dolphin) wrote :

crash log in system log :

nautilus[14640]: segfault at 7fb993fa0000 ip 00007fb993b4b414 sp 00007fb993f9ff50 error 6 in libjasper.so.1.0.0[7fb993b24000+4c000]

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

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

Changed in jasper (Ubuntu):
status: New → Confirmed
Revision history for this message
soulpatrol (soulpatrol1) wrote :

I have the same problem: Ubuntu 11.04 64-bit, Nautilus 2.32.2.1. Nautilus crashes every time I enter a directory with a .jp2 file. BTW my .jp2 files are 48-bit color depth.

Revision history for this message
Timmmm (tdhutt) wrote :

Wow, I remember finding this bug yeaaars ago and it still isn't fixed! Anyway, the bug is in libjasper. I downloaded the latest version, and here is what the "jasper" tool says:

$ ./jasper --input untitled.jp2 --output untitled.bmp --output-format bmp
cannot get header
jasper: jp2_dec.c:294: jp2_decode: Assertion `iccprof' failed.
Aborted (core dumped)

Terribly bad form for a library to call abort(). I haven't done any testing, but my image does have an alpha channel, which agrees with previous comments.

Revision history for this message
Timmmm (tdhutt) wrote :
Download full text (3.2 KiB)

Here is the code in question:

 switch (dec->colr->data.colr.method) {
 case JP2_COLR_ENUM:
  jas_image_setclrspc(dec->image, jp2_getcs(&dec->colr->data.colr));
  break;
 case JP2_COLR_ICC:
  iccprof = jas_iccprof_createfrombuf(dec->colr->data.colr.iccp,
    dec->colr->data.colr.iccplen);
  assert(iccprof);
  jas_iccprof_gethdr(iccprof, &icchdr);
  jas_eprintf("ICC Profile CS %08x\n", icchdr.colorspc);
  jas_image_setclrspc(dec->image, fromiccpcs(icchdr.colorspc));
  dec->image->cmprof_ = jas_cmprof_createfromiccprof(iccprof);
  assert(dec->image->cmprof_);
  jas_iccprof_destroy(iccprof);
  break;
 }

And in base/jas_icc.c:

jas_iccprof_t *jas_iccprof_createfrombuf(uchar *buf, int len)
{
 jas_stream_t *in;
 jas_iccprof_t *prof;
 if (!(in = jas_stream_memopen(JAS_CAST(char *, buf), len)))
  goto error;
 if (!(prof = jas_iccprof_load(in)))
  goto error;
 jas_stream_close(in);
 return prof;
error:
 return 0;
}

And I'm guessing the problem is in jas_iccprof_load():

jas_iccprof_t *jas_iccprof_load(jas_stream_t *in)
{
 jas_iccprof_t *prof;
 int numtags;
 long curoff;
 long reloff;
 long prevoff;
 jas_iccsig_t type;
 jas_iccattrval_t *attrval;
 jas_iccattrval_t *prevattrval;
 jas_icctagtabent_t *tagtabent;
 jas_iccattrvalinfo_t *attrvalinfo;
 int i;
 int len;

 prof = 0;
 attrval = 0;

 if (!(prof = jas_iccprof_create())) {
  goto error;
 }

 if (jas_iccprof_readhdr(in, &prof->hdr)) {
  jas_eprintf("cannot get header\n");
  goto error;
 }

.. Looks familiar. jas_iccprof_readhdr():

static int jas_iccprof_readhdr(jas_stream_t *in, jas_icchdr_t *hdr)
{
 if (jas_iccgetuint32(in, &hdr->size) ||
   jas_iccgetuint32(in, &hdr->cmmtype) ||
   jas_iccgetuint32(in, &hdr->version) ||
   jas_iccgetuint32(in, &hdr->clas) ||
   jas_iccgetuint32(in, &hdr->colorspc) ||
   jas_iccgetuint32(in, &hdr->refcolorspc) ||
   jas_iccgettime(in, &hdr->ctime) ||
   jas_iccgetuint32(in, &hdr->magic) ||
   jas_iccgetuint32(in, &hdr->platform) ||
   jas_iccgetuint32(in, &hdr->flags) ||
   jas_iccgetuint32(in, &hdr->maker) ||
   jas_iccgetuint32(in, &hdr->model) ||
   jas_iccgetuint64(in, &hdr->attr) ||
   jas_iccgetuint32(in, &hdr->intent) ||
   jas_iccgetxyz(in, &hdr->illum) ||
   jas_iccgetuint32(in, &hdr->creator) ||
   jas_stream_gobble(in, 44) != 44)
  return -1;
 return 0;
}

So I added some debug traces, and the problem is that jas_stream_gobble() returns 0, not 44. Here is the function, complete with silly backwards loop.

int jas_stream_gobble(jas_stream_t *stream, int n)
{
 int m;
 m = n;
 for (m = n; m > 0; --m) {
  if (jas_stream_getc(stream) == EOF) {
   return n - m;
  }
 }
 return n;
}

Since it doesn't seem to use the expected 44 bytes of this header, I tried removing the check. Note that when writing the equivalent icc profile, it does add 44 padding bytes, so someone hasn't read the spec properly... (i.e. either the padding is optional or it isn't and the file is invalid). Anyway, libjasper should never abort(), that is just plain wrong (and dangerous).

Sadly removing the check just shifts us to the error "cannot get tab table". Ok, that's all I have for now. Somebody is going to have to read the spec and see where libjasper is going wrong. And also remove...

Read more...

Revision history for this message
dasher (dasher-laseek) wrote :

bt:
0x00007fffebb8ef84 in jpc_qmfb_join_colgrp () from /usr/lib/x86_64-linux-gnu/libjasper.so.1
(gdb) bt
#0 0x00007fffebb8ef84 in jpc_qmfb_join_colgrp () from /usr/lib/x86_64-linux-gnu/libjasper.so.1
#1 0x00007fffebb924b6 in jpc_ns_synthesize () from /usr/lib/x86_64-linux-gnu/libjasper.so.1
#2 0x00007fffebb9c82f in jpc_tsfb_synthesize2 () from /usr/lib/x86_64-linux-gnu/libjasper.so.1
#3 0x00007fffebb9c890 in jpc_tsfb_synthesize () from /usr/lib/x86_64-linux-gnu/libjasper.so.1
#4 0x00007fffebb8506e in ?? () from /usr/lib/x86_64-linux-gnu/libjasper.so.1
#5 0x00007fffebb87738 in ?? () from /usr/lib/x86_64-linux-gnu/libjasper.so.1
#6 0x00007fffebb86b4d in jpc_decode () from /usr/lib/x86_64-linux-gnu/libjasper.so.1
#7 0x00007fffebb803f8 in jp2_decode () from /usr/lib/x86_64-linux-gnu/libjasper.so.1
#8 0x00007fffebb7527d in jas_image_decode () from /usr/lib/x86_64-linux-gnu/libjasper.so.1
#9 0x00007fffebddaf1d in ?? () from /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jasper.so
#10 0x00007ffff5972caa in gdk_pixbuf_loader_close () from /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
#11 0x00007ffff77a891a in ?? () from /usr/lib/libgnome-desktop-3.so.4
#12 0x00007ffff77a8e52 in gnome_desktop_thumbnail_factory_generate_thumbnail () from /usr/lib/libgnome-desktop-3.so.4
#13 0x00000000004e509b in ?? ()
#14 0x00007ffff463df8e in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#15 0x00007ffff4367e1d in clone () from /lib/x86_64-linux-gnu/libc.so.6

Revision history for this message
Paul Whipp (paul-whipp) wrote :

This is still an issue in 14.04 where Nautilus consistently crashes if I open any folders containing JP2000 scanned book pages (jp2 file extension). The eog viewer succeeds in viewing them and in creating thumbnails.

Revision history for this message
Anthony Wild (awild) wrote :

There's a very simple workaround for this. Change the preferences for the file browser (Nautilus) as per following...

Open the file browser
Click on Edit | Preferences
Click on the Preview tab
Change the option for "Other Previewable Files" to Never

It then displays fine without crashing

Revision history for this message
Pascal Mons (anton+) wrote :

There is definitely a problem with Nautilus and only with Nautilus. No need to make jasper shoulder the GNOME responsibility.

On Ubuntu Trusty 14.04 I have installed both Marlin and Nautilus / Nemo.

Marlin has no problem previewing JPEG 2000 thumbnails in .j2k or .jp2 format.

However Nautilus [3.10] / Nemo (both) are constantly crashing. e.g. nautilus crashed with SIGSEGV in jpc_qmfb_join_colgrp()

On the command line running jasper is working fine too (Cevennes2.jpg is coming right from the official website http://www.openjpeg.org/index.php?menu=samples)

$ jasper --input Cevennes2.jp2 --output Cevennes2-bis.bmp --output-format bmp

When will Nautilus behave appropriately for JPEG 2000 thumnbails ? This is dating for years ...

madbiologist (me-again)
tags: added: jaunty
madbiologist (me-again)
tags: added: karmic lucid natty oneiric
tags: added: trusty
Revision history for this message
Markus Majer (mpathy) wrote :

You can add the tag "vivid"..
The bug still exists in Ubuntu 15.04!

Please fix it, because it also can used for other bad things besides just crashing Nautilus:
http://www.ubuntu.com/usn/usn-1315-1/

Here my dmesg output:
[ 9415.337774] nautilus[11166]: segfault at 7f4d50c5c540 ip 00007f4d28a3701c sp 00007f4d50c5c530 error 7 in libjasper.so.1.0.0[7f4d28a10000+4c000]
[ 9666.642346] nautilus[11391]: segfault at 7f01295a4540 ip 00007f00f39ca01c sp 00007f01295a4530 error 6 in libjasper.so.1.0.0[7f00f39a3000+4c000]
[ 9685.330281] nautilus[11438]: segfault at 7f778a096540 ip 00007f7789c9301c sp 00007f778a096530 error 6 in libjasper.so.1.0.0[7f7789c6c000+4c000]
[11242.749456] nautilus[14785]: segfault at 7f7f29a9b540 ip 00007f7f0064201c sp 00007f7f29a9b530 error 6 in libjasper.so.1.0.0[7f7f0061b000+4c000]
[11373.131440] nautilus[14976]: segfault at 7fca7d85f430 ip 00007fca5c3c601c sp 00007fca7d85f420 error 6 in libjasper.so.1.0.0[7fca5c39f000+4c000]

I can also confirm that it affects JPEG2000 files with transparency.

I had a hard time to figure out the problem and extract the file that was the reason.
I moved it to a seperate folder with the console and opened it again, and it crashed every time changing in that folder.
Opening the file with GIMP or EOG, started from the console, it was no problem to display it.

Revision history for this message
gronki (gronki) wrote :

I can confirm it on latest Fedora + Gnome SHELL.

Revision history for this message
LaunchpadLoginDefectReport (nagle-1) wrote :

Still failing intermittently on 14.04 LTS updated to current as of two days ago. I have directories full of images such as

http://chroniclingamerica.loc.gov/lccn/sn88084272/1911-07-22/ed-1/seq-24.jp2

which are high-resolution scans of old newspapers from the Library of Congress.

When it works correctly, the file icon shows a clock "wait" icon while a thumbnail is being generated from the 9MB greyscale image. Doing something with the folder during thumbnail generation breaks something, and the file browser then crashes whenever the folder is opened.

The Nautilus crash dump should have already been automatically uploaded to Ubuntu.

Revision history for this message
LaunchpadLoginDefectReport (nagle-1) wrote :

Workaround: In Nautilus preferences, set the maximum size of files for which icons are generated to 5MB. The newspaper images are all above 9MB but smaller than 10MB.

Mathew Hodson (mhodson)
no longer affects: nautilus (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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