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 596200 - Freeze using GNOME Shell
Freeze using GNOME Shell
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
trunk
Other Linux
: Normal major
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2009-09-24 15:23 UTC by Milan Bouchet-Valat
Modified: 2009-11-30 01:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdb trace of the freeze (159.21 KB, text/plain)
2009-09-24 15:25 UTC, Milan Bouchet-Valat
  Details
Fix handling of SIGCHLD (9.65 KB, patch)
2009-11-19 22:44 UTC, Dan Winship
committed Details | Review

Description Milan Bouchet-Valat 2009-09-24 15:23:20 UTC
I've been experiencing a freeze for some time when using GNOME Shell on the long run. No precise causes come to my mind. It may have been present since the beginning of the Shell, since I'm able to isolate this bug only because the Shell has become quite stable otherwise in recent weeks.

I think that's Mutter fault because in those cases, 'killall mutter' does not work, only using '-9' does. Then everything is working fine. The attached trace is before trying to kill mutter.
Comment 1 Milan Bouchet-Valat 2009-09-24 15:25:00 UTC
Created attachment 143919 [details]
gdb trace of the freeze
Comment 2 Dan Winship 2009-09-24 16:26:58 UTC
(In reply to comment #0)
> I think that's Mutter fault because in those cases, 'killall mutter' does not
> work, only using '-9' does.

Not relevant; gnome-shell is a module loaded into mutter; it can lock up the process just as easily as the mutter-specific code can.

But in fact, in this case it *is* a mutter bug, inherited from metacity; it's doing way too much in src/core/main.c:sigchld_handler, and in particular in your case, it ends up trying to lock a mutex that it already had locked outside the handler.
Comment 3 Milan Bouchet-Valat 2009-09-27 09:24:09 UTC
(In reply to comment #2)
> Not relevant; gnome-shell is a module loaded into mutter; it can lock up the
> process just as easily as the mutter-specific code can.
Yeah, I meant (Mutter+Shell), as opposed to being an X freeze or something.

> But in fact, in this case it *is* a mutter bug, inherited from metacity; it's
> doing way too much in src/core/main.c:sigchld_handler, and in particular in
> your case, it ends up trying to lock a mutex that it already had locked outside
> the handler.
So that would explain why base SIGTERM does not work. Though, as I said above, the attached trace is done *before* I sent the signal, since I had found those handlers in my first traces and I wanted to track the original bug.
Comment 4 Dan Winship 2009-11-19 22:44:17 UTC
Created attachment 148142 [details] [review]
Fix handling of SIGCHLD

The commit that removed metacity-dialog added a global SIGCHLD handler
that caused problems by (a) calling waitpid(-1) and thus breaking
g_child_watch for everyone else, and (b) doing too much from a signal
handler and sometimes causing deadlocks (bug 596200).

This removes the global handler and has each zenity user create its
own child watch to watch for exit. (It also fixes the window class of
the zenity dialogs, so that meta_window_present_delete_dialog() will
work again.)
Comment 5 Owen Taylor 2009-11-19 22:56:38 UTC
Review of attachment 148142 [details] [review]:

Looks great to me. (See bug 600864 for the SIGTERM side of the story, one several outstanding Metacity patches that needs to get committed to both Metacity and Mutter.)
Comment 6 Dan Winship 2009-11-20 16:17:04 UTC
Comment on attachment 148142 [details] [review]
Fix handling of SIGCHLD

Attachment 148142 [details] pushed as 988d2ff - Fix handling of SIGCHLD
Comment 7 Dan Winship 2009-11-20 16:20:27 UTC
Reassigning to metacity; the patch here won't apply cleanly, but it's mostly just a matter of s/mutter/metacity/ (or /meta/). (The bug also doesn't affect metacity as much as it does mutter, since metacity doesn't do as much launching stuff as gnome-shell does, but it's definitely still possible for metacity to deadlock when the force quit zenity dialog exits, because of the current SIGCHLD handler.)
Comment 8 Ray Strode [halfline] 2009-11-20 16:42:17 UTC
fixed in metacity master.
Comment 9 Frederic Peters 2009-11-26 14:44:55 UTC
Looks like there are some leftovers in include/util.h, removing those fixes the build for me.

/**
 * An object which exists purely to attach signals to; this is to receive
 * signals when a child process exits.  The signal is "sigchld" with no detail.
 */
extern MetaNexus *sigchld_nexus;