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 350569 - eog won't quit
eog won't quit
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
git master
Other Linux
: Urgent blocker
: ---
Assigned To: Sven Herzberg
EOG Maintainers
: 350115 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-08-09 11:44 UTC by Wouter Bolsterlee (uws)
Modified: 2006-09-04 18:07 UTC
See Also:
GNOME target: 2.16.x
GNOME version: 2.15/2.16


Attachments
Proposed Patch (970 bytes, patch)
2006-09-04 15:58 UTC, Sven Herzberg
none Details | Review

Description Wouter Bolsterlee (uws) 2006-08-09 11:44:33 UTC
Eog won't quit after I viewed an image with it.

1. Open eog by running "eog" from a terminal
2. Close eog

Now all works fine.

1. Open eog by running "eog" from a terminal
2. Open an image/directory (eg. from recently opened files list)
3. Close eog

Now eog starts eating 100% CPU and the window doesn't close. After a while, metacity asks me if it should kill the window because it is not responding.

Note that there's no output on the terminal window.
Comment 1 Wouter Bolsterlee (uws) 2006-08-09 11:46:03 UTC
Running gdb on eog and interrupting during the 100% CPU usage gives me this (not sure if it's useful all):

elin:~ > gdb eog
GNU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run
Starting program: /opt/gnome-2-16/bin/eog 
[Thread debugging using libthread_db enabled]
[New Thread -1227368768 (LWP 15334)]
[New Thread -1234310224 (LWP 15337)]
[New Thread -1244619856 (LWP 15338)]

Program received signal SIGINT, Interrupt.
[Switching to Thread -1227368768 (LWP 15334)]
IA__g_type_check_instance_is_a (type_instance=0x82afa40, iface_type=20)
    at gtype.c:3113
3113      check = node && node->is_instantiatable && iface && type_node_conforms_to_U (node, iface, TRUE, FALSE);
(gdb) thread apply all bt

Thread 1 (Thread -1227368768 (LWP 15334))

  • #0 IA__g_type_check_instance_is_a
    at gtype.c line 3113
  • #1 IA__g_object_run_dispose
    at gobject.c line 567
  • #2 IA__gtk_object_destroy
    at gtkobject.c line 403
  • #3 gnome_canvas_group_destroy
  • #4 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #5 g_type_class_meta_marshal
    at gclosure.c line 567
  • #6 IA__g_closure_invoke
    at gclosure.c line 490
  • #7 signal_emit_unlocked_R
    at gsignal.c line 2554
  • #8 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #9 IA__g_signal_emit
    at gsignal.c line 2241
  • #10 gtk_object_dispose
    at gtkobject.c line 418
  • #11 gnome_canvas_item_dispose
    at gnome-canvas.c line 352
  • #12 IA__g_object_run_dispose
    at gobject.c line 571
  • #13 IA__gtk_object_destroy
    at gtkobject.c line 403
  • #14 gnome_canvas_group_destroy
    at gnome-canvas.c line 1527
  • #15 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #16 g_type_class_meta_marshal
    at gclosure.c line 567
  • #17 IA__g_closure_invoke
    at gclosure.c line 490
  • #18 signal_emit_unlocked_R
    at gsignal.c line 2554
  • #19 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #20 IA__g_signal_emit
    at gsignal.c line 2241
  • #21 gtk_object_dispose
    at gtkobject.c line 418
  • #22 gnome_canvas_item_dispose
    at gnome-canvas.c line 352
  • #23 IA__g_object_run_dispose
    at gobject.c line 571
  • #24 IA__gtk_object_destroy
    at gtkobject.c line 403
  • #25 gnome_canvas_destroy
    at gnome-canvas.c line 2181
  • #26 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #27 g_type_class_meta_marshal
    at gclosure.c line 567
  • #28 IA__g_closure_invoke
    at gclosure.c line 490
  • #29 signal_emit_unlocked_R
    at gsignal.c line 2554
  • #30 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #31 IA__g_signal_emit
    at gsignal.c line 2241
  • #32 gtk_object_dispose
    at gtkobject.c line 418
  • #33 gtk_widget_dispose
    at gtkwidget.c line 6873
  • #34 IA__g_object_run_dispose
    at gobject.c line 571
  • #35 IA__gtk_object_destroy
    at gtkobject.c line 403
  • #36 IA__gtk_widget_destroy
    at gtkwidget.c line 2158
  • #37 gtk_bin_forall
    at gtkbin.c line 133
  • #38 gtk_scrolled_window_forall
    at gtkscrolledwindow.c line 986
  • #39 IA__gtk_container_foreach
    at gtkcontainer.c line 1288
  • #40 gtk_container_destroy
    at gtkcontainer.c line 825
  • #41 gtk_scrolled_window_destroy
    at gtkscrolledwindow.c line 780
  • #42 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #43 g_type_class_meta_marshal
    at gclosure.c line 567
  • #44 IA__g_closure_invoke
    at gclosure.c line 490
  • #45 signal_emit_unlocked_R
  • #46 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #47 IA__g_signal_emit
    at gsignal.c line 2241
  • #48 gtk_object_dispose
    at gtkobject.c line 418
  • #49 gtk_widget_dispose
    at gtkwidget.c line 6873
  • #50 IA__g_object_run_dispose
    at gobject.c line 571
  • #51 IA__gtk_object_destroy
    at gtkobject.c line 403
  • #52 IA__gtk_widget_destroy
    at gtkwidget.c line 2158
  • #53 gtk_paned_forall
    at gtkpaned.c line 1066
  • #54 IA__gtk_container_foreach
    at gtkcontainer.c line 1288
  • #55 gtk_container_destroy
    at gtkcontainer.c line 825
  • #56 IA__g_cclosure_marshal_VOID__VOID
  • #57 g_type_class_meta_marshal
    at gclosure.c line 567
  • #58 IA__g_closure_invoke
    at gclosure.c line 490
  • #59 signal_emit_unlocked_R
    at gsignal.c line 2554
  • #60 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #61 IA__g_signal_emit
    at gsignal.c line 2241
  • #62 gtk_object_dispose
    at gtkobject.c line 418
  • #63 gtk_widget_dispose
    at gtkwidget.c line 6873
  • #64 IA__g_object_run_dispose
    at gobject.c line 571
  • #65 IA__gtk_object_destroy
    at gtkobject.c line 403
  • #66 IA__gtk_widget_destroy
    at gtkwidget.c line 2158
  • #67 gtk_box_forall
  • #68 IA__gtk_container_foreach
    at gtkcontainer.c line 1288
  • #69 gtk_container_destroy
    at gtkcontainer.c line 825
  • #70 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #71 g_type_class_meta_marshal
    at gclosure.c line 567
  • #72 IA__g_closure_invoke
    at gclosure.c line 490
  • #73 signal_emit_unlocked_R
    at gsignal.c line 2554
  • #74 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #75 IA__g_signal_emit
  • #76 gtk_object_dispose
    at gtkobject.c line 418
  • #77 gtk_widget_dispose
    at gtkwidget.c line 6873
  • #78 IA__g_object_run_dispose
    at gobject.c line 571
  • #79 IA__gtk_object_destroy
    at gtkobject.c line 403
  • #80 IA__gtk_widget_destroy
    at gtkwidget.c line 2158
  • #81 gtk_bin_forall
    at gtkbin.c line 133
  • #82 IA__gtk_container_foreach
    at gtkcontainer.c line 1288
  • #83 gtk_container_destroy
    at gtkcontainer.c line 825
  • #84 gtk_window_destroy
    at gtkwindow.c line 3954
  • #85 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #86 g_type_class_meta_marshal
    at gclosure.c line 567
  • #87 IA__g_closure_invoke
    at gclosure.c line 490
  • #88 signal_emit_unlocked_R
    at gsignal.c line 2554
  • #89 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #90 IA__g_signal_emit
    at gsignal.c line 2241
  • #91 gtk_object_dispose
    at gtkobject.c line 418
  • #92 gtk_widget_dispose
    at gtkwidget.c line 6873
  • #93 gtk_window_dispose
    at gtkwindow.c line 1794
  • #94 IA__g_object_run_dispose
    at gobject.c line 571
  • #95 IA__gtk_object_destroy
    at gtkobject.c line 403
  • #96 IA__gtk_widget_destroy
    at gtkwidget.c line 2158
  • #97 eog_window_close
    at eog-window.c line 3839
  • #98 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #99 IA__g_closure_invoke
    at gclosure.c line 490
  • #100 signal_emit_unlocked_R
    at gsignal.c line 2438
  • #101 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #102 IA__g_signal_emit
    at gsignal.c line 2241
  • #103 _gtk_action_emit_activate
    at gtkaction.c line 835
  • #104 IA__gtk_action_activate
    at gtkaction.c line 862
  • #105 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #106 IA__g_closure_invoke
    at gclosure.c line 490
  • #107 signal_emit_unlocked_R
    at gsignal.c line 2438
  • #108 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #109 IA__g_signal_emit
    at gsignal.c line 2241
  • #110 IA__gtk_widget_activate
    at gtkwidget.c line 3932
  • #111 IA__gtk_menu_shell_activate_item
    at gtkmenushell.c line 1024
  • #112 gtk_menu_shell_button_release
    at gtkmenushell.c line 630
  • #113 gtk_menu_button_release
    at gtkmenu.c line 2619
  • #114 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 83
  • #115 g_type_class_meta_marshal
    at gclosure.c line 567
  • #116 IA__g_closure_invoke
    at gclosure.c line 490
  • #117 signal_emit_unlocked_R
    at gsignal.c line 2476
  • #118 IA__g_signal_emit_valist
  • #119 IA__g_signal_emit
    at gsignal.c line 2241
  • #120 gtk_widget_event_internal
    at gtkwidget.c line 3901
  • #121 IA__gtk_propagate_event
    at gtkmain.c line 2187
  • #122 IA__gtk_main_do_event
    at gtkmain.c line 1421
  • #123 gdk_event_dispatch
    at gdkevents-x11.c line 2320
  • #124 IA__g_main_context_dispatch
    at gmain.c line 2043
  • #125 g_main_context_iterate
    at gmain.c line 2675
  • #126 IA__g_main_loop_run
    at gmain.c line 2879
  • #127 IA__gtk_main
    at gtkmain.c line 1000
  • #128 main
    at main.c line 636

Comment 2 Wouter Bolsterlee (uws) 2006-08-09 11:47:03 UTC
strace -p $(pidof eog)  while eog is eating 100% cpu gives no output, btw.
Comment 3 Claudio Saavedra 2006-08-10 00:16:11 UTC
*** Bug 350115 has been marked as a duplicate of this bug. ***
Comment 4 Claudio Saavedra 2006-08-10 00:17:37 UTC
From bug 350115:

"Opened by Brent Smith (smitten) (reporter, developer, points: 18)
2006-08-06 04:08 UTC [reply]

I haven't been able to pin down exactly when this happens, but with CVS HEAD,
eog seems to occassionally hang when trying to close it from the X in the
titlebar.  I did an strace and managed to reproduce it:

Here are the last lines from the strace output before it hangs:

poll([{fd=6, events=POLLIN}, {fd=11, events=POLLIN|POLLPRI, revents=POLLIN},
{fd=12, events=POLLIN|POLLPRI}, {fd=13, events=POLLIN|POLLPRI}], 4, -1) = 1
read(11, "GIOP\1\2\1\1$\0\0\0", 12)     = 12
read(11, "p]\322\277\0\0\0\0\1\0\0\0\1\0\0\0\f\0\0\0\1\1\1\1\1\0"..., 36) = 36
gettimeofday({1154837164, 998841}, NULL) = 0
gettimeofday({1154837165, 3500}, NULL)  = 0
gettimeofday({1154837165, 18857}, NULL) = 0
gettimeofday({1154837165, 21849}, NULL) = 0
gettimeofday({1154837165, 24521}, NULL) = 0
munmap(0xb46dd000, 1376256)             = 0
"
Comment 5 Wouter Bolsterlee (uws) 2006-08-11 09:07:24 UTC
Increasing severity... eog is unusable
Comment 6 Christian Kirbach 2006-09-03 20:00:32 UTC
I can see this as well with cvs head

(gdb) bt full
  • #0 IA__gtk_object_get_type
    at gtkobject.c line 80
  • #1 IA__gtk_object_destroy
    at gtkobject.c line 400
  • #2 gnome_canvas_group_destroy
    at gnome-canvas.c line 1527
  • #3 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #4 g_type_class_meta_marshal
    at gclosure.c line 567
  • #5 IA__g_closure_invoke
    at gclosure.c line 490

Comment 7 Wouter Bolsterlee (uws) 2006-09-03 21:47:20 UTC
Increasing severity
Comment 8 Felix Riemann 2006-09-04 10:31:01 UTC
Is it possible that you have a modified libgnomecanvas?
Because I can only produce it with a libgnomecanvas from CVS.
The problem is the following commit (which I think produces an infinite loop):
http://cvs.gnome.org/viewcvs/libgnomecanvas/libgnomecanvas/gnome-canvas.c?r1=1.176&r2=1.177


I cannot reproduce it using a stock libgnomecanvas-2.14.0.
Comment 9 Christian Kirbach 2006-09-04 12:49:47 UTC
what is the relevance of the last question? three people could reproduce with cvs head. and the reporter is using 2.15 as it seems.

I can see ultimate CPU usage as well which definitely means we have some kind of infinite loop.
Comment 10 Lucas Rocha 2006-09-04 13:18:02 UTC
Reverting the commit cited on comment #8 fixes the problem. This is actually a libgnomecanvas bug. Adding Herzi to CC.
Comment 11 Wouter Bolsterlee (uws) 2006-09-04 15:12:30 UTC
Yes, I run all my libraries from HEAD...
Comment 12 Sven Herzberg 2006-09-04 15:47:49 UTC
The commit listed in #8 is clean. If Gnome Canvas breaks there, it looks like a reference counting bug (some piece of code keeps a reference on a GnomeCanvas item so it doesn't get disposed).

Hints:
1. reproduce this bug
2. attach with gdb
3. set a break point on gnome_canvas_group_destroy()
4. enter "continue" (return) to resume eog
5. wait for the break point
6. check for the class that this item belongs to
7. kill eog

And then there's 2 ways to go:
-- THE UGLY --
8. start eog from a gdb instance
9. add a conditional breakpoint on g_object_ref() and g_object_unref() with a condition on the parameter (so you get any reference change reported on objects of that class).
10. check which reference is leaked by stepping through the app

-- THE GOOD --
8. check manually for each reference on the class
AND
9. make sure you also g_signal_connect(item, "destroy", g_object_unref, NULL);
(replace unref by your custom cleanup function if necessary)
Comment 13 Sven Herzberg 2006-09-04 15:58:31 UTC
Created attachment 72208 [details] [review]
Proposed Patch

Found I think that's the reason. May I commit?
Comment 14 Sven Herzberg 2006-09-04 16:00:24 UTC
That fix is quite obvious. You should ask the release team for approval to get this patch into eog 2.16.0.1 and release 2.16.0.1 with GNOME 2.16.
Comment 15 Christian Kirbach 2006-09-04 16:31:46 UTC
the suggested fix works well for me, I haven't seen a regression so far.
Comment 16 Tim Janik 2006-09-04 17:19:13 UTC
(In reply to comment #10)
> Reverting the commit cited on comment #8 fixes the problem. This is actually a
> libgnomecanvas bug. Adding Herzi to CC.

this is not a libgnomecanvas bug, the correct libgnomecanvas fix just exposes a sever bug in the eog canvas item implementations (which could have bee ntriggered under other scenarios as well).

(In reply to comment #12)
> The commit listed in #8 is clean. If Gnome Canvas breaks there, it looks like
> a reference counting bug (some piece of code keeps a reference on a
> GnomeCanvas item so it doesn't get disposed).

this is not the case. but note that even if there was a dangling ref count on a canvas item, the item would just be leaked. item->::dispose is run regardless, this is ensured by the call to gtk_object_destroy() in:
http://cvs.gnome.org/viewcvs/libgnomecanvas/libgnomecanvas/gnome-canvas.c?r1=1.176&r2=1.177

(In reply to comment #13)
> Created an attachment (id=72208) [edit]
> Proposed Patch
> Found I think that's the reason. May I commit?

this is definitely the right fix, failing to chain up from dispose or finalize is a severe bug in any GObject implementation. and as far as the canvas is concerned, an endless loop in gnome_canvas_group_destroy() is one of the logical outcomes of such an implementation bug (well spotted sven).
Comment 17 Lucas Rocha 2006-09-04 18:07:41 UTC
Applied! Thanks for the patch, Sven! 

Tim, this (oooold) gnome-canvas-based code can be considered obsolete as we already re-implemented the thumbnail pane based on GtkIconView in eog-ng branch. Thanks for your comments anyway. :-)

2006-09-04  Lucas Rocha  <lucasr@gnome.org>

        * libeog/eog-canvas-pixbuf.c: fix infinite loop on canvas
        destruction (Fixes bug #350569). Patch from Sven
        Herzberg <herzi@gnome-de.org>.