Skip to content
Tcl Source Code Artifact [e22d88bc21]
Login

Artifact [e22d88bc21]

Artifact e22d88bc21383820c1c85ff725e46a9cfa4234bfc577ccd17cf74bb284e9ad39:

Ticket change [e22d88bc21] - Ticket [61c01e0edb08a9ed|61c01e0edb] <i>likely race condition with package require in several threads causing error</i> status still Open with 4 other changes by sebres on 2025-07-18 15:24:00.
D 2025-07-18T15:24:00.612
J icomment Weird.\sThe\sFS-API\sof\sTcl\s(at\sleast\sfor\sWindows)\sdoesn't\slook\sthread\ssafe\sto\sme\snow.\r\n\r\nDebugging\sa\sbit,\sI\ssee\sfollowing\spicture\sin\sTclpMatchInDirectory:\r\n\r\n```\r\n#\scorrect\sbehaviour\sof\sglob:\r\n==68b0==B0==\sD:/Projects/tcllib/build_9.x/lib\s=>\sD:/Projects/tcllib/build_9.x/lib\s(32)\r\n==68b0==B1==\sD:/Projects/tcllib/build_9.x/lib\s=>\sD:/Projects/tcllib/build_9.x/lib\s(32)\r\n==68b0==B2==\sD:/Projects/tcllib/build_9.x/lib\s=>\sD:/Projects/tcllib/build_9.x/lib/\r\n==68b0==BE==\sD:/Projects/tcllib/build_9.x/lib/*\r\n...\r\n\r\n#\swrong\sbehaviour\sof\sglob:\r\n==68b0==B0==\sD:/Projects/tcllib/build_9.x/lib\s=>\sD:/Projects/tcllib/build_9.x/lib\s(32)\r\n==68b0==B1==\sD:/Projects/tcllib/build_9.x/lib\s=>\sD:/\s(-1)\r\n==68b0==B2==\sD:/Projects/tcllib/build_9.x/lib\s=>\sD://\r\n==68b0==BE==\sD://*\r\n...\r\n```\r\n\r\nB0\sshows\s`fileNamePtr`\sas\sresult\sof\s`fileNamePtr\s=\sTcl_FSGetNormalizedPath(interp,\spathPtr)`;<br/>\r\nB1\sshows\sthe\ssame\s`fileNamePtr`,\sbut\safter\sinvocation\sof\s`Tcl_FSGetNativePath(pathPtr)`.\r\n\r\nSomewhere\sin\sbetween,\sthe\spath\sobject\sinvalidates\sits\snormalized\srepresentation\s(`pathPtr->normPathPtr`),\sprobably\sby\sepoch\schange,\sso\s`fileNamePtr`\sbecomes\sinvalid\s(since\sit\sis\sused\snot\sincremented\sinside\sof\sfunction).\r\n\r\nThis\sgrave\sbug\sexists\sat\sleast\ssince\s8.5,\sjust\sprobably\ssince\s8.7\sor\s9.0\sthe\sepoch\schanges\soften\sfor\ssome\sreason,\sso\sinvalidation\sof\sobject\shappens\smore\soften\sand\sbehaviour\sgets\snoticeable\sin\sthreaded\senvironment.\r\n\r\nBut\safter\sall\sit\sis\stypical\suse-after-free\sand\scan\scause\scrash\swith\sSF\sor\sBO,\smemory\scorruption\setc.\r\n\r\nI'll\sfix\sit\snow\sfor\sall\sbranches.\r\n\r\nI\sguess,\sbesides\scomplete\scode\sreview\s(to\sfind\ssimilar\sissues),\swe\shave\sto\sre-release\sseveral\sversions\shereafter\sor\sat\sleast\sprovide\shotfixes\sfor\sthat.
J login sebres
J mimetype text/x-markdown
J priority 9\sImmediate
K 61c01e0edb08a9ed905aefdf17ce113da303c77b
U sebres
Z be8bfb5b401677ad8a22555398eeb341