Tk Source Code

View Ticket
Login
Ticket UUID: 3016181
Title: Crash after scrollbar destroyed, Tk Cocoa
Type: Bug Version: current: 8.6.0
Submitter: tom_goddard Created on: 2010-06-14 22:24:08
Subsystem: 16. [scrollbar] Assigned To: kevin_walzer
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2013-08-25 03:13:48
Resolution: Accepted Closed By: kevin_walzer
    Closed on: 2013-08-25 03:13:48
Description:
After deleting a Tk scrollbar a crash sometimes occurs on a mouse down click in the pane associated with the former scrollbar.  Happens with Tk 8.6 source code from May 10, 2010 with the Mac Cocoa build.  This was hard to debug because it requires about 100 mouse clicks and scrollbar deletions done by hand to generate the crash in a molecular visualization program UCSF Chimera.  But I reproduced a few dozen times.  Using the Tcl/Tk debugging libraries produced the attached stack trace showing an invalid interpreter pointer from a TkScrollbar is being used and that it came from a Mac NSScroller object.  It appears that the scrollbar has been destroyed and the NSScroller released but a call to tkScroller() in tkMacOSXScrlbr.c occurs later and uses the invalid TkScrollbar pointer in NSScroller.  I'll attach a patch that fixed this problem by setting the NSScroller copy of the TkScrollbar pointer to null.
User Comments: kevin_walzer added on 2013-08-25 03:13:10:
Fix committed for trunk and 8.5 main branch, thanks for the patch.

jan.nijtmans added on 2013-07-03 07:45:25:
Is this still happening?

tom_goddard added on 2010-06-15 05:27:12:

File Added - 377175: scrollbar.patch

tom_goddard added on 2010-06-15 05:24:08:

File Added - 377174: python2.6_2010-06-14-143149_mach-2.crash

Attachments: