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 505085 - crash in Image Viewer: I opened file name.bmp, ...
crash in Image Viewer: I opened file name.bmp, ...
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other All
: High critical
: ---
Assigned To: gtk-bugs
gtk-bugs
: 479912 505449 510157 514068 517400 517810 520822 523550 536633 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-12-22 18:43 UTC by kus.seba
Modified: 2010-07-10 04:06 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
crashing file (6.81 KB, image/bmp)
2007-12-28 16:43 UTC, kus.seba
  Details
minimal test case (1.76 KB, text/x-csrc)
2008-01-08 20:16 UTC, Claudio Saavedra
  Details
correct one (1.92 KB, text/plain)
2008-01-08 20:24 UTC, Claudio Saavedra
  Details
add extra check before closing the loader (1.04 KB, patch)
2008-03-10 21:33 UTC, Claudio Saavedra
committed Details | Review
check the BMP magic number before decoding the header (788 bytes, patch)
2008-03-11 20:20 UTC, Claudio Saavedra
committed Details | Review

Description kus.seba 2007-12-22 18:43:09 UTC
Version: 2.20.3

What were you doing when the application crashed?
I opened file name.bmp, which probably is damage


Distribution: Debian lenny/sid
Gnome Release: 2.20.2 2007-11-29 (Debian)
BugBuddy Version: 2.20.1

System: Linux 2.6.23.1 #1 Fri Nov 9 13:57:47 CET 2007 i686
X Vendor: The X.Org Foundation
X Vendor Release: 10300000
Selinux: No
Accessibility: Disabled
GTK+ Theme: SphereCrystal
Icon Theme: Mist

Memory status: size: 45162496 vsize: 45162496 resident: 17293312 share: 12374016 rss: 17293312 rss_rlim: 4294967295
CPU usage: start_time: 1198348783 rtime: 48 utime: 38 stime: 10 cutime:0 cstime: 0 timeout: 0 it_real_value: 0 frequency: 100

Backtrace was generated from '/usr/bin/eog'

(no debugging symbols found)
Using host libthread_db library "/lib/i686/cmov/libthread_db.so.1".
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 0xb6c0f6c0 (LWP 7754)]
[New Thread 0x6efbdb90 (LWP 7756)]
[New Thread 0xb6a3fb90 (LWP 7755)]
0xffffe410 in __kernel_vsyscall ()

Thread 3 (Thread 0xb6a3fb90 (LWP 7755))

  • #0 __kernel_vsyscall
  • #1 waitpid
    from /lib/i686/cmov/libpthread.so.0
  • #2 IA__g_spawn_sync
    at /tmp/buildd/glib2.0-2.14.3/glib/gspawn.c line 369
  • #3 IA__g_spawn_command_line_sync
    at /tmp/buildd/glib2.0-2.14.3/glib/gspawn.c line 677
  • #4 ??
    from /usr/lib/gtk-2.0/modules/libgnomebreakpad.so
  • #5 <signal handler called>
  • #6 __kernel_vsyscall
  • #7 raise
    from /lib/i686/cmov/libc.so.6
  • #8 abort
    from /lib/i686/cmov/libc.so.6
  • #9 IA__g_logv
  • #10 IA__g_log
  • #11 IA__g_assert_warning
    at /tmp/buildd/glib2.0-2.14.3/glib/gmessages.c line 552
  • #12 eog_image_load
  • #13 eog_job_load_run
  • #14 ??
  • #15 ??
  • #16 ??
  • #17 ??
  • #18 ??
    at /tmp/buildd/glib2.0-2.14.3/gobject/gobject.c line 1924
  • #19 ??
  • #20 ??
  • #21 ??
  • #22 ??
    from /usr/lib/libglib-2.0.so.0
  • #23 ??
  • #24 ??
    from /lib/i686/cmov/libpthread.so.0
  • #25 ??
  • #26 g_thread_create_proxy
    at /tmp/buildd/glib2.0-2.14.3/glib/gthread.c line 635


----------- .xsession-errors ---------------------
Ostrzeżenie menedżera okien: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x2a00074 (Lista odtw)
Ostrzeżenie menedżera okien: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.
Ostrzeżenie menedżera okien: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x2a00074 (Lista odtw)
Ostrzeżenie menedżera okien: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.
amidi-plug(i_backend.c:i_backend_unload:164): unloading backend 'alsa'
amidi-plug(i_backend.c:i_backend_unload:167): backend 'alsa' unloaded
Unable to read from file:///media/Tmp/backup/win%20net%2024%20X.pbf, giving up.


Error opening - using the oggvorbis module.  The file may be corrupted.
ERROR: meta.c (179): wmf_header_read: this isn't a wmf file
** (gnome-cups-icon:7665): WARNING **: Could not start the printer tray icon, because the CUPS server could not be contacted.
EOG-ERROR **: file eog-image.c: line 1148 (eog_image_real_load): assertion failed: (priv->image != NULL)
aborting...
--------------------------------------------------
Comment 1 Felix Riemann 2007-12-25 13:24:26 UTC
Looks like the pixbuf loader is not setting the error correctly here (most probably a gdk-pixbuf bug then).

Could you please attach the BMP file that produces this crash (if possible/legal/allowed)?

Comment 2 Felix Riemann 2007-12-25 13:31:52 UTC
*** Bug 505449 has been marked as a duplicate of this bug. ***
Comment 3 kus.seba 2007-12-28 16:43:31 UTC
Created attachment 101740 [details]
crashing file 

I'm not sure if this is the same file but it make similar error (IMO)
Comment 4 Felix Riemann 2008-01-01 19:03:18 UTC
Confirming crasher.
Comment 5 Pedro Villavicencio 2008-01-08 18:53:42 UTC
there's a similar report in Ubuntu here: https://bugs.launchpad.net/eog/+bug/180779
Comment 6 Claudio Saavedra 2008-01-08 19:08:33 UTC
This looks like a duplicate of bug #479912.
Comment 7 Claudio Saavedra 2008-01-08 20:13:25 UTC
*** Bug 479912 has been marked as a duplicate of this bug. ***
Comment 8 Claudio Saavedra 2008-01-08 20:16:32 UTC
Created attachment 102417 [details]
minimal test case

This is a minimal program that does the same as EOG to load an image, and the assertion fails as well.
Comment 9 Claudio Saavedra 2008-01-08 20:24:04 UTC
Created attachment 102419 [details]
correct one

hm, previous program didn't close the pixbuf, this one does. And the assertion stsill fails.
Comment 10 Claudio Saavedra 2008-01-08 20:24:29 UTC
(I meant, it didn't close the loader)
Comment 11 Claudio Saavedra 2008-01-08 20:37:24 UTC
Moving to gtk+/gdk-pixbuf. From the documentation, if the loader, when closed doesn't return FALSE and an error, then loader.get_pixbuf () should return the pixbuf and not NULL.
Comment 12 Claudio Saavedra 2008-01-17 12:36:01 UTC
*** Bug 510157 has been marked as a duplicate of this bug. ***
Comment 13 Gianluca Borello 2008-02-04 10:04:08 UTC
*** Bug 514068 has been marked as a duplicate of this bug. ***
Comment 14 Felix Riemann 2008-02-21 11:25:48 UTC
*** Bug 517810 has been marked as a duplicate of this bug. ***
Comment 15 Felix Riemann 2008-02-29 20:31:14 UTC
*** Bug 517400 has been marked as a duplicate of this bug. ***
Comment 16 Felix Riemann 2008-02-29 20:44:53 UTC
FYI, Bug 517810 shows that renaming a JPG file to a BMP file is an easy way to create your own BMPs triggering this.
Comment 17 Felix Riemann 2008-03-07 18:09:28 UTC
*** Bug 520822 has been marked as a duplicate of this bug. ***
Comment 18 Claudio Saavedra 2008-03-10 21:33:15 UTC
Created attachment 107015 [details] [review]
add extra check before closing the loader

The problem seems to be that the loader doesn't check robustly the header, so on broken images, it may believe that it needs a lot of data before first decoding the header.

This patch doesn't address the issue of the bogus data, but makes sure that if the user closes the loader, and we are still reading the bmp header, then returns an error notifying that the BMP file has not enough data. This seems neccessary to me in any case.
Comment 19 Claudio Saavedra 2008-03-10 21:39:24 UTC
By the way, I'm afraid that there could be other stages during the bmp loading that should trigger the same warning though. Not exactly sure.
Comment 20 Claudio Saavedra 2008-03-11 20:20:18 UTC
Created attachment 107090 [details] [review]
check the BMP magic number before decoding the header

This is a different patch that checks the two first bytes of the header, before decoding. In a BMP, these bytes should correspond to 0x42 0x4D.[1]

[1] http://en.wikipedia.org/wiki/BMP_file_format#BMP_file_header
Comment 21 Matthias Clasen 2008-03-11 20:38:37 UTC
Please commit to the gtk-2-12 branch, too. Thanks
Comment 22 Claudio Saavedra 2008-03-11 21:08:24 UTC
Committed to both branches. I changed the string for the first patch to "Premature end-of-file encountered", to avoid adding a new string to the stable branch.

2008-03-11  Claudio Saavedra  <csaavedra@alumnos.utalca.cl>

	* io-bmp.c: (gdk_pixbuf__bmp_image_stop_load): Set a
	GDK_ERROR_CORRUPT_IMAGE error if the loader is closed while
	still reading the headers.  (#505085)

2008-03-11  Claudio Saavedra  <csaavedra@alumnos.utalca.cl>

        * io-bmp.c: (DecodeHeader): Check for the BMP header magic numbers
        before decoding it.  (#505085)
Comment 23 Gianluca Borello 2008-03-20 16:58:55 UTC
*** Bug 523550 has been marked as a duplicate of this bug. ***
Comment 24 Felix Riemann 2008-06-05 12:36:24 UTC
*** Bug 536633 has been marked as a duplicate of this bug. ***