After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 474710 - eog crashes when you try to open this .jpg file (it works fine on Vista/XP)
eog crashes when you try to open this .jpg file (it works fine on Vista/XP)
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
git master
Other All
: Normal critical
: ---
Assigned To: EOG Maintainers
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-09-07 23:27 UTC by Martin Olsson
Modified: 2007-09-10 02:58 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
patch (1.41 KB, patch)
2007-09-08 17:03 UTC, Claudio Saavedra
none Details | Review
take the XMP case into consideration (untested with XMP files) (2.94 KB, patch)
2007-09-08 18:52 UTC, Claudio Saavedra
committed Details | Review

Description Martin Olsson 2007-09-07 23:27:33 UTC
Steps to reproduce:
1. open the attached .jpg file in EOG
2. sigsegv
3. no profit

Stack trace:


Other information:
Comment 1 Martin Olsson 2007-09-07 23:35:59 UTC
I could not attach the file because it's 2.7MB and bugzilla allows max 1MB for attachments. My shell where I usually publish files seems to be down at the moment.
Comment 2 Martin Olsson 2007-09-07 23:36:57 UTC
Here is the stacktrace:

[New Thread -1226901840 (LWP 23791)]
[New Thread -1228223600 (LWP 23794)]
[New Thread -1250952304 (LWP 23795)]
/bin/sh: /usr/bin/esd: not found

Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 23794)

  • #0 ??
  • #1 jpeg_read_scanlines
    from /usr/lib/libjpeg.so.62
  • #2 gdk_pixbuf__jpeg_image_load_lines
    at /build/buildd/gtk+2.0-2.11.6/gdk-pixbuf/io-jpeg.c line 736
  • #3 gdk_pixbuf__jpeg_image_load_increment
    at /build/buildd/gtk+2.0-2.11.6/gdk-pixbuf/io-jpeg.c line 956
  • #4 gdk_pixbuf_loader_write
    from /usr/lib/libgdk_pixbuf-2.0.so.0
  • #5 eog_image_load
    at eog-image.c line 1016
  • #6 eog_job_load_run
    at eog-jobs.c line 290
  • #7 eog_render_thread
    at eog-job-queue.c line 78
  • #8 ??
    from /usr/lib/libglib-2.0.so.0
  • #9 ??


Comment 3 Claudio Saavedra 2007-09-07 23:46:19 UTC
Could you please send me the image privately?
Comment 4 Martin Olsson 2007-09-07 23:51:57 UTC
I managed to upload the image now:
http://mnemo.minimum.se/bild_tagen_med_wonks_d200_macro.jpg
Comment 5 Claudio Saavedra 2007-09-08 00:52:59 UTC
Confirming. This can be reproduced with trunk, but not with 2.18. Seems like related with the loader.
Comment 6 Claudio Saavedra 2007-09-08 03:36:02 UTC
Other stacktrace I get:

(gdb) back
  • #0 memcpy
    from /lib/i686/cmov/libc.so.6
  • #1 eog_metadata_reader_consume
    at eog-metadata-reader.c line 322
  • #2 eog_image_real_load
    at eog-image.c line 1053
  • #3 eog_image_load
    at eog-image.c line 1221
  • #4 eog_job_load_run
    at eog-jobs.c line 290
  • #5 handle_job
    at eog-job-queue.c line 78
  • #6 eog_render_thread
    at eog-job-queue.c line 148
  • #7 g_thread_create_proxy
    at gthread.c line 635
  • #8 start_thread
    from /lib/i686/cmov/libpthread.so.0
  • #9 clone
    from /lib/i686/cmov/libc.so.6

It looks like corruption somewhere...
Comment 7 Claudio Saavedra 2007-09-08 05:17:23 UTC
It seems this is a regression after Hubert's work on XMP metadata (bug #451101). Revision 3889 doesn't crash with that image, and revision 3890 does.

I'm not sure yet why this image triggers this issue. Martin, what's special about this image?

Adding Hubert to the CC list.
Comment 8 Claudio Saavedra 2007-09-08 05:19:56 UTC
By the way, running eog with EOG_DEBUG_IMAGE_DATA=1, outputs the following (removing some output for readability):

claudio@dijkstra:~/svn/gnome-2.20/eog$ EOG_DEBUG_IMAGE_DATA=1  eog bild_tagen_med_wonks_d200_macro.jpg 
eog-image.c:427 (check_for_metadata_img_format) Check image format for jpeg: ffd8 - length: 65535
eog-metadata-reader.c:205 (eog_metadata_reader_consume) APPx Marker Found: e1
eog-metadata-reader.c:262 (eog_metadata_reader_consume) Read APP1 data, Length: 65532
eog-metadata-reader.c:319 (eog_metadata_reader_consume) Read continuation of EXIF data, length: 3
eog-metadata-reader.c:319 (eog_metadata_reader_consume) Read continuation of EXIF data, length: -65532
eog-metadata-reader.c:319 (eog_metadata_reader_consume) Read continuation of EXIF data, length: -131067
Comment 9 Martin Olsson 2007-09-08 08:54:18 UTC
Concerning what's special with this JPG... it's taken with a Nikon D200 camera and it hasn't been edited in some program yet (it comes directly from the camera). Maybe the D200 has some special EXIF block that triggers the bug?
Comment 10 Claudio Saavedra 2007-09-08 17:03:03 UTC
Created attachment 95179 [details] [review]
patch

This patch seems to correctly read the exif bunch when it's size is smaller than the buffer read.

In the particular case of that image, priv->size == 3, and len == 64kB, so it makes no sense to copy the whole buffer, but only the next three bytes.
Comment 11 Martin Olsson 2007-09-08 17:34:09 UTC
I've applied this patch to trunk and it works for me, it also works to open another .jpg taken with the same camera (this image also caused a crash before). I also took a .JPG shoot with my Nikon D50 and that opens just fine with correct EXIF etc.
Comment 12 Claudio Saavedra 2007-09-08 18:52:21 UTC
Created attachment 95183 [details] [review]
take the XMP case into consideration (untested with XMP files)

I suspect similar issues may arise with the XMP reader. This patch would take care of that. I also think the code should be factored out to a helper function, because it's the same bunch over and over again, only changing the destination chunk and the state.
Comment 13 Claudio Saavedra 2007-09-08 19:15:28 UTC
(In reply to comment #12)
>I also think the code should be factored out to a helper
> function, because it's the same bunch over and over again, only changing the
> destination chunk and the state.

I opened bug #474931 with a patch to factor out the code.

Comment 14 Hubert Figuiere (:hub) 2007-09-08 22:57:57 UTC
The second patch works fine with me including with images I have with XMP.

Thanks cluadio.
Comment 15 Lucas Rocha 2007-09-09 21:24:07 UTC
Claudio, the patch is ok. Go on and commit. Thanks!
Comment 16 Claudio Saavedra 2007-09-10 02:58:36 UTC
Fixed in trunk (rev. 4071). Martin, Hub, Lucas: Thank you all!

2007-09-09  Claudio Saavedra  <csaavedra@alumnos.utalca.cl>

        * src/eog-metadata-reader.c: (eog_metadata_reader_consume): Copy only 
        the remaining bytes of EXIF/XMP data if these are smaller than the 
        buffer that's being consumed. Fixes bug #474710.