Tk Source Code

View Ticket
Login
Ticket UUID: 560679
Title: Missing -container crashes wish
Type: Bug Version: None
Submitter: pspjuth Created on: 2002-05-26 08:42:07
Subsystem: 68. Win Window Operations Assigned To: chengyemao
Priority: 6 Severity:
Status: Closed Last Modified: 2002-10-09 06:29:44
Resolution: Fixed Closed By: hobbs
    Closed on: 2002-10-08 23:29:44
Description:
Embedding in a toplevel that has not set -container causes
a crash. (At least on Win98, where I have seen it.)

Script:

toplevel .real 
toplevel .embd -use [winfo id .real]

Stack trace:

Tk_GeometryRequest(Tk_Window_ * 0x00000000, int 0x000000c8,
  int 0x000000c8) line 154 + 6 bytes
EmbedGeometryRequest(Container * 0x00beed00, int
0x000000c8,
  int 0x000000c8) line 444 + 17 bytes
TkWinEmbeddedEventProc(HWND__ * 0x00000498, unsigned
int 0x00000401,
  unsigned int 0x000000c8, long 0x000000c8) line 400 +
17 bytes
TkWinChildProc(HWND__ * 0x00000498, unsigned int
0x00000401,
  unsigned int 0x000000c8, long 0x000000c8) line 650 +
21 bytes
TopLevelEventProc(int * 0x00beef00, _XEvent *
0x00bee988) line 3601


The crash happens because Tk_GeometryRequest is called
with a
NULL pointer by EmbedGeometryRequest.
My guess is that EmbedGeometryRequest should check if
containerPtr->parentPtr is NULL.
User Comments: hobbs added on 2002-10-09 06:29:44:
Logged In: YES 
user_id=72656

This does the right thing in 8.4.0:

(tkcon) 51 % toplevel .embd -use [winfo id .real]
window ".real" doesn't have -container option set