Tk Source Code

View Ticket
Login
Ticket UUID: 1152809
Title: wm stackorder panics
Type: Bug Version: None
Submitter: sbron Created on: 2005-02-27 09:30:59
Subsystem: 67. Unix Window Operations Assigned To: mdejong
Priority: 7 High Severity:
Status: Closed Last Modified: 2005-06-01 07:08:21
Resolution: Fixed Closed By: mdejong
    Closed on: 2005-06-01 00:08:21
Description:
The TkWmStackorderToplevel function in unix/tkUnixWm.c
seems to incorrectly calculate the number of toplevels
when they are displayed on different displays. This
results in the message "num matched toplevel windows
does not equal num children" and then wish aborts.

Script to reproduce the situation:

# wish -display :0
% toplevel .x -screen :1
.x
% wm stackorder .
num matched toplevel windows does not equal num children
Aborted

In a conversation on the Tcler's chat Joe English
remarked the following about this:
The point where it's panicking looks to me like it's
not really an error condition at all (let alone a fatal
one) -- More like "I'm making an assumption about what
the state of the system should be, and crashing hard if
that assumption isn't true". But in this case the
assumption in question (a) doesn't always hold and
probably (b) doesn't even need to hold for the code to
work.
User Comments: mdejong added on 2005-06-01 07:08:21:
Logged In: YES 
user_id=90858

Check fix into 8.4 branch on 2005-05-31.

hobbs added on 2005-06-01 01:33:30:
Logged In: YES 
user_id=72656

backport?

mdejong added on 2005-04-08 03:15:39:
Logged In: YES 
user_id=90858

Fixed in CVS by  checkin on 2005-04-07. Will back port to
8.4 in a bit if I don't hear any complaints about the CVS
version.

sbron added on 2005-03-11 19:59:20:
Logged In: YES 
user_id=37987

I didn't have any problem applying the patch against Tk 8.4.9.
My testing showed no sign of the bug anymore.

mdejong added on 2005-03-08 13:35:11:

File Added - 124577: display.patch

mdejong added on 2005-03-08 13:35:10:
Logged In: YES 
user_id=90858

Could you test out the following patch. It was created on
the HEAD
but it should work with Tcl 8.4 as well. The patch just
limits the
matched toplevel wrappers to toplevels on the same display
as the
parent window that is passed in.

Attachments: