Skip to content
Tcl Source Code History Of Ticket 1048733
Login

History Of Ticket 1048733

Artifacts Associated With Ticket 1048733

  1. Ticket change [06f201323c] (rid 89298) by coldstore on 2004-10-17 16:36:45:

    1. assignee initialized to: "vincentdarley"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      FileCopyRename at ../generic/tclFCmd.c:539 calls
      Tcl_FSFileAttrsSet(NULL, 2, target, perm), passing a
      NULL Tcl_Interp* into the set attr command (presumably
      because the rename is being performed en passant)
      
      However, NativeFileAttrsSet() which is the default for
      normal file systems (and other set attribute handlers),
      can get errors - in my case in SetPermissionsAttribute
      at ../unix/tclUnixFCmd.c:1480, where a posix error
      occurs, and the code calls Tcl_PosixError(interp).
      
      The upshot is that Tcl_PosixError tries (eventually) to
      set errorCode and this fails because there is no
      interpreter (or, rather, a NULL interpreter) for it to
      set the variable in.
      
      You can reproduce this by creating a pair of files, A
      and B, owned by another user and (at least in my case)
      chmod u=rw,g=r,o=r
      
      Then, in tclsh8.5:  file rename -force A B
      
      It SIGSEGVs because of the NULL interpreter.
      
      I suggest that the practice of passing NULL interp into
      functions which could generate errors is always bad,
      and in this case at least the call to
      Tcl_FSFileAttrsSet should pass in the variable interp,
      and not NULL.
      
      
    4. foundin initialized to: "obsolete: 8.5a2"
    5. priority initialized to: "7 High"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "coldstore"
    9. subsystem initialized to: "37. File System"
    10. title initialized to: "SIGSEGV on file rename when user doesn't own file"
    11. type initialized to: "Bug"
  2. Ticket change [5dcbb485ef] (rid 115531) by coldstore on 2004-10-18 00:16:32:

    1. icomment:
      Logged In: YES 
      user_id=19214
      
      At least the following public and private functions in
      tcl/generic/ match the following criteria:
      
      1) have Tcl_Interp* as their first argument
      2) have NULL passed in as their first argument.
      
      In the case that they (or the functions they pass interp to)
      can possibly error, I believe there's a risk of a segment fault.
      
      Tcl_Close Tcl_DictObjFirst Tcl_DictObjGet Tcl_DictObjPut
      Tcl_DictObjRemove Tcl_DictObjSize Tcl_ExternalToUtf
      Tcl_FSConvertToPathType Tcl_FSFileAttrsSet Tcl_FSGetCwd
      Tcl_FSGetNormalizedPath Tcl_FSGetTranslatedPath
      Tcl_FSJoinToPath Tcl_FSOpenFileChannel Tcl_GetBoolean
      Tcl_GetBooleanFromObj Tcl_GetEncoding Tcl_GetIndexFromObj
      Tcl_GetInt Tcl_GetIntFromObj Tcl_GetLongFromObj
      Tcl_GetWideIntFromObj Tcl_ListObjAppendElement
      Tcl_ListObjAppendList Tcl_ListObjGetElements
      Tcl_ListObjIndex Tcl_ListObjLength Tcl_ListObjReplace
      Tcl_ParseCommand Tcl_RegExpCompile Tcl_SetChannelOption
      Tcl_SplitList Tcl_UtfToExternal
      
      CheckForDeadChannel DoTildeSubst FlushChannel GetStatBuf
      SetBlockMode SetByteArrayFromAny SetFsPathFromAny
      SetStringFromAny
      
      
      
      
    2. login: "coldstore"
    3. mimetype: "text/plain"
    4. username: "coldstore"
  3. Ticket change [b74ce92ec3] (rid 125564) by coldstore on 2004-10-18 00:30:05:

    1. icomment:
      Logged In: YES 
      user_id=19214
      
      Winnowing out those functions which document that the can
      accept NULL interp arguments, we're left with these
      candidates for SEGV:
      
      Tcl_FSConvertToPathType
      Tcl_FSFileAttrsSet
      Tcl_FSGetCwd
      Tcl_FSGetNormalizedPath
      Tcl_FSGetTranslatedPath
      Tcl_FSJoinToPath
      Tcl_FSOpenFileChannel
      Tcl_GetBoolean
      Tcl_GetBooleanFromObj
      Tcl_GetEncoding
      Tcl_GetIndexFromObj
      Tcl_GetInt
      Tcl_GetIntFromObj
      Tcl_GetLongFromObj
      Tcl_GetWideIntFromObj
      Tcl_SetChannelOption
      CheckForDeadChannel
      DoTildeSubst
      FlushChannel
      GetStatBuf
      SetBlockMode
      SetByteArrayFromAny
      SetFsPathFromAny
      SetStringFromAny
      
      
      
    2. login: "coldstore"
    3. mimetype: "text/plain"
    4. username: "coldstore"
  4. Ticket change [48c2e07002] (rid 99949) by vincentdarley on 2004-10-18 16:55:29:

    1. icomment:
      Logged In: YES 
      user_id=32170
      
      The segfault cited has been fixed in cvs head a few weeks back.
      
      It would be worth looking at the other possible problems in
      more detail.
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. priority changed to: "5 Medium"
    5. title changed to: "possible segfaults with NULL interps"
    6. username: "vincentdarley"
  5. Ticket change [f06442447c] (rid 109187) by dgp on 2006-03-10 13:40:55:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      where do we stand on this now?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  6. Ticket change [c8ab81d8e1] (rid 259753) by serhiy.storchaka on 2026-10-21 10:03:39:

    1. icomment:
      The reported crash (<tt>file rename -force</tt> calling Tcl_FSFileAttrsSet() with a NULL interp) was fixed in 8.5.0 by [088b6e6a3c] ([1020538]): the Unix attribute setters no longer touch a NULL interp on error. No crash with the other listed functions has been reported, so closing.
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  7. Ticket change [1586797593] (rid 260041) by serhiy.storchaka on 2026-10-22 17:19:32:

    1. closedate changed to: "2461334.9192101043"
    2. closer changed to: "serhiy.storchaka"
    3. login: "serhiy.storchaka"