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 420249 - deadlock on print operation
deadlock on print operation
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.11.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-03-19 19:39 UTC by Christian Persch
Modified: 2007-06-12 03:12 UTC
See Also:
GNOME target: 2.20.x
GNOME version: 2.19/2.20



Description Christian Persch 2007-03-19 19:39:16 UTC
Steps to reproduce:
0) eog test.png
1) File->Print

Results:
Deadlock.

(gdb) where
  • #0 __kernel_vsyscall
  • #1 __lll_mutex_lock_wait
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 _L_mutex_lock_49
    from /lib/tls/i686/cmov/libpthread.so.0
  • #3 ??
  • #4 g_source_destroy_internal
    at gmain.c line 975
  • #5 gdk_threads_impl_lock
    at gdk.c line 384
  • #6 gdk_event_prepare
    at gdkevents-x11.c line 2275
  • #7 g_main_context_prepare
    at gmain.c line 2381
  • #8 g_main_context_iterate
    at gmain.c line 2674
  • #9 g_main_loop_run
    at gmain.c line 2898
  • #10 gtk_dialog_run
    at gtkdialog.c line 996
  • #11 _gtk_print_operation_platform_backend_run_dialog
    at gtkprintoperation-unix.c line 723
  • #12 gtk_print_operation_run
    at gtkprintoperation.c line 2418
  • #13 eog_window_cmd_print
    at eog-window.c line 2149


This is eog svn trunk with glib/gtk+ svn trunk. It works as expected using gtk 2.10/glib 2.12, so this is probably a gtk or glib bug.
Comment 1 Claudio Saavedra 2007-05-03 19:42:27 UTC
I can reproduce it with trunk. It seems to happen while the custom widget is added to the print dialog. It may be something with the custom widget. I'll check it when I have time.
Comment 2 Felix Riemann 2007-05-28 15:21:26 UTC
Opening page settings dialog produces this too.
Comment 3 Claudio Saavedra 2007-05-29 04:06:48 UTC
I forgot to write about it, but a while ago I checked disabling completely the custom widget, and it still happens, so it's not related to that.
Comment 4 Felix Riemann 2007-05-30 19:40:25 UTC
I traced the GDK_THREADS_ENTER/LEAVE calls and found two locks without an unlock inbetween:

1.Lock: 

  • #0 gdk_threads_impl_lock
    at gdk.c line 387
  • #1 cups_request_printer_list
    at gtkprintbackendcups.c line 1230
  • #2 cups_dispatch_watch_dispatch
    at gtkprintbackendcups.c line 595
  • #3 IA__g_main_context_dispatch
    at gmain.c line 2061
  • #4 g_main_context_iterate
    at gmain.c line 2694
  • #5 IA__g_main_loop_run
    at gmain.c line 2898
  • #6 IA__gtk_dialog_run
    at gtkdialog.c line 996
  • #7 IA__gtk_print_run_page_setup_dialog
    at gtkprintoperation-unix.c line 855
  • #8 eog_window_cmd_page_setup
    at eog-window.c line 2005
  • #9 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #10 IA__g_closure_invoke
    at gclosure.c line 490
  • #11 signal_emit_unlocked_R
  • #12 IA__g_signal_emit_valist
    at gsignal.c line 2199
  • #13 IA__g_signal_emit
    at gsignal.c line 2243
  • #14 _gtk_action_emit_activate
    at gtkaction.c line 844
  • #0 gdk_threads_impl_lock
    at gdk.c line 387
  • #1 gdk_event_prepare
    at gdkevents-x11.c line 2275
  • #2 IA__g_main_context_prepare
    at gmain.c line 2381
  • #3 g_main_context_iterate
    at gmain.c line 2674
  • #4 IA__g_main_loop_run
    at gmain.c line 2898
  • #5 IA__gtk_dialog_run
    at gtkdialog.c line 996
  • #6 IA__gtk_print_run_page_setup_dialog
    at gtkprintoperation-unix.c line 855
  • #7 eog_window_cmd_page_setup
    at eog-window.c line 2005
  • #8 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #9 IA__g_closure_invoke
    at gclosure.c line 490
  • #10 signal_emit_unlocked_R
    at gsignal.c line 2440
  • #11 IA__g_signal_emit_valist
  • #12 IA__g_signal_emit
    at gsignal.c line 2243
  • #13 _gtk_action_emit_activate
    at gtkaction.c line 844
  • #14 IA__gtk_action_activate
    at gtkaction.c line 871



I cut the traces at 15 frames to keep it readable in my console.


I am not sure if that is a bug in GTK+ or if it is a fault in our code (which did't show up before).
Comment 5 Christian Persch 2007-05-30 20:39:01 UTC
I guess this is a gtk bug then.
Comment 6 Claudio Saavedra 2007-06-07 05:44:11 UTC
On Thu, 2007-06-07 at 01:19 -0400, Matthias Clasen wrote:
> gdk_threads_add_idle
> gdk_threads_add_idle_full
> gdk_threads_add_timeout
> gdk_threads_add_timeout_full
> Better support for thread-safe handling of idles and timeouts. This set
> of functions avoids race conditions in the handling of user data passed
> to a callback that is run in a different thread. All uses of callbacks in
> GTK+ have been converted to these functions. 

Could it be possible that this bug is related to those GDK changes? Matthias?
Comment 7 Claudio Saavedra 2007-06-07 05:49:51 UTC
Setting target to 2.20 as GTK+ 2.12 will be used in the upcoming GNOME release.
Comment 8 Matthias Clasen 2007-06-12 02:12:06 UTC
Please try with current gtk+ svn trunk, I have fixed some locking issues in print backends.
Comment 9 Claudio Saavedra 2007-06-12 03:12:43 UTC
It's fixed. Thanks Matthias.