| Ticket UUID: | 24949cbd7cb727c6ce8927ad6a7da6efe0d8ec59 | ||
| Title: | Many functions of tclPathObj are not thread safe (can segfault by changing of FS epoch) | ||
| Type: | Bug | Created on: | 2021-08-10 12:45:25 |
| Submitter: | sebres | Assigned to: | nobody |
| Subsystem: | 36. Pathname Management | Severity: | Critical |
| Priority: | 9 Immediate | Last modified: | 2026-10-14 13:44:51 |
| Status: | Pending | Closed by: | nobody |
| Resolution: | None | Closed on: | |
| Version: | >= 8.5 | ||
| Description: | ||||
|
I was searching for the heisenbug, occurring extremely rare at initialization phase of a (multithreaded) tcl-application. The callstack shows:
After analyzing the code in TclpMatchInDirectory and tclPathObj, the error is obvious - it is occurred by win/tclWinFile.c&ln=981-1007 in ln. 1007 when between ln. 981 and ln. 990 some other thread changing the FS epoch, so the object One could surely increment the reference of If this issue cannot be solved using different common approach, the whole code using several path-API functions (in generic/ but also in win/ and unix/) must be reviewed, e. g. extended with incr+decr ref-count for many objects comming from internal representation of path-type objects using Tcl-API or direct assignment. | ||||
| User Comments: | ||||
serhiy.storchaka added on 2026-10-14 13:44:51:
The crash in TclpMatchInDirectory described here was fixed for [61c01e0edb] by the reference counting added in [0d48bb289c] and [4aae9497e4], in 8.6.17 and 9.0.3. Is there another concrete case left, or can this be closed? | ||||
