Skip to content
Tcl Source Code Artifact [b497022b33]
Login

Artifact [b497022b33]

Artifact b497022b334f22ea223762a4acaeddf60fce2bf84dd1adc21f520ea9928c073e:

Ticket change [b497022b33] - Closed ticket [1967630fffffffff|1967630fff]: <i>tclLoadDl.c dlerror() is not thread safe</i> plus 9 other changes by jan.nijtmans on 2026-10-28 21:07:40.
D 2026-10-28T21:07:40.299
J assignee jan.nijtmans
J closedate 2461342.3803275349
J closer jan.nijtmans
J comment According\sto\sthe\sstandard\sfor\sdlerror(),\sit's\snot\srequired\sto\sbe\sthread-safe.\s\s\r\nhttp://www.opengroup.org/onlinepubs/009695399/functions/dlerror.html\r\n\r\nI\salso\schecked\sseveral\sopen\ssource\slibc.\s\sNetBSD\sand\sOpenBSD\sdon't\suse\sthread-specific\sstorage\sfor\sdlerror\smessages,\sbut\sthe\sGNU/Linux\sglibc\sdoes.\r\n\r\nAttached\sis\sa\spatch\sto\sfix\sthe\sproblem.\s\sIt\sdrains\sthe\sdlerror()\sfirst\safter\sentering\sthe\scritical\sregion.\r\n\r\nThe\sLinux\susage\ssuggested\sis\sslightly\sdifferent\sthan\swhat\sBSD\sseems\sto\ssuggest.\s\sThe\sglibc\sdlsym\smanual\ssuggests\susing\sdlerror\sto\sindicate\sthe\ssuccess\sor\sfailure\sof\sa\sdlsym(),\srather\sthan\sNULL\sfrom\sthe\sreturn\sof\sdlsym(),\sbecause\sapparently\sdlsym()\scan\sreturn\s0/NULL\sand\sstill\shave\ssucceeded\s(with\ssome\ssymbols).\s\sSo\sthe\slogic\sshould\sprobably\sbe\schanged\sfurther\sbased\son\swhat\sthe\sglibc\sdocs\ssay.\r\n\r\nThis\sis\sthe\sexample\staken\sfrom\sthe\smanual\sfor\sdlsym:\r\n\sdlerror();\s\s\s\s/*\sClear\sany\sexisting\serror\s*/\r\n\scosine\s=\sdlsym(handle,\s"cos");\r\n\sif\s((error\s=\sdlerror())\s!=\sNULL)\r\n\s\s\s...\r\n\s\s\r\n\r\nI\salso\sadded\serror\shandling\sto\sTclpFindSymbol().\s\sIt\sappears\sto\sbe\sunfinished\sprior\sto\sthis,\sor\sthe\susage\sexpectations\sof\sit\shave\schanged,\sbecause\sin\sthe\sHEAD\sit\sdoesn't\suse\sthe\sinterp\sargument\sto\sreport\san\serror\slike\sthe\s(outdated?)\scomments\sstate.
J icomment Fixed\sin\s[e0e0341124|trunk],\score-9-0-branch\sand\score-8-6-branch\r\n\r\nMany\sthanks!
J login jan.nijtmans
J mimetype text/x-fossil-wiki
J resolution Fixed
J severity Minor
J status Closed
K 1967630fffffffffffffffffffffffffffffffff
U jan.nijtmans
Z 6e2f76d4973fd36438916ed7d0621155