Skip to content
Tcl Source Code History Of Ticket 84a5355235
Login

History Of Ticket 84a5355235

Artifacts Associated With Ticket 84a5355235

  1. Ticket change [e414388ff6] (rid 217079) by pointsman on 2023-08-08 23:41:11:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-plain"
    4. comment initialized to:
      With Tcl trunk on linux (debian, gcc 10-2.1)
      
      puts [expr {(-549755813888 >> 32) & 0xFF}]
      
      returns 128 to me.
      
      On windows, build with mingw, gcc 8.1.0 the same line of
      code returns 255.
      
    5. foundin initialized to: "trunk"
    6. is_private initialized to: "0"
    7. login: "pointsman"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "4ca203a8e925aecdd9419645f936bccf18cd6ea7"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "pointsman"
    14. subsystem initialized to: "16. Commands A-H"
    15. title initialized to: "[expr {(-549755813888 >> 32) & 0xFF}]"
    16. type initialized to: "Bug"
  2. Ticket change [8d0a4419c1] (rid 217081) by pointsman on 2023-08-09 22:41:25:

    1. icomment:
      Confirmed for Tcl 9 on 64-bit Windows vc build, 8.7 on 32-bit linux,
      OpenBSD 32-bit machine: 8.6:128, 9.0:255, OpenBSD 64-bit machine, 8.6
      and 9.0: 128, mac M1 ARM: 128, by reports. The right answer would be
      128, I think.
      
      This is perhaps related:
      
      puts [expr {3537118876014219 >> 51}]
      
      Tcl 9 on 64-bit linux: 1 Tcl 9 on 64-bit Windows 0
      
    2. login: "pointsman"
    3. mimetype: "text/plain"
  3. Ticket change [df17903b96] (rid 217181) by pointsman on 2023-08-13 00:38:49:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      Apparently this was introduced with the implementation of TIP 484.
      Since [30f95df8b0] (5 and a half years ago!) the two examples given
      so far return the (I think) wrong result on 64-bit windows (the platform
      I tested, I suspect thats true for the other reported failing platforms
      also). Prior to that commit the results are the same as on 64-bit linux.
      
    3. login: "pointsman"
    4. mimetype: "text/x-fossil-plain"
  4. Ticket change [a3f2bdfb87] (rid 217201) by chrstphrchvz on 2023-08-13 14:49:17:

    1. icomment:
      In the case for <tt>INST_RSHIFT</tt> in <tt>TEBCresume()</tt> (tclExecute.c line 6080 on core-8-branch):
      <pre>
      		    /*
      		     * Quickly force large right shifts to 0 or -1.
      		     */<br />
      		    if (w2 &gt;= (Tcl_WideInt)(CHAR_BIT*sizeof(long))) {
      </pre>
      
      Changing <tt>sizeof(long)</tt> to <tt>sizeof(Tcl_WideInt)</tt> appears to fix this issue; I believe that is the appropriate fix since TIP 484 means 32-bit long is no longer used for Tcl integer values. I have not looked for whether the same fix is needed elsewhere for similar issues.
      
      I suggest that a test case for this issue be added to expr.test (only the right shift is important, not the bitwise AND).
      
    2. login: "chrstphrchvz"
    3. mimetype: "text/x-fossil-wiki"
  5. Ticket change [3b3e9c3274] (rid 217202) by jan.nijtmans on 2023-08-13 15:32:42:

    1. icomment:
      I'm on vacation now, without laptop. But reading the analysis, +1 for the proposed solution. A testcase would be very nice too!
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  6. Ticket change [702063e228] (rid 217203) by jan.nijtmans on 2023-08-13 15:34:20:

    1. foundin changed to: "8.7"
    2. icomment:
      Please fix 8.7 as well, I expect the same problem there
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
  7. Ticket change [bab4df61b8] (rid 217213) by chrstphrchvz on 2023-08-14 11:37:39:

    1. icomment:
      Better yet, I suggest following DRY and using <tt>sizeof(w1)</tt> instead, and then backporting the change and the test to 8.6.
      
    2. login: "chrstphrchvz"
    3. mimetype: "text/x-fossil-wiki"
  8. Ticket change [7d731ac94d] (rid 217314) by jan.nijtmans on 2023-08-23 20:22:00:

    1. icomment: "Fixed [e98c01d752|here] as suggested. Many Thanks!"
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  9. Ticket change [0d34e63e0a] (rid 217315) by jan.nijtmans on 2023-08-23 20:22:11:

    1. closedate changed to: "2460180.34873965"
    2. closer changed to: "jan.nijtmans"
    3. login: "jan.nijtmans"
    4. mimetype: "text/plain"
    5. resolution changed to: "Fixed"
    6. status changed to: "Closed"
  10. Ticket change [6568e09658] (rid 217345) by pointsman on 2023-08-24 23:14:54:

    1. closer changed to: "nobody"
    2. icomment:
      Thanks, that works for the reported cases and help me to continue
      my testing work with a Tcl 9 adapted tcllib branch.
      
      The root cause here was that sizeof(long) returns something else
      under 64-bit windows then on most other 64-bit platforms. That
      is obviously a problem: depending on input not always the same
      code path is called on different platforms.
      
      Beside the cases you fixed there are two more such sizeof(long)
      calls in tclExecute.c:
      
      [https://core.tcl-lang.org/tcl/file?udc=1&ln=8848&ci=73da5acb07ce0b3e&name=generic%2FtclExecute.c]
      
      [https://core.tcl-lang.org/tcl/file?udc=1&ln=8878&ci=73da5acb07ce0b3e&name=generic%2FtclExecute.c]
      
      Perhaps you can say much easier than me if this two are harmless - I would have to get familiar with that code first.
      
    3. login: "pointsman"
    4. mimetype: "text/x-fossil-plain"
    5. status changed to: "Open"
  11. Ticket change [804089efcf] (rid 217366) by jan.nijtmans on 2023-08-25 15:20:17:

    1. closedate changed to: "2460182.13909363"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      See: [6a9a8809f29fa1be]
      
      Closing now
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. status changed to: "Closed"