D 2018-03-29T23:02:20.852 J assignee nobody J closer nobody J cmimetype text/plain J comment Multi-thread\saccess\sto\sa\sTcl_Obj\sstruct\sis\sat\sbest\sperilous\r\nbecause\sthe\sTcl_IncrRefCount\sand\sTcl_DecrRefCount\spublic\r\nroutines\sare\snot\sroutines\sat\sall,\sbut\smacros.\r\n\r\nAnd\sthey\sare\smacros\swritten\swith\sthe\sstrong\sassumption\sthat\r\nwhile\sthey\soperate\sthe\scaller\shas\sexclusive\saccess\sto\sthe\sfield.\r\nThe\sonly\ssafe\sapproach\sis\sto\sfollow\sa\sstrict\srule\sthat\sany\r\nTcl_Obj\sis\saccessed\sby\sonly\sa\ssingle\sthread\sthat\scan\sbe\ssaid\r\nto\s"own"\sthat\svalue.\sIf\syou\sneed\sto\spass\sa\svalue\sfrom\sone\sthread\r\nto\sanother,\syou\sneed\sto\shave\sthe\ssecond\sthread\screate\sits\sown\r\ncopy\sof\sthe\sfirst,\squite\spossibly\slimited\sonly\sto\sthe\smechanism\r\nof\smaking\sa\sfull\scopy\sof\sthe\sstring\srep.\r\n\r\nThese\srules\sare\schecked\sby\sthe\sTcl\score\swhen\sthe\s--enable-symbols=mem\r\nconfiguration\ssetting\sis\son.\sTcl_Obj\sallocation\sstores\sthe\sallocated\r\npointer\sin\sa\sthread-local\shash\smap,\sand\sdeallocation\sremoves\sfrom\r\nthe\ssame\sthread-local\shash\smap.\s\sSome\smismatches\s(but\snot\sall?!?!)\r\nare\sdetected\swith\sa\sTcl_Panic(). J is_private 0 J login dgp J priority 5\sMedium J resolution None J severity Critical J status Open J submitter dgp J subsystem 80.\sThread\sPackage J title tsv\scommands\sbreak\sthread\saccess\srules\sfor\sTcl\svalues J type Bug K c6057948e5f884435ee35517008db0205f286a5e U dgp Z f4c921191a74a16b7abcecfacce4100d