Skip to content
Tcl Source Code History Of Ticket 2845535
Login

History Of Ticket 2845535

Artifacts Associated With Ticket 2845535

  1. Ticket change [dfb26b4704] (rid 115054) by mistachkin on 2009-08-27 12:38:31:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      The following command triggers a crash in 8.4, 8.5, and HEAD:
      
      format "%.2147483647f" 2
      
      The following command triggers a crash in 8.5 and HEAD (in 8.4 it produces some kind of result):
      
      format "%2147483647.f" 2
      
      The following code (near line 2187) in "generic\tclStringObj.c" is a bit problematic due to unchecked usage of sprintf with a fixed size buffer:
      
          char spec[2*TCL_INTEGER_SPACE + 9], *p = spec;
          <snip>
          if (width) {
      p += sprintf(p, "%d", width);
      if (width > length) {
          length = width;
      } 
          }
          if (gotPrecision) {
      *p++ = '.';
      p += sprintf(p, "%d", precision);
      length += precision;
          }
      
      
    4. foundin initialized to: "obsolete: 8.6b1.1"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "mistachkin"
    10. subsystem initialized to: "16. Commands A-H"
    11. title initialized to: "crash issue with [format]"
    12. type initialized to: "Bug"
  2. Ticket change [0a0700d4e7] (rid 113744) by dkf on 2009-08-27 19:45:47:

    1. assignee changed to: "dgp"
    2. subsystem changed to: "10. Objects"
  3. Ticket change [325e5d69b0] (rid 93603) by mistachkin on 2009-08-27 19:58:58:

    1. icomment:
      Further analysis reveals that I am tired.  The actual line (near 2235) which causes the problem is:
      
      Tcl_SetObjLength(segment, sprintf(bytes, spec, d));
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  4. Ticket change [81795d0871] (rid 117044) by dgp on 2009-08-27 21:05:40:

    1. icomment:
      
      Any relation to 2838354 ?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  5. Ticket change [efbd17b214] (rid 109051) by dgp on 2009-08-27 21:05:41:

    1. priority changed to: "9 Immediate"
  6. Ticket change [ac0cdaece9] (rid 101226) by dgp on 2009-08-27 23:23:04:

    1. icomment:
      on the 8.5 and HEAD branches I see a 
      panic, not a crash:
      
      % format %.2147483647f 2
      Tcl_SetObjLength: negative length requested: -2147483329 (integer overflow?)
      
      In 8.4, I see:
      
      % format %.2147483647f 2
      % 
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  7. Ticket change [9c4ad130b3] (rid 96127) by dgp on 2009-08-27 23:23:05:

    1. title changed to: "string overflow panic in [format]"
  8. Ticket change [f6b1070a59] (rid 130338) by dgp on 2009-08-27 23:30:50:

    1. icomment:
      
      For the second example, on a system
      where I avoid a mem alloc panic, I also
      see a panic, not a crash:
      
      % format "%2147483647.f" 2
      Tcl_SetObjLength: negative length requested: -1 (integer overflow?)
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  9. Ticket change [fbbc128828] (rid 92118) by dgp on 2009-08-28 01:34:29:

    1. icomment:
      
      The Tcl code is not written with the possibility
      that sprintf() might raise an error, which according
      to the linux platform docs is done by returning
      a negative value.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  10. Add attachment "2845535.patch" [04c6492719] (rid 88930) by dgp on 2009-08-28 02:21:58.

  11. Ticket change [5d4946999b] (rid 115438) by dgp on 2009-08-28 02:21:58:

    1. icomment:
      
      
      File Added - 340830: 2845535.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Ticket change [3088fedff2] (rid 93273) by dgp on 2009-08-28 02:22:14:

    1. icomment:
      patch attached
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  13. Ticket change [07aaffd86f] (rid 89446) by dgp on 2009-08-28 02:35:09:

    1. icomment:
      
      patch committed to fix in 8.5.8+
      
      consider either Works For Me or Wont Fix for 8.4.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  14. Ticket change [9fc0ac7aed] (rid 96695) by dgp on 2009-08-28 02:35:14:

    1. closedate changed to: "2009-08-27T19:35:14"
    2. closer changed to: "dgp"
    3. icomment:
      
      
      allow_comments - 1
      
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dgp"