Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-06-13
00:12 • Closed ticket [1991932fff]: Global grab can cause app to segfault plus 8 oth... artifact: ba2dfe3b19 user: das
00:10 • Ticket [1991932fff]: 4 changes artifact: 475bb23a88 user: nobody
00:10 • Add attachment 1991932.diff to ticket [1991932fff] artifact: ec30a6ec7d user: nobody
2008-06-12
19:33 • Ticket [1991932fff] Global grab can cause app to segfault status still Open ... artifact: 34f624320d user: phase1geo
19:32 • Ticket [1991932fff]: 4 changes artifact: 7419153bf5 user: phase1geo
19:32 • Add attachment test.tcl to ticket [1991932fff] artifact: d5704f1b49 user: phase1geo
12:32 • New ticket [1991932fff] Global grab can cause app to segfault. artifact: c722a7f726 user: phase1geo

Global grab can cause app to segfault

Closed / Fixed1991932fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2008-06-12 12:32:31
I have attached a simple script that can cause wish to segfault when run.  To replicate, simply type 'source test.tcl' at the wish prompt and follow the instructions of the various windows.  I am running this using Tcl/Tk version 8.5.2, running on Mac OS X 10.5.3 on a Intel-based iMac.
phase1geoplain2008-06-12 19:32:31
File Added - 281146: test.tcl
phase1geoplain2008-06-12 19:33:15
Logged In: YES 
user_id=512771
Originator: YES

Assigning this to Daniel per his request.
nobodyplain2008-06-13 00:10:22
File Added - 281187: 1991932.diff
dasplain2008-06-13 00:12:09
Logged In: YES 
user_id=90580
Originator: NO

Thanks much, that script made reproducing the crash easy.

The attached patch fixes the crash, it turned out to be a bug in generic tkPointer code, the global . grab was not being restored correctly when the temporary grab for the .c.b button mousebutton press/release cycle was removed, leading to a dangling reference to .c inside the TkpSetCapture() implementation which was not cleaned up when .c was destroyed in the button command. Subsequent reference to the grab window from mouse-move event generation code would then segfault...

Fix committed to HEAD, core-8-5-branch and core-8-4-branch.

Note that this is a tk bug and should have been filed in the tktoolkit tracker (not bothering to refile it since it is fixed).
Log in (anonymous is fine) to add a comment.

Attachments: