#1867 wm stackorder panics

closed-fixed
7
2005-06-01
2005-02-27
No

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.

Discussion

  • Schelte Bron

    Schelte Bron - 2005-02-27
    • assigned_to: jenglish --> mdejong
     
  • Mo DeJong

    Mo DeJong - 2005-03-08

    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.

     
  • Mo DeJong

    Mo DeJong - 2005-03-08

    Patch to fix wm stackorder panic

     
  • Schelte Bron

    Schelte Bron - 2005-03-11

    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.

     
  • Mo DeJong

    Mo DeJong - 2005-04-07
    • status: open --> open-fixed
     
  • Mo DeJong

    Mo DeJong - 2005-04-07

    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.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-05-31

    Logged In: YES
    user_id=72656

    backport?

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-05-31
    • priority: 5 --> 7
     
  • Mo DeJong

    Mo DeJong - 2005-06-01
    • status: open-fixed --> closed-fixed
     
  • Mo DeJong

    Mo DeJong - 2005-06-01

    Logged In: YES
    user_id=90858

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