GNOME Bugzilla – Bug 687470
Deadlock in pangoxft-fontmap.c when closing an X connection
Last modified: 2012-11-13 20:13:38 UTC
Created attachment 227915 [details] [review] Patch to fix deadlock When trying to exit the Openbox window manager by running the openbox --exit command, it refuses to quit. A backtrace produced this:
+ Trace 231127
(Sorry, see https://bugzilla.redhat.com/show_bug.cgi?id=802086#c6 for one with debug symbols.) It seems that the close_display_cb() function that gets called when the X connection is closed calls pango_xft_shutdown_display() while holding a lock on the fontmaps. That function immediately calls pango_xft_find_font_map(), which itself tries to acquire a lock on the fontmaps, resulting in a deadlock. The attached patch seems to fix this.
Created attachment 227921 [details] A small program to demonstrate the problem
Comment on attachment 227921 [details] A small program to demonstrate the problem Here's a small program to demonstrate the bug. It should print "Closing display..." followed immediately by "Yay, display closed!", but the second one never gets printed as XCloseDisplay() can't return.
I can confirm this bug and also confirm that the patch fixes it.
This bug happens to me too.
Pushed a slightly different fix