Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-02-05
04:09 • Ticket [9c45616627] Infinite loop in TclFSGetAncestorPaths status still Clos... artifact: c25bfb3c9f user: apnadkarni
2026-02-04
10:15 • Ticket [9c45616627]: 5 changes artifact: 335206f962 user: oehhar
10:02 • Closed ticket [9c45616627]. artifact: 42fb22d3ad user: jan.nijtmans
09:58
Fix [9c45616627b30a6f]: Infinite loop in TclFSGetAncestorPaths check-in: 056f62ec49 user: jan.nijtmans tags: trunk, main
05:40 • Add attachment diff to ticket [9c45616627] artifact: c5af363ae7 user: anonymous
05:40 • New ticket [9c45616627] Infinite loop in TclFSGetAncestorPaths. artifact: 3fdfbb0edd user: anonymous

Infinite loop in TclFSGetAncestorPaths

Closed / Fixed9c45616627b30a6fc8a2f15d6d8868e661113b16Created 302 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.