.
D 2020-02-16T10:44:05.537
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment I'm\snot\ssure\sthis\sis\sthe\sright\splace\sfor\sthis\s(maybe\sThread?),\sbut\sI've\shit\sa\r\nsegfault\sthat\sinvolves\sthe\stiming\sof\san\sobject's\snamespace\sdeletion.\s\sI'm\r\nfiling\sit\sagainst\sTclOO\sbecause\sI've\shit\sa\ssimilar\sissue\swith\sa\sdestructor\r\nimplemented\sin\sc\sthat\sdoesn't\sinvolve\stsv::lock,\sbut\sthe\sthis\sversion\suses\sonly\r\nTcl\sscript\sand\sstandard\spackages\sdistributed\swith\sTcl\sreleases:\r\n\r\npackage\srequire\sThread\r\n\r\noo::class\screate\sfoo\s{\r\n\s\s\s\svariable\sthing\r\n\r\n\s\s\s\sconstructor\s{}\s{\r\n\s\s\s\s\s\s\s\sset\sthing\ssomething\r\n\s\s\s\s}\r\n\r\n\s\s\s\sdestructor\s{\r\n\s\s\s\s\s\s\s\sset\slocal\s$thing\r\n\s\s\s\s\s\s\s\srename\s[self]\s{}\r\n\s\s\s\s\s\s\s\stsv::lock\sfoo\s{\r\n\s\s\s\s\s\s\s\s\s\s\s\sputs\s"local:\s$local"\s\s\s;#\sworks\r\n\s\s\s\s\s\s\s\s\s\s\s\sputs\s"thing:\s$thing"\s\s\s;#\ssegfault\r\n\s\s\s\s\s\s\s\s}\r\n\s\s\s\s}\r\n}\r\n\r\n[foo\snew]\sdestroy\r\n\r\n\r\nI\sadmit\sthat\s"rename\s[self]\s{}"\sin\sthe\sdestructor\sis\ssilly,\sbut\sit\sworks\sif\sthe\r\ntsv::lock\sisn't\sinvolved,\sand\sit's\sthere\sto\ssimulate\sthe\ssituation\sthat\soccurs\r\nin\sthe\sreal\scode\swhere\sI\sfound\sthis\sproblem,\swhere\sit\sis\sless\ssilly.\r\n\r\nThe\scrash\shappens\son\sa\scall\sto\r\nTcl_CreateHashEntry(TclVarTable(contextPtr->oPtr->namespacePtr)\sin\r\nProcedureMethodCompiledVarConnect\swhere\scontextPtr->oPtr->namespacePtr\sis\sNULL.\r\n\r\nIn\sthe\spossibly\srelated\scase\swith\sa\sC\smethod\sand\sdestructor,\sthe\sC\smethod\sdoes\r\na\sTcl_DeleteCommandFromToken(interp,\sthisObjectCommand)\son\sitself\sfor\sthe\sside\r\neffect\sof\sdestroying\sthe\sinstance\s(if\sa\smore\sdirect\sway\sof\sdoing\sthis\sexists\r\nplease\spoint\sme\sto\sit).\s\sSometimes\sthis\sdoes\sthe\sexpected\sthing\sand\scalls\sthe\r\ndestructor\sbefore\sreturning\sfrom\sthe\sTcl_DeleteCommandFromToken,\sbut\s\sunder\r\nother\scircumstances\s(haven't\sfound\sthe\srelevant\strigger\syet,\smaybe\sNR\scontext?)\r\nit\schains\sto\sthe\sdestructor\safter\sthe\sc\smethod\sthat\scalled\r\nTcl_DeleteCommandFromToken\sreturns.\s\sBut\sin\sthat\scase\s(without\scalling\sthe\r\ndestructor\syet)\sall\sthe\sobject\smetadata\shas\sbeen\sremoved\sand\sthe\snamespace\r\ndeleted\swhen\sTcl_DeleteCommandFromToken\sreturns,\scausing\ssome\sdifficulties\sfor\r\nthe\sdestructor\swhen\sit\sruns\slater.
J foundin 8.6.*,\s8.7a3
J is_private 0
J login cyan
J priority 5\sMedium
J private_contact 54152f94cb1628c0c148b4b5708ace53216227b0
J resolution None
J severity Severe
J status Open
J submitter cyan
J subsystem 10.\sObjects
J title Segfault\sin\sdestructor\susing\stsv::lock
J type Bug
K 28de60cef5133f1bd5c07dadf4d1a6e1989878c4
U cyan
Z 904426746866d17d6e92b0a15a10307f