Menu

#994 transient toplevel windows crash 8.3.2

obsolete: 8.3.2
closed-fixed
nobody
5
2001-03-30
2001-03-16
Jeff Rogers
No

Initial Comment:
The following short script crashes tcl/tk 8.3.2 under windows 98

--- BEGIN SCRIPT ---
update idletasks
toplevel .foo
# update idletasks ;# <-- THIS WORKS AROUND
# set z 0
# button .foo.x -command {global z; set z 1;}
# pack .foo.x
wm transient .foo .
tkwait variable z
# exit
--- END SCRIPT ---

Setup:
I have verified this crash under Windows 98 with tcl 8.3.2 and 8.4a2. It does not crash 8.2.1.
I have received reports that it also crashes under Windows 2000 and Windows ME using 8.3.2.

Reproduction:

Save the script to a file named "something.tcl" and double click on that file from explorer
OR
Create a shortcut that runs "c:\path\to\wish83.exe something.tcl" and click on that shortcut

The crash only occurrs when this script is run directly via a shortcut or double-clicking a tcl file
directly; starting the wish interpreter first and source-ing or pasting the script will NOT cause the
crash.

Expected result:
As is, 2 windows should appear, one of which is transient.

The commented out lines are necessary for the script to be sane, but not for the crash.

Actual result:
Windows popup saying "This program has performed an illegal operation and will be shut down"

Additional information:
The indicated line will prevent the crash when uncommented.

The indicated line prevents the crash from occurring.

Discussion

  • Donal K. Fellows

    • labels: --> 68. Win Window Operations
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2001-03-30

    Logged In: YES
    user_id=72656

    You could also avoid the above problem by not having the
    first update. The problem is that . exists but .foo's
    internal window doesn't. I patched UpdateWrapper for this
    case (attached). Fixed in 8.4a2cvs.

    Also note in the above, by leaving a tkwait var (equivalent
    to vwait), the app won't exit fully when you close the '.'
    main window. It's like leaving a 'vwait forever' to make a
    tcl-based server. Always make sure those are handled upon
    exit.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2001-03-30
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2001-03-30
    • status: open --> closed-fixed