Skip to content
Tcl Source Code Artifact [f599e9b2c9]
Login

Artifact [f599e9b2c9]

Artifact f599e9b2c959b504f7fed24361ba8ea0a861e211ca81bb6d943ded33e1b767df:

Ticket change [f599e9b2c9] - Ticket [c35e347c6fb8df66|c35e347c6f] <i>Concurrent Tcl_Init calls race in Unix locale initialization, causing crashes on OpenBSD</i> status still Open with 3 other changes by serhiy.storchaka on 2026-10-20 08:42:50.
D 2026-10-20T08:42:50.086
J icomment Since\s[63941fee4f]\sit\salready\sworks\smostly\sthat\sway:\sthe\slocale\sis\sread\sonce,\sby\s<tt>TclpSetInitialEncodings()</tt>\scalled\sfrom\s<tt>Tcl_FindExecutable()</tt>\safter\s<tt>Tcl_InitSubsystems()</tt>,\sand\sits\scall\sin\s<tt>Tcl_Init()</tt>\sreturns\sat\sonce\sas\ssoon\sas\sthe\sinitial\sencoding\sis\sset.\sSo\sthe\slock\sin\s[/timeline?r=unix-locale-init-lock|unix-locale-init-lock]\sis\snot\staken\swhen\san\sinterp\sis\screated,\sexcept\swhile\sthe\sinitial\sencoding\scould\snot\sbe\sset\syet.\n\nIt\sis\sneeded\sfor\sthe\spublic\s<tt>Tcl_GetEncodingNameFromEnvironment()</tt>\sand\s<tt>Tcl_GetEncodingNameForUser()</tt>,\swhich\scall\s<tt>setlocale()</tt>\severy\stime,\salso\sfrom\s<nowiki>[encoding\suser]</nowiki>;\sthat\sis\swhat\sthe\sattached\sreproducer\scrashes.\sTheir\sresult\scould\sbe\scached\stoo,\sbut\sthen\sa\slater\s<tt>setlocale()</tt>\sby\sthe\sapplication\swould\snot\sbe\sseen.
J login serhiy.storchaka
J mimetype text/x-fossil-wiki
K c35e347c6fb8df66917b1ab6974b3638925b4aa2
U serhiy.storchaka
Z f4e33e97e897c866936af2cb7c235c35