Skip to content
Tcl Source Code History Of Ticket da340d4f32
Login

History Of Ticket da340d4f32

Artifacts Associated With Ticket da340d4f32

  1. Ticket change [de13a52f36] (rid 144974) by apnadkarni on 2016-02-24 06:09:53:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      Tests clock-55.9 and clock-55.10 fail for all 8.6.* code bases on 64-bit
      Windows when using the Windows 2003 SDK compiler (in particular, this
      includes ActiveState releases since they are built with that compiler).
      
      32-bit builds do not exhibit these failures. 64-bit builds with optimization
      disabled and 64-bit builds with newer Visual Studio (2013) also do not
      exhibit the failure.
      
      It appears that the failures are caused by the following statement on
      line 1502 of tclClock.c
      
          ym1o4 = ym1 / 4;
      
      When ym1 is -1 (0001 B.C.), the 2003 SDK compiler sets ym1o4 to -1
      (towards -infinity) whereas the VS 2013 compiler sets ym1o4 to 0 (towards 0).
      Thus test results are off by exactly one day.
      
      I thought this is a compiler bug, but the ANSI C 89 standard states:
      
      "If either operand is negative, whether the result of the / operator is
      the largest integer less than the algebraic quotient or the smallest
      integer greater than the algebraic quotient is implementation-defined"
      
      Although the specific test case trigger based on negative years, my fear
      is that there are other possibly more common failures lurking as integer
      division and % operations are (obviously) used in many places in the clock
      implementation and may involve negative operands.
      
      Replacing the above line with the following fragment
      
          if (ym1 >= 0)
              ym1o4 = ym1 / 4;
          else {
              ym1o4 = - (((unsigned int) -ym1) / 4);
          }
      
      (the cast is necessary) seems to fix the problem. But note there are many
      other places that would need a similar fix and I would suggest too risky a
      change for 8.6.5
      
      /Ashok
      
    5. is_private initialized to: "0"
    6. login: "apnadkarni"
    7. priority initialized to: "5 Medium"
    8. resolution initialized to: "None"
    9. severity initialized to: "Minor"
    10. status initialized to: "Open"
    11. submitter initialized to: "apnadkarni"
    12. subsystem initialized to: "16. Commands A-H"
    13. title initialized to:
      clock test failures clock-55.9 and clock-55.10 on 64-bit Windows
      
    14. type initialized to: "Bug"
  2. Ticket change [04802fc568] (rid 144975) by apnadkarni on 2016-02-24 06:11:52:

    1. assignee changed to: "kbk"
    2. icomment:
      For anyone familiar with x64 assembler (and in case it helps), below is the disassembly.
      
      
      SDK 2003 (test failures)
      
      000000001002DD74  cdq  
      000000001002DD75  and         edx,3  
      000000001002DD78  mov         r13d,eax  
      000000001002DD7B  lea         r15d,[rdx+rax]  
      000000001002DD7F  sar         r13d,2  
      000000001002DD83  and         r15d,3  
      000000001002DD87  sub         r15d,edx
      
      VS2013 (no test failures)
      0000000068932C96  mov         eax,r14d  
      0000000068932C99  cdq  
      0000000068932C9A  and         edx,3  
      0000000068932C9D  add         eax,edx  
      0000000068932C9F  mov         esi,eax  
      0000000068932CA1  and         eax,3  
      0000000068932CA4  sub         eax,edx  
      0000000068932CA6  sar         esi,2  
      0000000068932CA9  mov         ebp,eax
      
    3. login: "apnadkarni"
    4. mimetype: "text/plain"
  3. Ticket change [2bdd65cc6a] (rid 147812) by apnadkarni on 2016-07-10 06:42:59:

    1. icomment: "Fixed in check-in [b6a05c2cebf] for 8.6.6"
    2. login: "apnadkarni"
    3. mimetype: "text/x-fossil-wiki"
  4. Ticket change [83f04f3f0a] (rid 147813) by apnadkarni on 2016-07-10 06:44:16:

    1. closedate changed to: "2457579.78074166"
    2. closer changed to: "apnadkarni"
    3. login: "apnadkarni"
    4. mimetype: "text/plain"
    5. resolution changed to: "Fixed"
    6. status changed to: "Closed"