Tk Source Code

View Ticket
Login
Ticket UUID: 220669
Title: `winfo cont' crashes due to BadWindow in X_TranslateCoords
Type: Bug Version: obsolete: 8.2.1
Submitter: welch Created on: 2000-10-31 23:48:27
Subsystem: 67. Unix Window Operations Assigned To: nobody
Priority: 2 Severity:
Status: Closed Last Modified: 2001-03-23 02:18:07
Resolution: Fixed Closed By: dgp
    Closed on: 2001-03-22 19:18:07
Description:
OriginalBugID: 4106 Bug
Version: 8.2.1
SubmitDate: '2000-01-31'
LastModified: '2000-01-31'
Severity: CRIT
Status: Released
Submitter: techsupp
ChangedBy: hobbs
RelatedBugIDs: 716
OS: BSD
OSVersion: BSD/OS 2.1
Machine: PII-350/64M/XFree86 vendor release number 3120
FixedDate: '2000-01-31'
FixedInVersion: 8.3b1


Name:
Jeff Epler

Comments:
The window hierarchy changes while Tk_CoordsToWindow is traversing it,
    because the window manager is tearing down the window ".t" and its
    decorations.

    The problem crops up at least on fvwm2 and icewm.  Since it depends on
    the actions of the wm the severity may depend on the one in use.

ReproducibleScript:
toplevel .t
button .t.b -command {
        set px [winfo pointerx .]
        set py [winfo pointery .]
        destroy .t
        if { [winfo cont $px $py] != ".t.b" } {
                puts "leave"
        }
} -text {d}
pack .t.b
puts {Now invoke the "d" button}

ObservedBehavior:
% /tmp/tcl8/bin/wish8.2 ~/2tl.tcl 
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  40 (X_TranslateCoords)
  Resource id in failed request:  0x1c004f9
  Serial number of failed request:  202
  Current serial number in output stream:  202

GDB produces the following stack trace when breaking on _XError:
Starting program: /tmp/tcl8/bin/wish8.2 ~/2tl.tcl
Now invoke the "d" button

Breakpoint 1, 0xf7721 in _XError ()
(gdb) where
#0  0xf7721 in _XError ()
#1  0xf612a in _XReply ()
#2  0x101420 in XTranslateCoordinates ()
#3  0x2996f in Tk_CoordsToWindow (rootX=519, rootY=543, tkwin=0x69c500)
    at ./tkUnixWm.c:3532
#4  0x68e5 in Tk_WinfoObjCmd (clientData=0x69c500, interp=0x69d000, objc=4, 
    objv=0x6a1014) at ./../generic/tkCmds.c:1279
#5  0xc03c3 in TclExecuteByteCode ()
#6  0xa0b25 in Tcl_EvalObjEx ()
#7  0x2d000 in TkInvokeButton (butPtr=0x749f00) at ./../generic/tkButton.c:1457
#8  0x2c29a in ButtonWidgetObjCmd (clientData=0x749f00, interp=0x69d000, 
    objc=2, objv=0x6a100c) at ./../generic/tkButton.c:835

DesiredBehavior:
No X protocol error.  return value from `winfo' should probably not indicate .t or .t.b



Already fixed in 8.3b1 with patch from bug 716. 
-- 01/31/2000 hobbs