Artifacts Associated With Ticket 1036649fffffffffffffffffffffffffffffffff
Ticket change [b445b6bcac] (rid 125000) by dkf on 2004-09-28 23:22:08:
- assignee initialized to: "dgp"
- cmimetype initialized to: "text/plain"
- comment initialized to:
This is not a problem in the HEAD. Repeatedly do this command. The error result is always strange and occasionally it crashes. (Seems random which.) subst {[set x 1;} GDB claims crash happened like this: Program received signal SIGSEGV, Segmentation fault. 0x0807e5ab in Tcl_SubstObj (interp=0x8103390, objPtr=0x810bd10, flags=7) at ../generic/tclCmdMZ.c:2578 2578 switch (*p) { The 'p' pointer seems to have overflowed well past the end of the objPtr->bytes parameter: (gdb) print p $1 = 0x812c000 <Address 0x812c000 out of bounds> (gdb) print objPtr->bytes $2 = 0x8127788 "[set x 1;" Looks like a buffer overrun to me, and [subst] is often exposed to external sources. => CRITICAL BUG - foundin initialized to: "obsolete: 8.4.7"
- priority initialized to: "9 Immediate"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dkf"
- subsystem initialized to: "18. Commands M-Z"
- title initialized to: "Buffer overrun in [subst]"
- type initialized to: "Bug"
Ticket change [3ba1de616e] (rid 112778) by msofer on 2004-09-29 09:14:13:
- icomment:
Logged In: YES user_id=148712 The problem seems to be in Tcl_EvalEx: it fails when it evaluates a nested script of unknown length (numBytes==-1) that is missing the closing ']' AND ends in ';' (a space after that seems not to trigger the buffer overflow). In any case, the attached patch to core-8-4-branch seems to fix it. There might be a more elegant to fix this ... Note that Tcl_EvalEx has been rewritten in HEAD; I did not yet check if the problemmight be there too.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [b7adc8c665] (rid 128843) by msofer on 2004-09-29 09:14:14:
- icomment:
File Added - 103128: 1036649.patch
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [03d5b4035e] (rid 119890) by dkf on 2004-09-29 15:25:26:
- assignee changed to: "msofer"
- subsystem changed to: "45. Parsing and Eval"
Ticket change [5f69c0237a] (rid 115821) by dkf on 2004-09-29 17:36:13:
- icomment:
Logged In: YES user_id=79902 Syntax error is reported wrongly. :^( When I did the following after applying your patch: subst "\[subst {};" I got this error: can't read "f": no such variable - login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Add attachment "1036649.patch" [469d07b534] (rid 99548) by msofer on 2004-09-29 17:57:34.
Ticket change [34752525a9] (rid 106765) by msofer on 2004-09-29 17:57:34:
- icomment:
File Deleted - 103128: File Added - 103169: 1036649.patch Logged In: YES user_id=148712 updated patch - still missing tests
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [c880a6c3a8] (rid 122112) by dkf on 2004-09-29 19:07:00:
- icomment:
Logged In: YES user_id=79902 Fix looks good. Suggested test (you might want to give it a different test number): test subst-12.1 {nasty case} { list [catch {subst "\[subst {};"} msg] $msg } {1 {missing close-bracket}} - login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [cfe0ef4594] (rid 113066) by msofer on 2004-09-30 02:39:04:
- icomment:
Logged In: YES user_id=148712 Fix and tests committed to core-8-4-branch. Still to do: commit the new tests to HEAD, check if HEAD has the flaw too.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [d45512f72f] (rid 123426) by msofer on 2004-09-30 17:41:35:
- icomment:
Logged In: YES user_id=148712 tests added to HEAD; code review not yet done
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [9f5400f6f4] (rid 96625) by dgp on 2004-10-27 03:54:48:
- icomment:
Logged In: YES user_id=80530 added more tests (subst-12.3,4) to show the effect of syntax errors on side effects. Test subst-12.3 illustrates a change in behavior from 8.4 to 8.5.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [575a6c3c33] (rid 94474) by dgp on 2004-10-27 04:58:09:
- assignee changed to: "davygrvy"
- closedate changed to: "2004-10-26T21:58:09"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 corrected HEAD to have same subst-12.3 results as the 8.4 branch. At this point [subst] does not crash and is consistent between 8.4 and 8.5.. Anyone wanted other mods to [subst] should file a separate report.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dgp"
Ticket change [72e9a2a9a1] (rid 104950) by dgp on 2004-10-27 05:01:46:
- assignee changed to: "dgp"