Skip to content
Tcl Source Code History Of Ticket 3024359
Login

History Of Ticket 3024359

Artifacts Associated With Ticket 3024359

  1. Ticket change [a503fce0e6] (rid 110302) by neilhampton on 2010-07-02 13:02:16:

    1. assignee initialized to: "vincentdarley"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      We have a multi-threaded tclkit application that runs several scripts on different threads and it crashes in Tcl_FSGetFileSystemForPath on the line "fsRecPtr = fsRecPtr->nextPtr".
      
      From investigation, it appears that 'theFilesystemEpoch' is being updated within the loop and the threads file system list is being re-cached leaving fsRecPtr pointing at freed memory.  It is very difficult to track, but it appears that Tcl_FSMountsChanged is being called from within Tcl_FSGetFileSystemForPath.  The path being accessed is the 'wrapped' init.tcl.
      
    4. foundin initialized to: "obsolete: 8.5.8"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "neilhampton"
    10. subsystem initialized to: "37. File System"
    11. title initialized to: "Crash in Tcl_FSGetFileSystemForPath"
    12. type initialized to: "Bug"
  2. Ticket change [10b1e04a77] (rid 95003) by dkf on 2012-05-29 16:12:57:

    1. priority changed to: "8"
  3. Ticket change [62c2518733] (rid 92459) by dgp on 2012-05-29 20:40:43:

    1. icomment:
      This is reported against 8.5.8.  Has it been reconfirmed
      with either 8.5.11 release, or current state of core-8-5-branch?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  4. Ticket change [3923f78c5d] (rid 112335) by dgp on 2012-05-29 20:40:44:

    1. assignee changed to: "dgp"
  5. Ticket change [7bf29eded7] (rid 96993) by dgp on 2012-06-11 23:41:49:

    1. closedate changed to: "2012-06-11T16:41:49"
    2. closer changed to: "dgp"
    3. icomment:
      The issue appears to be care needed by callers of
      FsGetFirstFilesystem().  Any caller that keeps and
      makes use of the value it returns needs to take care
      not to continue using that value whenever another
      call to FsGetFirstFilesystem() might be made in the
      same thread.  Since TclFSEnsureEpochOk() does
      just that, it's clear that Tcl_FsGetFileSystemForPath()
      has the potential for this kind of trouble.  The need to
      make both those calls and make sure they both report
      results on the same epoch is a bit of a puzzle.
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Out of Date"
    7. status changed to: "Pending"
    8. username: "dgp"
  6. Ticket change [749b32b9b0] (rid 105231) by dgp on 2012-06-12 05:23:28:

    1. resolution changed to: "None"
    2. status changed to: "Open"
  7. Ticket change [103d07e62f] (rid 94937) by dgp on 2012-06-12 05:26:40:

    1. icomment:
      
      First draft fix committed to branch bug-3024359.  Needs tests and testing.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  8. Ticket change [eecba31685] (rid 108877) by dgp on 2012-06-12 20:46:17:

    1. icomment:
      
      Second draft committed, but it's now clear these patches
      are broken.  Although they preserve the FilesystemRecord
      linked lists while they are in use, avoiding the reported crashes,
      the result is that when a search of these preserved records
      succeeds, the incorrect epoch value is recorded, so that a
      record retrieved from an outdated epoch is stored as if it
      were current.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  9. Ticket change [04cde35e28] (rid 88935) by dgp on 2012-06-19 02:40:22:

    1. icomment:
      
      This seems to be a controlled way to test
      for the bug.  Doesn't easily convert to a test
      for the test suite.
      
      package require Thread
      thread::create {while 1 {set env(HOME) /home/user[incr i]}}
      while 1 {file system foo}
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  10. Ticket change [d0be19992e] (rid 113235) by dgp on 2012-06-19 03:37:17:

    1. icomment:
      
      Next draft fix committed.  This one appears to solve
      the problem, at least as far as that test demonstrates.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  11. Ticket change [540fd315e0] (rid 93872) by dgp on 2012-06-22 01:54:57:

    1. icomment:
      
      Some simplifications of the internals of fs path values
      just committed to the 8.5 and trunk branches has the
      effect of also making the posted test pass.
      
      I have my doubts these changes are a complete fix for
      the issue of managing the mount epoch properly (still
      pursuing that on the bug-3024359 branch) but they may
      be sufficient to repair the problems observed by the
      original poster.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Ticket change [e6db190612] (rid 104360) by dgp on 2012-06-22 02:00:16:

    1. icomment:
      Aha!  Strike that last comment.  Still seeing
      crashes on 8.5 branch.  Developing fix is
      still on the bug-3024359 branch.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  13. Ticket change [6e940f7efb] (rid 100172) by dgp on 2012-06-22 02:12:22:

    1. icomment:
      The crashing is much less frequent though, which
      suggests that the FsGetFirstFilesystem() call in the
      (now deleted) helper routine TclFsInternalToNormalized()
      was the one most frequently causing a bump in the
      per-thread filesystemEpoch value at a time that could cause
      trouble.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  14. Ticket change [af2798ac81] (rid 97761) by dgp on 2012-06-22 23:45:28:

    1. icomment:
      Revised the code to restore the crashing.  The bug is still
      present on 8-5-branch, but was able to hide by getting lucky
      with memory allocation patterns.  Now it cannot hide.  Bugs
      that don't hide are easier to fix.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  15. Ticket change [2140f855c0] (rid 130552) by dgp on 2012-06-25 22:21:19:

    1. icomment:
      Fix committed to core-8-5-branch for release in 8.5.12.
      
      Confirmation that it fixes the reported bug would be welcome.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  16. Ticket change [2765347397] (rid 88509) by dgp on 2012-06-25 23:44:18:

    1. closedate changed to: "2012-06-25T16:44:18"
    2. closer changed to: "dgp"
    3. icomment:
      Fix merged to trunk as well.
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Pending"
    8. username: "dgp"
  17. Ticket change [64addd7042] (rid 134175) by dkf on 2013-09-24 12:06:32:

    1. closedate changed to: "2456560.00453934"
    2. closer changed to: "dkf"
    3. comment changed to:
      We have a multi-threaded tclkit application that runs several scripts on different threads and it crashes in Tcl_FSGetFileSystemForPath on the line "fsRecPtr = fsRecPtr->nextPtr".
      
      From investigation, it appears that 'theFilesystemEpoch' is being updated within the loop and the threads file system list is being re-cached leaving fsRecPtr pointing at freed memory.  It is very difficult to track, but it appears that Tcl_FSMountsChanged is being called from within Tcl_FSGetFileSystemForPath.  The path being accessed is the 'wrapped' init.tcl.
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. severity changed to: "Critical"
    7. status changed to: "Closed"