Skip to content
Tcl Source Code History Of Ticket 868489ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 868489ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 868489ffffffffffffffffffffffffffffffffff

  1. Ticket change [acc0e46e74] (rid 101347) by kennykb on 2003-12-31 16:09:54:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Consider the following:
      
      set x -2366755200
      string is integer $x
      set y [expr { wide($x) }]
      
      The value of y that results is 1928212096
      
      The problem is that the generated code for
      the expression sees the "integer" internal
      representation and uses it, even though
      reconverting the string rep would yield a
      different value.  The particular code in
      question is in the "ExprCallMathFunc"
      function in tclExecute.c, but the problem
      appears to be pretty pervasive.
      
      It appears to be incorrect to promote an
      "integer" to a "wide" if the "integer" has a
      string representation.
      
    4. foundin initialized to: "obsolete: 8.4.5"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "kennykb"
    9. subsystem initialized to: "45. Parsing and Eval"
    10. title initialized to: "Incorrect promotion of int to wide"
    11. type initialized to: "Support"
  2. Ticket change [84b01c1634] (rid 117602) by dkf on 2004-01-05 22:27:33:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Why is [string is integer] setting the type of the object?
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  3. Ticket change [658830d737] (rid 102563) by kennykb on 2004-01-05 22:49:10:

    1. assignee changed to: "dkf"
    2. icomment:
      Logged In: YES 
      user_id=99768
      
      [string is integer] was just an example.  The code that first
      tripped over the bug actually used [clock format].  It fails on
      anything that gets into SetIntFromAny.
      
      
    3. login: "kennykb"
    4. mimetype: "text/plain"
    5. username: "kennykb"
  4. Ticket change [63b5fbfd03] (rid 92625) by dkf on 2004-01-20 05:28:22:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      The problem is how to fix this; how to detect that we are in
      an "annoying integer overflow" situation and mark the object
      so that we know when converting to wide to go from the
      string version and not the internal rep (which would
      otherwise be far faster.)
      
      :^/ At best, this is a huge amount of work to fix.  (New
      arithmetic object types require action in ever so many
      places!)  I don't think I'm likely to have the free time to
      take this on in the near future, so if anyone wishes to have
      a go, please feel free!
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  5. Ticket change [f06853eb32] (rid 109190) by kennykb on 2004-01-21 01:58:52:

    1. assignee changed to: "dgp"
    2. icomment:
      Logged In: YES 
      user_id=99768
      
      The given test case works in Tcl up until the change:
      2003-04-11  Don Porter  <[email protected]>
      
      * generic/tclCmdMZ.c (Tcl_StringObjCmd,STR_IS_INT):  Corrected
      inconsistent results of [string is integer] observed on systems
      where sizeof(long) != sizeof(int).  [Bug 718878]
      * tests/string.test: Added tests for Bug 718878.
      * doc/string.n: Clarified that [string is integer] accepts
      32-bit integers.
      
      But this change is an innocent victim; replacing [string is
      integer] with [clock format] will tickle the bug in earlier
      releases.
      
      
    3. login: "kennykb"
    4. mimetype: "text/plain"
    5. username: "kennykb"
  6. Ticket change [0f042100ee] (rid 94718) by kennykb on 2004-01-21 02:01:44:

    1. assignee changed to: "dkf"
    2. priority changed to: "7 High"
  7. Add attachment "868489.patch" [a7338ac51e] (rid 98749) by kennykb on 2004-04-22 02:25:37.

  8. Ticket change [ec0c656305] (rid 103641) by kennykb on 2004-04-22 02:25:37:

    1. icomment:
      
      
      File Added - 84569: 868489.patch
      
      Logged In: YES 
      user_id=99768
      
      It occurs to me that the easiest way to mark that the
      annoying overflow has occurred is simply to make it a
      wide integer instead of an ordinary one.
      
      The attached patch does the following:
      
      Makes Tcl_GetIntFromObj and Tcl_GetLongFromObj
      check for tclWideIntType as well as tclIntType, and do
      direct conversion of the intenal rep from wide to int
      (with a range check).  Also changes the conversion from
      string to a new SetIntOrWideFromAny.
      
      The new SetIntOrWideFromAny is just like the old
      SetIntFromAny except that it checks for integer overflow
      and uses a tclWideIntType instead of a tclIntType
      for values that don't fit in a 'long' - avoiding inconsistent
      internal reps.
      
      The existing SetIntFromAny has its range checks tightened
      to avoid setting an internal representation that is
      inconsistent with the string rep (an error is thrown instead).
      
      There are potential incompatibilities here because of the
      tightened range in SetIntFromAny and the fact that
      Tcl_GetIntFromObj is no longer guaranteed to leave a
      specific internal representation.  It is arguable that any
      code that runs afoul of either incompatibility is buggy
      anyway.
      
      New test cases provided for the obvious problem spots.
      
      
      
      
      
    2. login: "kennykb"
    3. mimetype: "text/plain"
    4. username: "kennykb"
  9. Ticket change [9b686024ba] (rid 111117) by dkf on 2004-04-22 02:59:47:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      That patch looks comparatively likely.  What is the impact
      of this sort of treatment on number handling in TEBC and its
      helpers?  I know that that code is *not* very clean, so it
      might get quite surprised...
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  10. Ticket change [e889464db5] (rid 104662) by kennykb on 2004-04-23 02:05:40:

    1. icomment:
      Logged In: YES 
      user_id=99768
      
      Uhm, Donal, much of that appears to be *your* code. :)
      
      Nevertheless, I took a few quick trolls through TEBC, and
      didn't see any *obvious* problems - all the code that
      accesses objPtr->internalRep.longValue seems to check
      the type first; likewise for wideValue.
      
      Emphasis on 'obvious' is intentional.
      
      
    2. login: "kennykb"
    3. mimetype: "text/plain"
    4. username: "kennykb"
  11. Ticket change [ea3f920bad] (rid 103336) by dkf on 2004-04-23 15:23:12:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Of course that code is my code.  How do you think I know it
      is a mess?  :^/
      
      I can't check the code right now; my sandbox has other toys
      in it (TIP#143 implementation as it happens) and I don't
      want to get them mixed up.  If/when I get that out of the
      way, I'll be able to work on this area in more detail.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  12. Ticket change [2e42378f54] (rid 119196) by dkf on 2004-09-11 04:53:23:

    1. closedate changed to: "2004-09-10T21:53:23"
    2. closer changed to: "dkf"
    3. icomment:
      Logged In: YES 
      user_id=79902
      
      Patch looked just about good enough to me
      Applied to HEAD and 8.4 branch
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: ""
    7. status changed to: "Closed"
    8. username: "dkf"
  13. Ticket change [a91e5e94c6] (rid 99105) by dgp on 2004-09-14 23:03:11:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Patch appears to have created
      new Bug 1027690.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  14. Ticket change [912d72b1f6] (rid 120581) by dkf on 2004-09-16 14:10:52:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      And it closed another bug (I've already forgotten the
      number) at the same time. Track the problem in 1027690...
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  15. Ticket change [1e89a3e561] (rid 90993) by dkf on 2004-09-16 15:17:34:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Oh, I see you fixed it already. :} And I see it was a simple
      fix. And I see that the reason I didn't find it in testing
      was endianness. Oh well.. Thanks for finding it.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  16. Ticket change [8921fe5c5d] (rid 131980) by dkf on 2008-11-02 18:31:57:

    1. foundin changed to: "None"
    2. icomment:
      
      
      data_type - 210894
      
      
      
    3. is_private changed to: "1"
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. subsystem changed to: "None"
    7. username: "dkf"
  17. Ticket change [f42b9025c1] (rid 129862) by dkf on 2009-07-29 19:41:11:

    1. icomment:
      
      
      IP - Comment Removed: 130.88.1.31
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"