|
2026-11-27
| ||
| 21:24 | • Pending ticket [2577420fff]: Tcl_GetInterpPath produces invalid path. plus 5... artifact: f59237d845 user: jan.nijtmans | |
| 21:24 | Fix [2577420fff]: Tcl_GetInterpPath() and Tcl_GetParent() used freed memory check-in: b428759224 user: jan.nijtmans tags: trunk, main | |
| 19:21 | • Ticket [2577420fff] Tcl_GetInterpPath produces invalid path. status still Op... artifact: 2a7c5a9a24 user: serhiy.storchaka | |
| 15:15 | • Ticket [2577420fff]: 7 changes artifact: f51784e791 user: jan.nijtmans | |
| 13:20 | Fix [2577420fff]: Tcl_GetInterpPath() and Tcl_GetParent() used freed memory check-in: 0a9c575129 user: jan.nijtmans tags: trunk, main | |
|
2026-10-17
| ||
| 08:39 | • Ticket [2577420fff] Tcl_GetInterpPath produces invalid path. status still Op... artifact: a65c5de9da user: serhiy.storchaka | |
| 08:38 | Fix [2577420fff]: Tcl_GetInterpPath() and Tcl_GetParent() used freed memory in a Tcl_CallWhenDeleted... check-in: 49e00a9cd6 user: serhiy.storchaka tags: interp-delete-callbacks-path | |
|
2009-03-17
| ||
| 15:06 | • Ticket [2577420fff] Tcl_GetInterpPath produces invalid path. status still Op... artifact: e00998dbd8 user: mistachkin | |
| 15:01 | • Ticket [2577420fff]: 4 changes artifact: 791ccb2aeb user: mistachkin | |
|
2009-02-07
| ||
| 14:54 | • New ticket [2577420fff]. artifact: a9c63dd97f user: sbron | |
Tcl_GetInterpPath produces invalid path.
Tcl_GetInterpPath returns TCL_OK when called form within a Tcl_InterpDeleteProc that runs when the slave interp is deleted, but the path it produces is garbage.
The following code prints some strange character when it is registered with Tcl_CallWhenDeleted for some slave interpreter and that interpreter is subsequently deleted.
void InterpDelete(ClientData dummy, Tcl_Interp *interp)
{
Tcl_Interp *master;
master = Tcl_GetMaster(interp);
if (master != NULL) {
Tcl_GetInterpPath(master, interp);
printf("Path: %s\n", Tcl_GetStringResult(master));
}
}
Either the function should produce the correct path, or it should return TCL_ERROR. In the latter case it would also be helpful if the manual page would mention that this function cannot be used when the interp is in the process of being deleted.
Problem was found on SuSE linux 11.0.
b428759224Fix [2577420fff]: Tcl_GetInterpPath() and Tcl_GetParent() used freed memory check-in2026-11-27 21:24:030a9c575129Fix [2577420fff]: Tcl_GetInterpPath() and Tcl_GetParent() used freed memory check-in2026-11-27 13:20:4249e00a9cd6Fix [2577420fff]: Tcl_GetInterpPath() and Tcl_GetParent() used freed memory in a Tcl_CallWhenDeleted() callback of a child interpreter. Unlink the child from its parent only after Tcl_DeleteInterp(), and free the InterpInfo after all delete callbacks. check-in2026-10-17 08:38:42
This bug may be related to 1502071.
This bug may be related to 1502071.
Still a use-after-free in 9.0 and 9.1 (ASan): the child's entry in the parent's child table is removed before the child's Tcl_CallWhenDeleted() callbacks run, and the InterpInfo may be freed before them too, because it is freed by another delete callback. 8.6 and 9.0 print the right path only because the freed memory still holds it. Proposed fix in branch interp-delete-callbacks-path: unlink after Tcl_DeleteInterp(), and free the InterpInfo after all delete callbacks. No test, since no script command can register such a callback.
I'm seeing (both on Windows and Linux:
rename.test Test file error: child killed: segmentation violation
So, something is wrong with this patch.
The rename.test segfault came from the branch: a child being deleted could still be deleted again by name. Fixed in [2a2b5c0667] on interp-delete-callbacks-path.
Now merged to [trunk]
Many thanks!