Artifacts Associated With Ticket 82e7f67325
Ticket change [144e5c4580] (rid 137807) by andy on 2014-04-29 22:54:40:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Version [4492d3b64521aaee] introduced a SIGSEGV when the following code is executed: apply {{} {string length [string replace ___! 0 2 ab]}} - foundin initialized to: "4492d3b64521aaee"
- is_private initialized to: "0"
- login: "andy"
- priority initialized to: "5 Medium"
- private_contact initialized to: "662c23482b0bf6a505f39e48fb7ad43af8dee4d3"
- resolution initialized to: "None"
- severity initialized to: "Critical"
- status initialized to: "Open"
- submitter initialized to: "andy"
- subsystem initialized to: "47. Bytecode Compiler"
- title initialized to: "SIGSEGV due to [string replace]"
- type initialized to: "Bug"
Ticket change [e57ad08bc9] (rid 137808) by aku on 2014-04-29 23:09:27:
- assignee changed to: "dkf"
- login: "aku"
- mimetype: "text/plain"
Ticket change [59156f2f06] (rid 137809) by anonymous on 2014-04-30 01:11:06:
- icomment:
apply {{} { set a [join {a b} {}] puts [string length [string replace ___! 0 2 $a]] ;# doesn't crash puts [string length [string replace ___! 0 2 $a[unset a]]] ;# crashes }} it looks like it can happen when the replacement is unshared (suggesting it's trying to edit in place?) possible cause at tclExecute.c:5705 - the only way into that block is when value3Ptr is unshared, then it's used as the result, and the refcount is subsequently decremented, and the result obj gets freed. - login: "anonymous"
- mimetype: "text/plain"
- icomment:
Ticket change [81a9a196c7] (rid 137819) by dkf on 2014-04-30 20:58:14:
- icomment:
Your longer <tt>apply</tt> crashes for me (and will be a reasonable test case with adjustment). Your analysis is likely right too.
- login: "dkf"
- mimetype: "text/html"
- priority changed to: "9 Immediate"
- username: "dkf"
- icomment:
Ticket change [3e83e6c5da] (rid 137825) by dkf on 2014-04-30 21:26:15:
- closedate changed to: "2456778.39323309"
- closer changed to: "dkf"
- icomment:
We now have tests that check for both releasing the refcount too early, and also for not releasing the refcount at all (a memory leak) and we now pass those tests.
- login: "dkf"
- mimetype: "text/html"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dkf"
Ticket change [305f50e8ae] (rid 137826) by andy on 2014-04-30 21:48:41:
- closedate changed to: "2456778.4088174"
- closer changed to: "andy"
- icomment:
Well, that strange. I apologize for the typo. In the original ticket, I had meant to say [join {a b} {}] instead of simply ab. The point was to get an unshared value. Sorry again for the misdirection, and thanks for the fix. - login: "andy"
- mimetype: "text/plain"
Ticket change [a6fba27dfa] (rid 137841) by dkf on 2014-05-01 09:04:51:
- closedate changed to: "2456778.87837497"
- closer changed to: "dkf"
- icomment:
Not a problem, but I might look into other ways to generate the string to insert (so that it will stay unshared even if we optimise further).
- login: "dkf"
- mimetype: "text/html"
- username: "dkf"