Artifacts Associated With Ticket 3024359fffffffffffffffffffffffffffffffff
Ticket change [a503fce0e6] (rid 110302) by neilhampton on 2010-07-02 13:02:16:
- assignee initialized to: "vincentdarley"
- cmimetype initialized to: "text/plain"
- 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.
- foundin initialized to: "obsolete: 8.5.8"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "neilhampton"
- subsystem initialized to: "37. File System"
- title initialized to: "Crash in Tcl_FSGetFileSystemForPath"
- type initialized to: "Bug"
Ticket change [10b1e04a77] (rid 95003) by dkf on 2012-05-29 16:12:57:
- priority changed to: "8"
Ticket change [62c2518733] (rid 92459) by dgp on 2012-05-29 20:40:43:
- 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?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [3923f78c5d] (rid 112335) by dgp on 2012-05-29 20:40:44:
- assignee changed to: "dgp"
Ticket change [7bf29eded7] (rid 96993) by dgp on 2012-06-11 23:41:49:
- closedate changed to: "2012-06-11T16:41:49"
- closer changed to: "dgp"
- 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.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Out of Date"
- status changed to: "Pending"
- username: "dgp"
Ticket change [749b32b9b0] (rid 105231) by dgp on 2012-06-12 05:23:28:
- resolution changed to: "None"
- status changed to: "Open"
Ticket change [103d07e62f] (rid 94937) by dgp on 2012-06-12 05:26:40:
- icomment:
First draft fix committed to branch bug-3024359. Needs tests and testing.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [eecba31685] (rid 108877) by dgp on 2012-06-12 20:46:17:
- 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.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [04cde35e28] (rid 88935) by dgp on 2012-06-19 02:40:22:
- 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} - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [d0be19992e] (rid 113235) by dgp on 2012-06-19 03:37:17:
- icomment:
Next draft fix committed. This one appears to solve the problem, at least as far as that test demonstrates.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [540fd315e0] (rid 93872) by dgp on 2012-06-22 01:54:57:
- 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.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [e6db190612] (rid 104360) by dgp on 2012-06-22 02:00:16:
- icomment:
Aha! Strike that last comment. Still seeing crashes on 8.5 branch. Developing fix is still on the bug-3024359 branch.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [6e940f7efb] (rid 100172) by dgp on 2012-06-22 02:12:22:
- 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.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [af2798ac81] (rid 97761) by dgp on 2012-06-22 23:45:28:
- 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.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [2140f855c0] (rid 130552) by dgp on 2012-06-25 22:21:19:
- icomment:
Fix committed to core-8-5-branch for release in 8.5.12. Confirmation that it fixes the reported bug would be welcome.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [2765347397] (rid 88509) by dgp on 2012-06-25 23:44:18:
- closedate changed to: "2012-06-25T16:44:18"
- closer changed to: "dgp"
- icomment:
Fix merged to trunk as well.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Pending"
- username: "dgp"
Ticket change [64addd7042] (rid 134175) by dkf on 2013-09-24 12:06:32:
- closedate changed to: "2456560.00453934"
- closer changed to: "dkf"
- 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.
- login: "dkf"
- mimetype: "text/plain"
- severity changed to: "Critical"
- status changed to: "Closed"