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 403255 - gdk_pixbuf_loader_close returns TRUE but sets *error
gdk_pixbuf_loader_close returns TRUE but sets *error
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 385641 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-02-01 16:09 UTC by Lucas Mazzardo Veloso
Modified: 2010-07-10 04:06 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
The tmp file with fake header (13.05 KB, application/octet-stream)
2007-02-01 16:11 UTC, Lucas Mazzardo Veloso
  Details
Check the 'error' var before trying to get the pixbuf (532 bytes, patch)
2007-02-01 16:21 UTC, Lucas Mazzardo Veloso
committed Details | Review

Description Lucas Mazzardo Veloso 2007-02-01 16:09:29 UTC
Steps to reproduce:
1. Grab the attached file
2. And browse for the folder where it was saved
 


Stack trace:
Distribution: Ubuntu 6.10 (edgy)
Gnome Release: 2.17.90 2007-01-25 (GARNOME)
BugBuddy Version: 2.17.3

System: Linux 2.6.17-10-386 #2 Tue Dec 5 22:26:18 UTC 2006 i686
X Vendor: The X.Org Foundation
X Vendor Release: 70101000
Selinux: No
Accessibility: Disabled

Memory status: size: 82972672 vsize: 0 resident: 82972672 share: 0 rss: 31895552 rss_rlim: 0
CPU usage: start_time: 1170338636 rtime: 0 utime: 182 stime: 0 cutime:163 cstime: 0 timeout: 19 it_real_value: 0 frequency: 0

Backtrace was generated from '/opt/gnome/bin/nautilus'

Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread -1227979088 (LWP 5699)]
0xffffe410 in __kernel_vsyscall ()

Thread 1 (Thread -1227979088 (LWP 5699))

  • #0 __kernel_vsyscall
  • #1 __waitpid_nocancel
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 libgnomeui_segv_handle
    at gnome-ui-init.c line 872
  • #3 <signal handler called>
  • #4 IA__g_logv
    at gmessages.c line 503
  • #5 IA__g_log
    at gmessages.c line 517
  • #6 IA__g_return_if_fail_warning
  • #7 IA__g_object_ref
    at gobject.c line 1714
  • #8 nautilus_thumbnail_load_image
    at nautilus-thumbnails.c line 400
  • #9 create_normal_cache_icon
    at nautilus-icon-factory.c line 1151
  • #10 nautilus_icon_factory_get_pixbuf_for_icon
    at nautilus-icon-factory.c line 1327
  • #11 nautilus_icon_container_update_icon
    at nautilus-icon-container.c line 5735
  • #12 nautilus_icon_container_request_update
    at nautilus-icon-container.c line 6053
  • #13 fm_icon_view_file_changed
    at fm-icon-view.c line 607
  • #14 nautilus_marshal_VOID__OBJECT_OBJECT
    at nautilus-marshal-guts.c line 469
  • #15 g_type_class_meta_marshal
    at gclosure.c line 567
  • #16 IA__g_closure_invoke
    at gclosure.c line 490
  • #17 signal_emit_unlocked_R
    at gsignal.c line 2478
  • #18 IA__g_signal_emit_valist
    at gsignal.c line 2199
  • #19 IA__g_signal_emit
    at gsignal.c line 2243
  • #20 display_pending_callback
    at fm-directory-view.c line 2803
  • #21 g_timeout_dispatch
    at gmain.c line 3422
  • #22 IA__g_main_context_dispatch
    at gmain.c line 2045
  • #23 g_main_context_iterate
    at gmain.c line 2677
  • #24 IA__g_main_loop_run
    at gmain.c line 2881
  • #25 IA__gtk_main
    at gtkmain.c line 1148
  • #26 main
    at nautilus-main.c line 548
  • #0 __kernel_vsyscall


----------- .xsession-errors (6 sec old) ---------------------
** Message: drive = 0
** Message: volume = 0
** Message: drive = 0
** Message: volume = 0
** Message: drive = 0
** Message: volume = 0
** Message: drive = 0
** Message: volume = 0
** Message: drive = 0
** Message: volume = 0
** Message: drive = 0
** Message: volume = 0
GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed
aborting...
--------------------------------------------------


Other information:
The file type returned by 'file' tool is :
$ file /tmp/tmp5f60d674.tmp
/tmp/tmp5f60d674.tmp: JPEG image data, JFIF standard 1.01

..although, this file header might be fake.
Gimp recognize it as an image but also can't open it.
Comment 1 Lucas Mazzardo Veloso 2007-02-01 16:11:48 UTC
Created attachment 81672 [details]
The tmp file with fake header
Comment 2 Lucas Mazzardo Veloso 2007-02-01 16:21:04 UTC
Created attachment 81673 [details] [review]
Check the 'error' var before trying to get the pixbuf

This patch seems to be a solution to this error.

Now nautilus outputs:

** Message: Failed load thumbnail image /tmp/tmp5f60d674.tmp: Error interpreting JPEG image file (Improper call to JPEG library in state 201)

without crashing anymore.
Comment 3 Alexander Larsson 2007-02-06 13:34:21 UTC
I did this instead:

-       if (!gdk_pixbuf_loader_close (loader, &error)) {
+       if (!gdk_pixbuf_loader_close (loader, &error) ||
+           /* Seems we have to check this even if it returned TRUE (#403255) */
+           error != NULL) {

But its strange, this seems like a bug in gdk_pixbuf_loader_close.
Comment 4 Matthias Clasen 2007-02-06 13:39:40 UTC
The only possibility I see for gdk_pixbuf_loader_close to return TRUE and set error is if the loader module is broken and does just that in its stop_load
function. We should probably protect against that.
Comment 5 Matthias Clasen 2007-02-06 14:00:21 UTC
2007-02-06  Matthias Clasen  <mclasen@redhat.com>

        * gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): Protect
        against stop_load begin broken.  (#403255, Lucas Mazzardo Veloso)

Comment 6 Christian Kirbach 2007-03-09 19:19:29 UTC
*** Bug 385641 has been marked as a duplicate of this bug. ***