Infinite loop in TclFSGetAncestorPaths
Closed / Fixed9c45616627b30a6fc8a2f15d6d8868e661113b16Created 303 days agoUpdated 302 days ago
Descriptionmarkdown2026-02-04 05:40:24
I was building an app with the tcl_library embedded in in and mounted it with TclZipfs_MountBuffer and set the $tcl_library variable.
Then calling Tcl_Init() caused it to hang. After looking at it with a debugger it looks like there is an infinite loop at the end of TclFsGetAncestorPaths() in generic/tclPathObj.c
count = i;
/* Fill remaining with NULL */
while (i < numPaths) {
pathsPtr[i] = NULL;
}
Tcl_DecrRefCount(splitPathPtr);
It seemed to fix things if I just increment i in the loop
count = i;
/* Fill remaining with NULL */
while (i < numPaths) {
pathsPtr[i] = NULL;
i+=1
}
Tcl_DecrRefCount(splitPathPtr);
jan.nijtmanswiki2026-02-04 10:02:48
This was introduced in [e89c38915e076141}this] commit (TIP #732)
Thanks for noticing! Fixed now.
oehharwiki2026-02-04 10:15:04
This was introduced in [e89c38915e076141] commit (TIP #732)
Thanks for noticing! Fixed now.
apnadkarniplain2026-02-05 04:09:20
Thanks, Jan & OP.
Log in (anonymous is fine) to add a comment.