Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2013-11-12
14:40 • Closed ticket [3b9b6e7d08]: Tcl_SetNotifier on Mac causes Tcl to crash plus ... artifact: 715a2c0f6a user: dkf
2013-09-15
21:57 • Pending ticket [3b9b6e7d08]. artifact: 2eeae04984 user: jan.nijtmans
21:33 • Ticket [3b9b6e7d08]: 3 changes artifact: 429d8ec0bf user: jan.nijtmans
19:49 • Ticket [3b9b6e7d08]: 3 changes artifact: 41ddddea98 user: dgp
17:09 • Ticket [3b9b6e7d08]: 3 changes artifact: f6df86bc48 user: jan.nijtmans
06:48 • New ticket [3b9b6e7d08]. artifact: 5f2b320514 user: anonymous

Tcl_SetNotifier on Mac causes Tcl to crash

Closed / Invalid3b9b6e7d08810a5d0f71dc53d92a3e5c809d68adCreated 13 years agoUpdated 13 years ago
Descriptionplain2013-09-15 06:48:28
In macosx/tclMacOSXNotify.c, Tcl_Sleep makes use of the local ThreadSpecificData *tsdPtr, which is effectively private data belonging to the notifier. However, Tcl_Sleep itself is not part of the notifier. If I then use Tcl_SetNotifier to replace the notifier, then Tcl crashes because Tcl_Sleep still tries to use the original notifier, which has not been initialized (so tsdPtr is invalid). The solution to this bug is to either include Tcl_Sleep in the notifier (i.e., in Tcl_NotifierProcs), or rewrite Tcl_Sleep on Mac OS X such that it does not use data private to the notifier.
jan.nijtmans Ticket [3b9b6e7d08]: 3 changes [History diff]2013-09-15 17:09:40
dgpplain2013-09-15 19:49:27
Is this a regression?  If so, what was the last
release of Tcl that worked correctly?
jan.nijtmansplain2013-09-15 21:33:09
The Tcl_Sleep() function was added in the MacOSX
Notifier in [7a6749806adf6447], just before
the release of 8.5.7. It appears that 8.5.6
worked correctly.
jan.nijtmansplain2013-09-15 21:57:48
Actually, I think this bug report is invalid. tsdPtr is always initialized,
if it wasn't already then the TCL_TSD_INIT(&dataKey) in Tcl_Sleep will
do it. Further on, the Tcl_Sleep function properly tests for tsdPtr->runLoop
and tsdPtr->runLoopTimer being non-NULL before using them. 

I would really like to have a look at a stack-trace first, before doing anything here. It's more likely that the replacement notifier does something wrong.
dkf Closed ticket [3b9b6e7d08]. [History diff]2013-11-12 14:40:29
Log in (anonymous is fine) to add a comment.