Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-20
18:11 • Ticket [ec1ee3bc92] tcltest crashes when a testasync handler is invoked from t... artifact: 253b88ce55 user: serhiy.storchaka
2026-10-18
09:39 • New ticket [ec1ee3bc92]. artifact: 879a90f3fd user: serhiy.storchaka

tcltest crashes when a [testasync] handler is invoked from the event loop (NULL interp)

Openec1ee3bc921ff34aaf0391781c2a90eed1fceffaCreated 46 days agoUpdated 43 days ago
Descriptionwiki2026-10-18 09:39:59
The tcltest binary crashes (segmentation fault) when a [testasync] handler is invoked from the event loop:
proc cb {result code} {return $code}
set h [testasync create cb]
testasync marklater $h
after 500 {set done 1}
vwait done

AsyncHandlerProc() in generic/tclTest.c calls Tcl_GetStringResult(interp) before it checks for interp == NULL, which is what Tcl_AsyncInvoke() passes when async handlers run from the event loop. Only the test command is affected, not the library. Seen with 8.6.18, 9.0.5 and 9.1.0.

Proposed fix in branch testasync-null-interp: without an interpreter the handler just returns the code. Test async-5.1.

serhiy.storchaka Ticket [ec1ee3bc92]: 1 change [History diff]2026-10-20 18:11:29
Log in (anonymous is fine) to add a comment.