Tk Source Code

View Ticket
Login
Ticket UUID: 409172
Title: transient toplevel windows crash 8.3.2
Type: Bug Version: obsolete: 8.3.2
Submitter: dvrsn Created on: 2001-03-16 16:59:27
Subsystem: 68. Win Window Operations Assigned To: nobody
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2001-03-31 02:56:32
Resolution: Fixed Closed By: hobbs
    Closed on: 2001-03-30 19:56:31
Description:
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.
User Comments: hobbs added on 2001-03-31 02:56:32:

File Added - 4778: winwm.patch

hobbs added on 2001-03-31 02:56:31:
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.

Attachments: