Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3fdfbb0edde540489ca95373e786576bd831dd09056f24e3f43ad52d2c688d91
Ticket: 9c45616627b30a6fc8a2f15d6d8868e661113b16
Infinite loop in TclFSGetAncestorPaths
User & Date: anonymous on 2026-02-04 05:40:24
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. comment changed to:
    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);
    ```
    
  5. is_private changed to: "0"
  6. login: "anonymous"
  7. priority changed to: "5 Medium"
  8. resolution changed to: "None"
  9. severity changed to: "Minor"
  10. status changed to: "Open"
  11. submitter changed to: "anonymous"
  12. subsystem changed to: "38. Init - Library - Autoload"
  13. title changed to: "Infinite loop in TclFSGetAncestorPaths"
  14. type changed to: "Bug"