Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4525ba4ec8feebed423f7600009ec12d5b21bf0d
Ticket: 1160906fffffffffffffffffffffffffffffffff
core dump occurs when 'getcwd()' returns null.
User & Date: tmh on 2005-03-10 20:50:37
Changes

  1. assignee changed to: "vincentdarley"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The tclUnixFile.c file has a function
    TclNativeCreateNativeRep().
    
    line 977 -> 979 has a problem.
    
            /* Make sure the normalized path is set */
            validPathPtr = Tcl_FSGetNormalizedPath(NULL,
    pathPtr);
            Tcl_IncrRefCount(validPathPtr);
    
    It is possible to construct a situation where
    validPathPtr is returned as NULL, and
    Tcl_IncrRefCount(NULL); causes a core dump.
    
    
    The situation leading to this is complicated.
    
    First a directory is created.
    /var/cores/programname
    This directory is mode 0700 and owned by root.
    
    A 'C' program starts as root, 
    changes directory to /var/cores/programname.
    drops 'root' permission to a user permision.
    Opens a tcl interpreter.
    Tcl_EvalFiles some tcl file that includes a [clock
    format] command
    
    Core dump occurs.
    
    This code has worked in all versions of Tcl 8.3, 8.4
    and 8.5 until recently.
    
    I have a relatively small test file available, but I do
    not wish to post it to the web.  I will email it to
    those interested.
    
  4. foundin changed to: "obsolete: 8.5a3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "tmh"
  9. subsystem changed to: "37. File System"
  10. title changed to: "core dump occurs when 'getcwd()' returns null."
  11. type changed to: "Bug"