Skip to content
Tcl Source Code History Of Ticket 7deeddb36
Login

History Of Ticket 7deeddb36

Artifacts Associated With Ticket 7deeddb36

  1. Ticket change [6d48050bb8] (rid 198151) by chrstphrchvz on 2022-02-16 08:57:16:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      Setting <tt>Tcl_WideInt wideValue</tt> to the highest value representable by <tt>Tcl_WideInt</tt> and then doing <tt>wideValue++</tt> is signed integer overflow (undefined behavior).
      
      UBSan (<tt>-fsanitize=signed-integer-overflow</tt>) error when <tt>Tcl_WideInt</tt> is <tt>long long</tt>:
      
      <blockquote><pre>
      % scan -0x18000000000000000 {%li}
      <span style="font-weight:bold">tcl/generic/tclScan.c:926:13:<span style="color:red"> runtime error: </span>signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long long int'</span>
      -9223372036854775808
      </pre></blockquote>
      
      Likewise when <tt>Tcl_WideInt</tt> is <tt>long</tt>:
      
      <blockquote><pre>
      % scan -0x18000000000000000 {%li}
      <span style="font-weight:bold">tcl/generic/tclScan.c:926:13:<span style="color:red"> runtime error: </span>signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'Tcl_WideInt' (aka 'long')</span>
      -9223372036854775808
      </pre></blockquote>
      
      Increment only after casting to <tt>Tcl_WideUInt</tt> if wraparound behavior is desired (without e.g. <tt>-fwrapv</tt>); see attached patch.
      
    5. foundin initialized to: "core-8-6-branch"
    6. is_private initialized to: "0"
    7. login: "chrstphrchvz"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "chrstphrchvz"
    13. subsystem initialized to: "23. [scan]"
    14. title initialized to: "signed integer overflow in Tcl_ScanObjCmd()"
    15. type initialized to: "Patch"
  2. Add attachment "scanobjcmd-widemin.diff" [36c85fa3ae] (rid 198152) by chrstphrchvz on 2022-02-16 08:57:41.

  3. Ticket change [66a50f8b92] (rid 198167) by jan.nijtmans on 2022-02-16 14:34:58:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2459627.10761991"
    3. closer changed to: "jan.nijtmans"
    4. icomment:
      Fixed [0ac2e76e3f0b21cd|here]
      
      Thanks for the report!
      
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"
  4. Ticket change [7824bcad74] (rid 198197) by chrstphrchvz on 2022-02-17 02:26:48:

    1. closedate changed to: "2459627.60194681"
    2. closer changed to: "chrstphrchvz"
    3. icomment:
      I now notice the <tt>WIDE_MIN</tt> and <tt>WIDE_MAX</tt> macros in tclPort.h; should those be used instead for consistency? See use-wide-macros.diff.
      
    4. login: "chrstphrchvz"
    5. mimetype: "text/x-fossil-wiki"
  5. Add attachment "use-wide-macros.diff" [9eb3d05c0a] (rid 198198) by chrstphrchvz on 2022-02-17 02:27:54.