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 96928 - Crash when closing windows
Crash when closing windows
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
unspecified
Other Linux
: Normal major
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
: 97231 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-10-26 20:28 UTC by Kjartan Maraas
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.0


Attachments
stack trace (10.83 KB, text/plain)
2002-10-26 20:28 UTC, Kjartan Maraas
  Details
patch to prevent crash on window close (744 bytes, patch)
2002-10-27 12:32 UTC, Martin Garton
none Details | Review

Description Kjartan Maraas 2002-10-26 20:28:17 UTC
I got tired of the random crashes in metacity when closing windows and sat
down and got you this nice backtrace of it :)

It's the 2.1.x stuff, but I think the bug is still in the 2.0.x branches too.

Attaching backtrace.
Comment 1 Kjartan Maraas 2002-10-26 20:28:48 UTC
Created attachment 11858 [details]
stack trace
Comment 2 Havoc Pennington 2002-10-26 21:45:10 UTC
Thanks, hrm. Note there's already a bug about this with a couple other
backtraces, both of which are different. So I think it may be one of
those horrible memory corruption thingies. You might want to try a 
MALLOC_CHECK_=2 backtrace, just to see.

For completeness, what theme are you using?

If you run "metacity/src/wm-tester/wm-tester --evil" does that crash 
it for you? It doesn't seem to for me.

However, if the crash is related to the code in your backtrace, it
would only crash in cases where we have windows transient for one
another, such as dialogs. Maybe I'll enhance wm-tester --evil to 
do that.
Comment 3 Havoc Pennington 2002-10-26 21:56:01 UTC
I added transiency to wm-tester, still doesn't crash it for me.

Perhaps it's related to focus mode? GTK version?
Comment 4 Kjartan Maraas 2002-10-26 22:30:33 UTC
This is with the 2.1.x stuff from CVS today.
Comment 5 Martin Garton 2002-10-27 12:31:58 UTC
I think I have the same problem.
When the crash occurs, on entering add_constraint() the value of
below->stack_position is -1, hence the segfault when trying to address
element -1 of the array.

This indicates that the group window is not in the metacity stack, but
is in the group window list. How or why this happens or whether it is
valid is beyond me, but the attached patch (against current cvs)
"fixes" it.
Comment 6 Martin Garton 2002-10-27 12:32:37 UTC
Created attachment 11867 [details] [review]
patch to prevent crash on window close
Comment 7 Martin Garton 2002-10-27 12:40:12 UTC
after slightly more testing, it seems my patch is almost certainly
bogus. it does fix the "crash on close" I was getting, but causes much
more serious problems.  Back to staring at code for a while ...
Comment 8 Martin Garton 2002-10-27 14:07:21 UTC
Okay last comment for today or else I risk flooding ppls mailboxes.

I now believe my patch does indeed fix the crash without introducing
any new problems but there is still something wrong. (see below)

Further information:

This bug does not seem to exist in the version of metacity shipped
with redhat 8.0

The application I use to most easily reproduce this is "grustibus"
from http://grustibus.sourceforge.net/
Run the app, press the preferences button, select the "list settings"
tab, press the font prompt button to open the font selection window.
Now upon closing the font selection window metacity will crash.
My patch fixes this, but the font window appears behind the prefs
window in the stack.  With sawfish, twm, and the rh8 metacity, is it
in front of the prefs window.

Comment 9 Havoc Pennington 2002-10-27 14:45:08 UTC
Ah, good catch. The root problem here I think is calling
meta_window_shutdown_group() so late in meta_window_free(), 
it should probably be moved much earlier, so a mostly-destroyed 
window doesn't remain in the group.

I just put in a patch that tries fixing it that way. See if it 
works...
Comment 10 Martin Garton 2002-10-27 17:26:21 UTC
Thanks. That looks like the proper fix, and works with my example.

The stacking issue mentioned above still exists though, but it's
clearly a seperate problem. I will try to understand if it could be an
application bug and if it still seems like a problem, I'll raise
another bug. (and if I understand it enough, perhaps even fix it :)

IMO, this can be closed now.
Comment 11 Kjartan Maraas 2002-10-27 19:28:48 UTC
Works for me with ggv on 2.1.x too. Closing. Thanks for the quick fix.
Comment 12 Heath Harrelson 2002-10-30 15:43:14 UTC
*** Bug 97231 has been marked as a duplicate of this bug. ***