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 345707 - Trashes memory when trying to thumbnail this file
Trashes memory when trying to thumbnail this file
Status: RESOLVED FIXED
Product: libgnomeui
Classification: Deprecated
Component: general
2.15.x
Other All
: Normal normal
: future
Assigned To: Christian Neumair
libgnomeui maintainers
: 335792 349970 350509 350865 353479 (view as bug list)
Depends on:
Blocks: 350911
 
 
Reported: 2006-06-22 23:27 UTC by Fabio Bonelli
Modified: 2007-01-31 13:08 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Test program that also appears to trigger the bug (218 bytes, text/plain)
2006-06-24 13:41 UTC, palfrey
  Details
Proposed libgnomeui patch (571 bytes, patch)
2006-08-05 09:23 UTC, Christian Neumair
none Details | Review
possible solution (1.44 KB, patch)
2006-08-16 13:41 UTC, Kjartan Maraas
needs-work Details | Review

Description Fabio Bonelli 2006-06-22 23:27:10 UTC
Nautilus eats all the memory it can when you go in a directory containing this file:

http://href.dyndns.org/~fabio/totem.gif

until it gets killed by the kernel OOM killer.

Backtrace:
(gdb) thread apply all bt

Thread 1 (Thread -1224866112 (LWP 27294))

  • #0 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #1 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #2 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #3 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #4 nautilus_file_get_string_attribute
  • #5 egg_recent_item_unref
  • #6 eel_marshal_BOOLEAN__BOXED
    from /usr/lib/libeel-2.so.2
  • #7 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #8 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #9 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #10 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #11 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #12 eel_canvas_window_to_world
    from /usr/lib/libeel-2.so.2
  • #13 eel_canvas_c2w
    from /usr/lib/libeel-2.so.2
  • #14 _gtk_marshal_BOOLEAN__BOXED
    from /usr/lib/libgtk-x11-2.0.so.0
  • #15 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #16 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #17 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #18 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #19 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #20 gtk_widget_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #21 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #22 _gdk_events_queue
    from /usr/lib/libgdk-x11-2.0.so.0
  • #23 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #24 g_main_context_check
    from /usr/lib/libglib-2.0.so.0
  • #25 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #26 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #27 POA_Nautilus_MetafileFactory__fini
  • #28 __libc_start_main
    from /lib/tls/libc.so.6
  • #29 ??

Comment 1 palfrey 2006-06-24 13:41:17 UTC
Created attachment 67939 [details]
Test program that also appears to trigger the bug

This test program (compile as "gcc test.c `pkg-config gdk-2.0 --cflags --libs` -o test" and run as "test <image name>") also appears to cause the same bug.
Comment 2 palfrey 2006-06-24 13:43:00 UTC
(In reply to comment #1)
> Created an attachment (id=67939) [edit]
> Test program that also appears to trigger the bug
> 
> This test program (compile as "gcc test.c `pkg-config gdk-2.0 --cflags --libs`
> -o test" and run as "test <image name>") also appears to cause the same bug.

Oh, and incidentally this happens to point to this being a gdk-pixbuf issue (or possibly elsewhere in other libraries used by gdk-pixbuf) and not a nautilus issue.

Comment 3 Fabio Bonelli 2006-07-05 08:56:30 UTC
Thanks for your investigation Tom, reassigning.
Comment 4 Matthias Clasen 2006-07-05 14:14:48 UTC
Try with GTK+ 2.10. The gif loader has been changed to not load the full animation
if you only need the first frame.
Comment 5 Matthias Clasen 2006-07-05 16:25:13 UTC
If you still see the problem with 2.10, please reopen.
Comment 6 palfrey 2006-07-06 10:33:00 UTC
I've just tested against 2.10.0, and we're still in OOM territory (2.6.17 kernel if that makes any difference). Have you tried the test program I attached?
Comment 7 Fabio Bonelli 2006-07-06 22:42:02 UTC
Reopening based on the Tom's comments.
Comment 8 Christian Neumair 2006-08-05 09:20:53 UTC
This is a libgnomeui problem, reassigning.
Comment 9 Christian Neumair 2006-08-05 09:23:21 UTC
Created attachment 70248 [details] [review]
Proposed libgnomeui patch

The attached patch ensures that gnome_gdk_pixbuf_new_from_uri_at_scale stops shoveling data into memory when a pixbuf is available. This fixes the gif preview problems for me.
Comment 10 Christian Neumair 2006-08-05 09:26:07 UTC
Just to clarify: I do not claim that the attached test program WFM, but the original bug report is definitly a consequence of not using GdkPixbufLoader properly.
Comment 11 Christian Neumair 2006-08-05 09:31:56 UTC
Matthias: Maybe gdk_pixbuf_new_from_file_at_scale() should be patches in the same fashion? The code looks quite similar.
Comment 12 Christian Neumair 2006-08-05 09:36:00 UTC
*** Bug 349970 has been marked as a duplicate of this bug. ***
Comment 13 Kjartan Maraas 2006-08-10 08:48:54 UTC
Commited on HEAD.
Comment 14 Christian Neumair 2006-08-10 20:51:11 UTC
Matthias?
Comment 15 Fabio Bonelli 2006-08-11 19:39:00 UTC
*** Bug 350865 has been marked as a duplicate of this bug. ***
Comment 16 Fabio Bonelli 2006-08-11 20:44:52 UTC
*** Bug 350509 has been marked as a duplicate of this bug. ***
Comment 17 Matthias Clasen 2006-08-16 05:05:10 UTC
That patch is not correct and needs to be reverted.

The fact that loader_get_pixbuf returns non-NULL does not guarantee
that the first frame has been fully loaded. To correctly test that 
you need to do something like the following:

Get the animation from the loader
Create an iter for it
check that on_currently_loading_frame returns FALSE

Comment 18 Kjartan Maraas 2006-08-16 13:16:59 UTC
Ok, reverting.
Comment 19 Kjartan Maraas 2006-08-16 13:41:35 UTC
Created attachment 71015 [details] [review]
possible solution

Here's  something I cooked up with some help from matthias
Comment 20 Kjartan Maraas 2006-08-16 13:42:42 UTC
Please everyone test this with as many images/animations as possible to see if it breaks.
Comment 21 Kjartan Maraas 2006-08-25 11:24:15 UTC
Ok, I'll have to test it myself then I see :-)
Comment 22 Kjartan Maraas 2006-08-27 18:20:22 UTC
Seems like this didn't work out as planned. I still see nautilus eating memory like mad with the above. Could anyone else test and confirm that this is broken?
Comment 23 Pavel Šefránek 2006-09-19 16:57:38 UTC
*** Bug 353479 has been marked as a duplicate of this bug. ***
Comment 24 Pavel Šefránek 2006-09-23 21:46:22 UTC
(In reply to comment #20)
> Please everyone test this with as many images/animations as possible to see if
> it breaks.
> 
Take a look at my bug 353479
Comment 25 Kjartan Maraas 2006-12-02 13:11:37 UTC
*** Bug 335792 has been marked as a duplicate of this bug. ***
Comment 26 Christian Neumair 2007-01-06 20:07:25 UTC
Kjartan: This seems to work nicely with a few sample files I tested, for instance the attachment from bug 335752 (which is a possibly interesting bug report about GTK+ gdk-pixbuf/GIF).

Maybe you could attach a file where this fails?
Comment 27 Kjartan Maraas 2007-01-09 01:34:59 UTC
Did you try the one in the first comment in this report? If it fixes that for you I guess we should just commit it.
Comment 28 Kjartan Maraas 2007-01-31 13:08:12 UTC
It works for me so I commited it. I wonder what went wrong the last time I tried it.