Artifact [5e31df23db]
Not logged in

Artifact 5e31df23db8ab233c884cb3e720fdb53308f89b935eadd222d70d8c1f1fde1c2:

Ticket change [5e31df23db] - Pending ticket [578155d5a19b348d|578155d5a1]: <i>Very rare bug (segfault) if set variable (with error case) using self-releasable object as new value</i> plus 5 other changes by sebres 2023-03-28 12:40:59.
D 2023-03-28T12:40:59.334
J closer nobody
J icomment Please\sdon't\sclose\sit.<br/>\r\nIf\ssomeone\sdoesn't\sunderstand\ssomething\s(or\sdoesn't\swant\sspent\smore\stime\sto\sgo\sdeeper),\sthis\sis\snot\sa\sreason\sto\sclose\sthe\sticket.<br/>\r\nRegarding\sthe\sexamples\s-\sthe\sticket\scontains\senough\sof\sthem\sto\sillustrate\sthe\swrong\sbehavior\sof\s<code>Tcl_ObjSetVar2</code>\sand\sco\sin\sthe\serror\scase.\r\n\r\nBasically\ssince\s<code>Tcl_ObjSetVar2</code>\sdoesn't\screate\san\sobject\sand\sdoesn't\srealy\sown\san\sobject\sin\scase\sof\serror\s(because\sit\sdoesn't\sin\scommon\ssense),\s<b>it\sshould\snot\sdecrease\sa\sreference\sin\serror\scase</b>\sat\sall,\seven\sless\son\scertain\sconditions\sonly\s(depending\son\sthe\sreference\scount\sof\sobject,\show\sit\sdoes\sright\snow)\s-\sthis\sis\sdirty\sworkaround\sand\snot\sa\ssolution.\sEspecially\sundocumented,\ssee\s[https://www.tcl-lang.org/man/tcl/TclLib/SetVar.htm|SetVar.htm].\s\r\nHowever\sthe\sonly\sway\sto\sfix\sit\sproperly\s-\suse\sa\snew\sflag\s<code>TCL_OWN_OBJREF</code>,\slike\sI\sdid\sit.\r\n\r\nAdditionally\sI'd\slike\sto\snote\sthat\safter\sthe\sfix\s[bc5e7bdafc922baf]\s(and\slater\swith\sa\snew\sflag\s<code>TCL_OWN_OBJREF</code>\sI\simplemented)\sI\snever\ssaw\sthis\sbug\sanymore\s(neither\sthe\sreference\serror,\snor\sthe\sleak).
J login sebres
J mimetype text/x-fossil-wiki
J resolution Fixed
J status Pending
K 578155d5a19b348dc1a9fe96cc2c067a59326a89
U sebres
Z 2bce9e36d2b7fbecb2c4af209f9918b1