Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Use-after-free if Thread is initialized in a sub-interpreter before the root

Closed / Duplicateee1341ff89edd6c53fbc2bf558ffe02dc6f9c30fCreated 2 years agoUpdated 2 years ago
Descriptionplain2024-11-09 01:01:28
Repro available at [https://gist.github.com/winrg/7fa3ac2a9b2b9f35bc4888ce0adaef46]

In short, if Thread is initialized in a sub-interpreter, and said interpreter is deleted, then thread::send events will cause the thread to segfault.

I believe this happens because thread::send events get routed to the deleted sub-interpreter instead of the main thread. Realistically this is not exploitable in most circumstances.
aleteoryx Ticket [ee1341ff89]: 3 changes [History diff]2024-11-09 01:02:51
aleteoryx Ticket [ee1341ff89]: 3 changes [History diff]2024-11-09 01:04:55
juliannoble2plain2024-11-09 03:42:58
Reproduced the crash in magicsplat tcl9 with thread 3.0.0
Also crashes in my own Tcl9 build on windows.
sebreswiki2024-11-13 14:12:44

Basically it is not an issue of tcl, but of thread.

Thus I'll close it here - further in [d4ba38d00d06ebba].

sebreswiki2024-11-13 16:10:08

JFYI, it is fixed now for all mainline branches (2.8+) in thread repository.

Log in (anonymous is fine) to add a comment.