Skip to content
Tcl Source Code Artifact [4a284f5311]
Login

Artifact [4a284f5311]

Artifact 4a284f53110f287121b3deb3355998903f914679e8c1dd3f3684f031db10c483:

Ticket change [4a284f5311] - Ticket [f2ff05fc8411be80|f2ff05fc84] <i>Usage of static systemEncoding is not thread safe (vulnerability)</i> status still Open with 4 other changes by serhiy.storchaka on 2026-10-17 08:10:31.
D 2026-10-17T08:10:31.699
J foundin 9.0.5,\s9.1.0
J icomment Reproduced\son\s9.0\sand\smain:\sone\sthread\sdoing\s<nowiki>[file\sexists]</nowiki>\son\sa\slong\spath\swhile\sanother\sswitches\s<nowiki>[encoding\ssystem]</nowiki>\scrashes\severy\srun.\sAlso\sTcl_GetEncoding(NULL,\sNULL)\sreturned\ssystemEncoding\sread\sagain\safter\sunlocking\sthe\smutex.\nBranch\s[/timeline?r=system-encoding-keep-retired|system-encoding-keep-retired]\sis\sa\ssimple\salternative\sto\s[/timeline?r=sebres-encoding-perf-branch|sebres-encoding-perf-branch]:\sformer\ssystem\sencodings\sare\skept\suntil\sfinalization,\sso\sa\sconversion\scan\skeep\susing\sthe\sone\sit\sread,\swithout\sa\smutex\sor\satomic\sreference\scounts.\s(The\satomic\sreference\scount\sin\ssebres-encoding-perf-branch\snarrows\sthe\srace\sbut\sdoes\snot\sclose\sit:\sthe\sencoding\scan\sbe\sfreed\sbetween\sreading\ssystemEncoding\sand\sincrementing\sits\scount.)\sA\sreference\sin\seach\sconversion\swith\sa\smutex\sworks\stoo,\sbut\smade\s<nowiki>[file\sexists]</nowiki>\sin\s4\sthreads\s1.75\stimes\sslower\shere.\sVisible\schange:\sa\sformer\ssystem\sencoding\sis\snot\sunloaded\swhen\s<nowiki>[encoding\sdirs]</nowiki>\schanges\s(encoding-2.2\sadjusted).\sTest\sthread-9.1.\nWe\scan\sfind\sa\sbetter\ssolution\slater,\sbut\sit\sis\sbetter\sto\sfix\sthe\scrash\snow.
J login serhiy.storchaka
J mimetype text/x-fossil-wiki
K f2ff05fc8411be80a93913b2b065f2c85fa9bcf0
U serhiy.storchaka
Z 20fce15c8e62399dac0d5405d9414fae