<i>Very rare bug (segfault) if set variable (with error case) using self-releasable object as new value</i> status still Open with 3 other changes
by
dgp
2018-01-13 16:45:43.
D 2018-01-13T16:45:43.473
J icomment >\sIf\sthere's\ssome\sscenario\sthat\sframework\swill\snot\shandle\sproperly\r\n>\sI'm\sgenuinely\sinterested\sin\sknowing\swhat\sit\sis.\s\sI\sneed\sa\sdemo.\r\n\r\nAllow\sme\sto\smake\sthat\smore\sprecise.\r\n\r\nIf\scallers\sof\sTcl_ObjSetVar2\sfollow\sthe\sadvice\sI\sspelled\sout\sbefore,\r\nthere\swill\sbe\sno\smemory\sleak,\sand\sthere\swill\sbe\sno\ssegfault\sdue\sto\r\na\sdouble-free\sof\sthe\svalue.\s\sI\sdon't\sknow\sof\sany\scounterexample,\r\nand\syou\shave\snot\sgiven\sme\sone.\s\sThat's\swhat\sI\smean\swhen\sI\sclaim\r\nthat\sTcl_ObjSetVar2()\sis\sbug-free\swhen\scalled\sproperly.\sNote\sthat\r\nin\smost\scases\s"called\sproperly"\smeans\sdo\snothing\sabout\sthe\r\nrefcount\sof\svalue\sat\sall,\swhich\sis\svery\sconvenient.\r\n\r\nNow\sit's\sbecoming\smore\sclear\sto\sme\sthat\syour\sobjection\sis\sa\sbit\r\ndifferent.\sYou\snot\sonly\sseek\sto\savoid\smemleaks\sand\sdouble-frees,\r\nbut\salso\sseek\sto\savoid\sturning\sunshared\svalues\sinto\sshared\svalues,\r\nand\syou're\slooking\sfor\san\simprovement\sthat\scan\sachieve\sthat\stoo.\r\n\r\nI\sdon't\sfully\sunderstand\syour\sTCL_OWN_OBJREF\sidea,\sand\sthe\r\nbranch\s\sfix-8-5-578155d5a19b348d\sseems\sto\sbe\sout\sof\sdate.\r\nIs\sthere\sa\spatch\sanywhere\sof\sthe\schange\syou\sseek?\r\n\r\nI\sthink\sat\sa\sminimum,\sany\schange\sto\sTcl_ObjSetVar2()\shas\sto\r\nkeep\sthe\sfollowing\sexisting\scalling\sconvention\soperating\r\nsuccessfully\swithout\sleaks\sor\scrashes:\r\n\r\nif\s(NULL\s=\sTcl_ObjSetVar2(interp,\sarr,\selem,\sTcl_NewObj(),\sflags))\s{\r\n\s\s\s\s/*\sHandle\serror\s*/\r\n}\r\n\r\nDoes\syour\sproposed\spatch\spreserve\sthis\s'fire\sand\sforget'\smode\sof\r\noperation?\s\sOr\sdoes\sit\simpose\sthe\sburden\sof\sneeding\sto\sadd\sthe\r\nTCL_OWN_OBJREF\sflag\sto\sflags\sin\sorder\sto\smaintain\sthat\sfunctionality?
J login dgp
J mimetype text/plain
K 578155d5a19b348dc1a9fe96cc2c067a59326a89
U dgp
Z 635a05c0493a755d2067ff00cd86604c