Skip to content
Tcl Source Code History Of Ticket 1036649fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1036649fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1036649fffffffffffffffffffffffffffffffff

  1. Ticket change [b445b6bcac] (rid 125000) by dkf on 2004-09-28 23:22:08:

    1. assignee initialized to: "dgp"
    2. cmimetype initialized to: "text/plain"
    3. 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
      
    4. foundin initialized to: "obsolete: 8.4.7"
    5. priority initialized to: "9 Immediate"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dkf"
    9. subsystem initialized to: "18. Commands M-Z"
    10. title initialized to: "Buffer overrun in [subst]"
    11. type initialized to: "Bug"
  2. Ticket change [3ba1de616e] (rid 112778) by msofer on 2004-09-29 09:14:13:

    1. 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.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  3. Ticket change [b7adc8c665] (rid 128843) by msofer on 2004-09-29 09:14:14:

    1. icomment:
      
      
      File Added - 103128: 1036649.patch
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  4. Ticket change [03d5b4035e] (rid 119890) by dkf on 2004-09-29 15:25:26:

    1. assignee changed to: "msofer"
    2. subsystem changed to: "45. Parsing and Eval"
  5. Ticket change [5f69c0237a] (rid 115821) by dkf on 2004-09-29 17:36:13:

    1. 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
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  6. Add attachment "1036649.patch" [469d07b534] (rid 99548) by msofer on 2004-09-29 17:57:34.

  7. Ticket change [34752525a9] (rid 106765) by msofer on 2004-09-29 17:57:34:

    1. icomment:
      
      
      File Deleted - 103128: 
      
      
      
      File Added - 103169: 1036649.patch
      
      Logged In: YES 
      user_id=148712
      
      updated patch - still missing tests
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  8. Ticket change [c880a6c3a8] (rid 122112) by dkf on 2004-09-29 19:07:00:

    1. 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}}
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  9. Ticket change [cfe0ef4594] (rid 113066) by msofer on 2004-09-30 02:39:04:

    1. 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.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  10. Ticket change [d45512f72f] (rid 123426) by msofer on 2004-09-30 17:41:35:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      tests added to HEAD; code review not yet done
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  11. Ticket change [9f5400f6f4] (rid 96625) by dgp on 2004-10-27 03:54:48:

    1. 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.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Ticket change [575a6c3c33] (rid 94474) by dgp on 2004-10-27 04:58:09:

    1. assignee changed to: "davygrvy"
    2. closedate changed to: "2004-10-26T21:58:09"
    3. closer changed to: "dgp"
    4. 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.
      
      
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"
    9. username: "dgp"
  13. Ticket change [72e9a2a9a1] (rid 104950) by dgp on 2004-10-27 05:01:46:

    1. assignee changed to: "dgp"