I've been trying to track down a problem where an application (gramps) written in python using GTK occasionally locks up when closing a dialog.

The immediate symptom is that hitting causes the application to lock up with the CPU spinning and strace revealing that it is looping being told there are X events to process but them not being processed.

Investigation with a debugger has shown that the problem is that gdkdisplay is not handling the events because _gdk_display_pause_events has been called and has paused event handling.

In turn that has happened because gdkwindow has received a flush-events signal, so gdk_window_flush_events has paused event handling and asked the frame clock to resume when it is ready. The resume-events signal never arrives however and hence event handling remains paused.

Moving up it turns out the the reason gdkframeclockidle.c never sends the resume-events signal is that it is destroyed (because the associated window is closed) before gdk_frame_clock_paint_idle runs and gets a change to resume the events.

I'm attaching a stack trace from the point where the frame clock is destroyed, showing the trace back to the OK button handler in the python code. My environment is:

  Gramps 4.1.1
  Python 3.4.1
  Python GObject 3.14.0
  GTK 3.14.6
  GLib 1.2.10

The question is, am I looking at a bug in GTK here (in that it needs to handle the case where a frame clock is destroyed with a resume still pending) or should that not be possible if GTK is used correctly, in which case there is presumably an error in the way Gramps is using the GTK API that is triggering this?

Tom

--
Tom Hughes (t...@compton.nu)
http://compton.nu/
#0  0x00007fffe7167e83 in gdk_frame_clock_idle_dispose (object=0x45048a0 
[GdkFrameClockIdle]) at gdkframeclockidle.c:137
#1  0x00007fffe8d01719 in g_object_run_dispose (object=0x45048a0 
[GdkFrameClockIdle]) at gobject.c:1076
#2  0x00007fffe7175444 in _gdk_window_destroy_hierarchy (window=0x5d06120 
[GdkX11Window], recursing=0, recursing_native=0, foreign_destroy=0) at 
gdkwindow.c:1944
#3  0x00007fffe717584f in gdk_window_destroy (window=0x5d06120 [GdkX11Window]) 
at gdkwindow.c:2045
#4  0x00007fffe7740687 in gtk_widget_real_unrealize (widget=0x5dc7a40 
[GtkDialog]) at gtkwidget.c:12272
#5  0x00007fffe774f875 in gtk_window_unrealize (widget=0x5dc7a40 [GtkDialog]) 
at gtkwindow.c:7147
#6  0x00007fffe8cfad35 in g_closure_invoke (closure=closure@entry=0x9c5810, 
return_value=return_value@entry=0x0, n_param_values=1, 
param_values=param_values@entry=0x7fffffffad20, 
invocation_hint=invocation_hint@entry=0x7fffffffacc0) at gclosure.c:768
#7  0x00007fffe8d0c93a in signal_emit_unlocked_R (node=node@entry=0x9c5840, 
detail=detail@entry=0, instance=instance@entry=0x5dc7a40, 
emission_return=emission_return@entry=0x0, 
instance_and_params=instance_and_params@entry=0x7fffffffad20) at gsignal.c:3591
#8  0x00007fffe8d15181 in g_signal_emit_valist (instance=<optimized out>, 
signal_id=<optimized out>, detail=<optimized out>, 
var_args=var_args@entry=0x7fffffffaea0) at gsignal.c:3309
#9  0x00007fffe8d153af in <emit signal ??? on instance 0x5dc7a40 [GtkDialog]> 
(instance=instance@entry=0x5dc7a40, signal_id=<optimized out>, 
detail=detail@entry=0) at gsignal.c:3365
#10 0x00007fffe77412c8 in gtk_widget_unrealize (widget=0x5dc7a40 [GtkDialog]) 
at gtkwidget.c:5572
#11 0x00007fffe7747478 in gtk_widget_dispose (object=0x5dc7a40 [GtkDialog]) at 
gtkwidget.c:11919
#12 0x00007fffe7750ca9 in gtk_window_dispose (object=0x5dc7a40 [GtkDialog]) at 
gtkwindow.c:2956
#13 0x00007fffe8d01719 in g_object_run_dispose (object=0x5dc7a40 [GtkDialog]) 
at gobject.c:1076
GrampsWindowManager#close_item 
/usr/lib/python3.4/site-packages/gramps/gui/managedwindow.py:183
GrampsWindowManager#recursive_action 
/usr/lib/python3.4/site-packages/gramps/gui/managedwindow.py:176
GrampsWindowManager#close_track 
/usr/lib/python3.4/site-packages/gramps/gui/managedwindow.py:153
ManagedWindow#close 
/usr/lib/python3.4/site-packages/gramps/gui/managedwindow.py:517
EditReference#close at 
/usr/lib/python3.4/site-packages/gramps/gui/editors/editreference.py:229
EditEventRef#ok_clicked at 
/usr/lib/python3.4/site-packages/gramps/gui/editors/editeventref.py:259
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to