Skip to content
Tcl Source Code History Of Ticket 5137b4387019d0e1
Login

History Of Ticket 5137b4387019d0e1

Artifacts Associated With Ticket 5137b4387019d0e1

  1. Ticket change [c44b000651] (rid 243616) by apnadkarni on 2025-07-31 06:40:17:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-markdown"
    4. comment initialized to:
      Failures disappear with -Od or -singleproc 0. Unix does not exhibit failures but MinGW build also show failures. Note only clock.test is run so not a result of other test files.
      
      ```
      nmake /f makefile.vc TESTFLAGS="-f clock.test -singleproc 1" test
      
      Running tests that match:  *
      Skipping test files that match:  l.*.test
      Only running test files that match:  clock.test
      Tests began at Thu Jul 31 12:04:51 +0530 2025
      clock.test
        Validity default mode: on
      
      
      ==== clock-31.1.vm:1 system locale FAILED
      ==== Contents of test case:
      
              clock format 0 -timezone :UTC -locale system -format %x
      
      ---- Result was:
      01/01/1970
      ---- Result should have been (exact matching):
      01-Jan-1970
      ==== clock-31.1.vm:1 FAILED
      
      
      
      ==== clock-31.2.vm:1 system locale FAILED
      ==== Contents of test case:
      
              clock format 0 -timezone :UTC -locale system -format %Ex
      
      ---- Result was:
      01/01/1970
      ---- Result should have been (exact matching):
      the 01' day of January 1970
      ==== clock-31.2.vm:1 FAILED
      
      
      
      ==== clock-31.3.vm:1 system locale FAILED
      ==== Contents of test case:
      
              clock format 0 -timezone :UTC -locale system -format %X
      
      ---- Result was:
      00:00:00
      ---- Result should have been (exact matching):
      12:00:00 AM
      ==== clock-31.3.vm:1 FAILED
      
      
      
      ==== clock-31.4.vm:1 system locale FAILED
      ==== Contents of test case:
      
              clock format 0 -locale system -format %x
      
      ---- Result was:
      01/01/1970
      ---- Result should have been (exact matching):
      31-Dec-1969
      ==== clock-31.4.vm:1 FAILED
      
      
      
      ==== clock-31.5.vm:1 system locale FAILED
      ==== Contents of test case:
      
              clock format 0 -locale system -format %Ex
      
      ---- Result was:
      01/01/1970
      ---- Result should have been (exact matching):
      the 31' day of December 1969
      ==== clock-31.5.vm:1 FAILED
      
      
      
      ==== clock-31.6.vm:1 system locale FAILED
      ==== Contents of test case:
      
              clock format 0 -locale system -format "%X %Z"
      
      ---- Result was:
      05:30:00 +0530
      ---- Result should have been (exact matching):
       7:00:00 PM EST
      ==== clock-31.6.vm:1 FAILED
      
      
      
      ==== clock-38.2.vm:1 make sure TZ is not cached after unset FAILED
      ==== Contents of test case:
      
              set t1 [clock format 0]
              # a time zone that is unlikely to anywhere
              set env(TZ) "+04:20"
              set t2 [clock format 0]
              unset env(TZ)
              set t3 [clock format 0]
              expr {$t1 eq $t3 && $t1 ne $t2}
      
      ---- Result was:
      0
      ---- Result should have been (exact matching):
      1
      ==== clock-38.2.vm:1 FAILED
      
      
      
      ==== clock-49.2.vm:1 regression test - missing time zone file (Bug 1237907) FAILED
      ==== Contents of test case:
      
              list [::tcl::clock::GuessWindowsTimeZone]  [clock format 0 -locale system -format "%H:%M:%S %Z"]  [clock format -86400 -format "%Y"]
      
      ---- Test generated error; Return code was: 1
      ---- Return code should have been one of: 0 2
      ---- errorInfo: localtime failed (clock value may be too large/small to represent)
          while executing
      "clock format -86400 -format "%Y""
          ("uplevel" body line 2)
          invoked from within
      "uplevel 1 $script"
      ---- errorCode: CLOCK localtimeFailed
      ==== clock-49.2.vm:1 FAILED
      
      
      Tests ended at Thu Jul 31 12:04:55 +0530 2025
      all.tcl:        Total   8724    Passed  8716    Skipped 0       Failed  8
      Sourced 1 Test Files.
      Files with failing tests: clock.test
      ```
      
    5. is_private initialized to: "0"
    6. login: "apnadkarni"
    7. priority initialized to: "5 Medium"
    8. private_contact initialized to: "9546e9877f1a8899e25a89082561ee694e7fb402"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "apnadkarni"
    13. subsystem initialized to: "- New Builtin Commands"
    14. title initialized to: "clock.test failures with -singleproc 1 on Windows"
    15. type initialized to: "Bug"
  2. Ticket change [a8d7d92d5e] (rid 243617) by apnadkarni on 2025-07-31 06:40:46:

    1. assignee changed to: "sebres"
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  3. Ticket change [60ff03fd3d] (rid 243618) by sebres on 2025-07-31 10:36:06:

    1. icomment:
      No idea, why I'm abrupt responsible for that errors (since this tests exist almost since begin of clock, and they are older than 20 years and I saw such errors already with 8.5), but OK...
      
      The tests have only conditionally the issue with -singleproc 1, and it goes to 
      the "timing" problem - the tests using "system" locale, for this TCL would need registry module under windows, but this cannot be used unless really installed.
      The root of the issue - tcltest also uses the clock ensemble (to output "Tests began at" on start), and the registry would not be found there, so a later usage in the same interpreter (if registry package gets provided by -load parameters) may be too late, so may cause that the registry would not be tried to load anymore, so after all the retrieved locale may be different.
      
      I made at some point (see [0c05a83862b9967c]) the registry package loadable in development environment, even uninstalled (pkgIndex tried to load it relative build folder). But it was ultimately reverted.
      
      The next fix I made in this direction was the loading of -load in tcltest to correct time (cannot find the commit now).
      
      Anyway I cannot reproduce it in MinGW (have no VS to hand right now), with both ways:
      <code><pre style="margin-left:10pt">
      $ make -j8 test TESTFLAGS="-file 'clock*.test' -singleproc 1"
      TCL_LIBRARY="/d/prj/tcl9.0/library"; export TCL_LIBRARY; \
       ./tclsh90.exe "../../tests/all.tcl" -file 'clock*.test' -singleproc 1 \
      -load "package ifneeded tcl::test 9.0.3 [list load tcltest90.dll Tcltest]; lappend ::auto_path {d:/prj/tcl9.0/tests}; package ifneeded dde 1.4.5 [list load tcl9dde14.dll]; package ifneeded registry 1.3.7 [list load tcl9registry13.dll]"
      Tests running in interp:  d:/prj/tcl9.0/win/Release_MGW64/tclsh90.exe
      Tests located in:  D:/prj/tcl9.0/tests
      Tests running in:  D:/prj/tcl9.0/win/Release_MGW64
      Temporary files stored in D:/prj/tcl9.0/win/Release_MGW64
      Test files sourced into current interpreter
      Running tests that match:  *
      Skipping test files that match:  l.*.test
      Only running test files that match:  clock*.test
      Tests began at Thu Jul 31 12:23:52 CEST 2025
      clock-ivm.test
        Validity default mode: off
      clock.test
        Validity default mode: off
      
      Tests ended at Thu Jul 31 12:23:58 CEST 2025
      all.tcl:        Total   17472   Passed  17472   Skipped 0       Failed  0
      Sourced 2 Test Files.
      
      $ make -j8 tcltest && ./tcltest.sh -file 'clock*.test' -singleproc 1
      make: Nothing to be done for `tcltest'.
      Tests running in interp:  d:/prj/tcl9.0/win/Release_MGW64/tcltest.exe
      Tests located in:  D:/prj/tcl9.0/tests
      Tests running in:  T:/Temp
      Temporary files stored in T:/Temp
      Test files sourced into current interpreter
      Running tests that match:  *
      Skipping test files that match:  l.*.test
      Only running test files that match:  clock*.test
      Tests began at Thu Jul 31 12:24:34 CEST 2025
      clock-ivm.test
        Validity default mode: off
      clock.test
        Validity default mode: off
      
      Tests ended at Thu Jul 31 12:24:40 CEST 2025
      all.tcl:        Total   17472   Passed  17472   Skipped 0       Failed  0
      Sourced 2 Test Files.
      </pre></code>
      The same is valid for clock.test only (single file).
      
      But I'd try to find the roots if I'd get VS to hand.
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  4. Ticket change [7893760088] (rid 243619) by apnadkarni on 2025-07-31 11:06:07:

    1. icomment:
      No, I didn't assign to you because I thought you are responsible :-) Rather I felt you are most knowledgeable about the clock implementation.
      
      I can reproduce it with MinGW as well so may be it is some configuration specific to my system.
      
      I don't think it has any urgency so no need for you to waste time on it. I'll come back to it at some point.
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  5. Ticket change [937d452082] (rid 243628) by sebres on 2025-07-31 13:46:23:

    1. icomment:
      No problem... 
      I tried to improve tests setups/cleans and rewrite them more system/locale/TZ independent, can you please test [557de3c0e552e76b].
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  6. Ticket change [1f20e60100] (rid 243631) by apnadkarni on 2025-07-31 14:06:01:

    1. icomment:
      Progress! Now down to a single bug each in clock.test and clock-ivm.test. Both VC++ and MINGW show same failure.
      
      ```
      Tests began at 2025-07-31 19:32:22 +0530
      clock-ivm.test
        Validity default mode: off
      
      
      ==== clock-38.2.vm:0 make sure TZ is not cached after unset FAILED
      ==== Contents of test case:
      
              set t1 [clock format 0]
              # a time zone that is unlikely to anywhere
              set env(TZ) "+04:20"
              set t2 [clock format 0]
              unset -nocomplain env(TZ)
              set t3 [clock format 0]
              expr {$t1 eq $t3 && $t1 ne $t2}
      
      ---- Result was:
      0
      ---- Result should have been (exact matching):
      1
      ==== clock-38.2.vm:0 FAILED
      
      clock.test
        Validity default mode: off
      
      
      ==== clock-38.2.vm:0 make sure TZ is not cached after unset FAILED
      ==== Contents of test case:
      
              set t1 [clock format 0]
              # a time zone that is unlikely to anywhere
              set env(TZ) "+04:20"
              set t2 [clock format 0]
              unset -nocomplain env(TZ)
              set t3 [clock format 0]
              expr {$t1 eq $t3 && $t1 ne $t2}
      
      ---- Result was:
      0
      ---- Result should have been (exact matching):
      1
      ==== clock-38.2.vm:0 FAILED
      
      
      Tests ended at 2025-07-31 19:32:29 +0530
      all.tcl:        Total   17472   Passed  17470   Skipped 0       Failed  2
      Sourced 2 Test Files.
      Files with failing tests: clock.test
      
      ```
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  7. Ticket change [69300fda8a] (rid 243633) by sebres on 2025-07-31 17:11:07:

    1. icomment:
      I have no idea what happens there (and cannot reproduce it)...
      The test is extended now with more informative result in error case.
      Can you try it again, please?
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  8. Ticket change [e4743546a4] (rid 243637) by apnadkarni on 2025-08-01 05:34:48:

    1. icomment:
      The `puts` outputs:
      
      With -singleproc 0 (passing):
      ```
      1 {"Thu Jan 01 05:30:00 IST 1970" eq "Thu Jan 01 05:30:00 IST 1970" && "Thu Jan 01 05:30:00 IST 1970" ne "Thu Jan 01 04:20:00 +04:20 1970"}
      ```
      
      With -singleproc 1 (fail):
      ```
      0 {"Thu Jan 01 01:00:00 +0530 1970" eq "Thu Jan 01 05:30:00 +0530 1970" && "Thu Jan 01 01:00:00 +0530 1970" ne "Thu Jan 01 04:20:00 +04:20 1970"}
      ```
      
      You were on the right track when you mentioned registry. Bisect shows:
      
      ```
        9 BAD     2024-11-06 20:33:01 b11c0b7e61e1f3c9 CURRENT
        5 GOOD    2024-11-04 20:39:42 1310d7228e6ffaeb
      ```
      
      Note the GOOD commit does not show any of the other failures I reported in the ticket either.
      
      The failing [commit](https://core.tcl-lang.org/tcl/info/b11c0b7e61e1f3c9) removes the registry dlls from the build, presumably to keep them out of the zipfs.
      
      A build without embedding zipfs (`nmake OPTS="noembed"`) shows no failures.
      
      So it has something to do with absence of the registry dll. I'm still puzzled as to 
      
      - why -singleproc 0 does not show the failure
      - why the failure does not show up on your system (may be my timezone makes a difference?
      - whether the absence of registry matters to clock.test since it seems to emulate the registry command with a dummy registry to prevent modification of the real registry
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  9. Ticket change [4d5425c278] (rid 243638) by sebres on 2025-08-01 10:33:48:

    1. icomment:
      Oops... No, it looks worse than I thought:
      
      Because <code>"$t1" eq "$t3"</code> shows that <code>t1</code> is:
      <code><pre>
      <b style="color:red;">- "Thu Jan 01 05:30:00 +0530 1970"</b>
      <b style="color:green;">+ "Thu Jan 01 01:00:00 +0530 1970"</b>
      </pre></code>
      So before the TZ (and epoch) change <code>t1</code> looks completely wrong if the test fails (red is OK, green is wrong) and obviously not equal 0 unix time in that TZ (+0530), looks more like CET (+0100).
      
      And this may point to something like wrong cache invalidation (e. g. of the current loaded TZ data) or something similar. And potentially, this is completely different bug, happening only on certain circumstances (e. g. the only difference I see at the moment is the "IST" vs. "+0530" as your current timezone).
      
      Anyway, thx for testing, I will try to figure it out.
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  10. Ticket change [fd4ec0b997] (rid 243722) by sebres on 2025-08-01 12:25:44:

    1. icomment:
      Well, it shall now be fixed in [ba25401d6eaac4b2] - it was basically simple and as assumed the cache. The circumstances are indeed "noregistry" and fallback to :localtime TZ, what by change of TZ env (so often as in test suite) may miss the change of epoch (since obtained twice and second time <code>dataPtr->lastTZEpoch == TzsetIfNecessary()</code> is true), so despite the cache of last base is invalid, it'd mistakenly considered as valid, because [/artifact?name=09367c49bdf09a99&ln=3478-3481|everything in check condition] is the same.
      This was definitely a bug and has now been fixed.
      
      Can you please give it a try again?
      
      I'll also provide new test later that covers this (no matter, with -singleproc 1 or 0).
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  11. Ticket change [64532b1e9a] (rid 243723) by apnadkarni on 2025-08-01 13:05:15:

    1. icomment:
      Looks good! I'm actually happy to know it was a real bug so your time spent was not a loss.
      
      Are the changes you made to the other tests (other than 38.2) still necessary?
      
      ```
      c:\src\tcltk\bisect\win>nmake /f makefile.vc /s /nologo test TESTFLAGS="-f clock*.test -singleproc 1"
      Tests running in interp:  c:/src/tcltk/bisect/win/Release_AMD64_VC1939/tcltest90.exe
      Tests located in:  C:/src/tcltk/bisect/tests
      Tests running in:  C:/src/tcltk/bisect/win
      Temporary files stored in C:/src/tcltk/bisect/win
      Test files sourced into current interpreter
      Running tests that match:  *
      Skipping test files that match:  l.*.test
      Only running test files that match:  clock*.test
      Tests began at 2025-08-01 18:29:09 +0530
      clock-ivm.test
        Validity default mode: off
      clock.test
        Validity default mode: off
      
      Tests ended at 2025-08-01 18:29:15 +0530
      all.tcl:        Total   17472   Passed  17472   Skipped 0       Failed  0
      Sourced 2 Test Files.
      ```
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  12. Ticket change [7782f20651] (rid 243724) by sebres on 2025-08-01 13:55:10:

    1. icomment:
      <i>> Are the changes you made to the other tests (other than 38.2) still necessary?</i>
      
      I think yes (at least it is not wrong), because [557de3c0e5] fixes the setup of test registry, and previously ::tcl::clock::NoRegistry did nothing, since unused anymore in new clock engine (and the tests would be wrong if no registry is there, they imply a wrapper ::testClock::registry would work only if _hasRegistry returns 1).<br/>
      Another part with setupTZ is just a simplification and code deduplication (but also resetting TCL_TZ everywhere, what could bother too).
      
      Thus I'd add more tests and merge it hereafter to all affected branches.<br/>
      Thx again!
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  13. Ticket change [6f1190bcec] (rid 243776) by sebres on 2025-08-04 16:06:40:

    1. assignee changed to: "nobody"
    2. closedate changed to: "2460892.17129748"
    3. closer changed to: "sebres"
    4. foundin changed to: "8.7+"
    5. icomment:
      In [aded3f3f0220b422] added test coverage for the switch of epoch and TZ-environment variable for the case if there is no registry.<br/>
      Merged now. Closed.
      
    6. login: "sebres"
    7. mimetype: "text/x-fossil-wiki"
    8. resolution changed to: "Fixed"
    9. status changed to: "Closed"
  14. Ticket change [2e80b97eb6] (rid 243789) by dgp on 2025-08-04 18:00:03:

    1. closedate changed to: "2460892.25003921"
    2. closer changed to: "dgp"
    3. icomment:
      
      The changes made to address this ticket included a change to
      the tcltest package.  When the tcltest package changes, it needs
      a version number bump, and to be kept in sync on all branches.
      I made a start at this, but then I see another concern...
      
      The change to tcltest gives me doubts.
      
      -    set timeCmd {clock format [clock seconds]}
      +    set timeCmd {clock format now -format "%Y-%m-%d %H:%M:%S %Z" -locale en}
      
      This is forcing the "timeCmd" used by the tcltest package to
      construct timestamps to always use the "en" locale.
      
      This seems like a very consequential thing to force on every
      user of the tcltest package in (presumably) a patch release.
      This will change output reporting by tcltest when run in non-en
      locales, right?  Many tcltest users who process tcltest output
      are likely to see their expectations overturned, right?
      
      Can't the testing of the clock command use other mechanisms to
      induce tcltest to act (as if it is) in the en locale?
      
      What am I missing?
      
    4. login: "dgp"
    5. mimetype: "text/plain"
  15. Ticket change [b6510c1753] (rid 243790) by sebres on 2025-08-04 18:57:58:

    1. closedate changed to: "2460892.2902586"
    2. closer changed to: "sebres"
    3. icomment:
      > This will change output reporting by tcltest when run in non-en locales, right?
      
      Well, it is not well correct, how [1b7d5ee5b46a96e8] says - it would now always output an ISO timestamp (which is obviously never locale dependent, since has only numeric values), but...
      
      This change basically serves multiple purposes and it'd:
      
        *  make the output of test case locale independent;
        *  avoid dependency to registry on windows (windows may need registry package to get system locale);
        *  help to avoid side effects, like a bit "unexpected" state of interpreter, but also different outputs on different test operation (installed/uninstalled, started from make or manually etc, but sometimes also the start and end timestamp (where end occurred after the registry is loaded);
        *  stop to load another locale (which is not needed now).
      
      In particular, for German user the difference in timestamp may look:
      <pre style="margin-left:10pt">
      # either like this (e. g. on uninstalled Tcl the locale may remain "en"):
      - Mon Aug 04 20:49:33 +0200 2025
      + 2025-08-04 20:49:42 +0200
      # or like this (e. g. on installed Tcl, the locale may be obtained from system):
      - Mo Aug 04 20:52:40 +0200 2025
      + 2025-08-04 20:49:42 +0200
      </pre>
      
      If you mean ISO timestamp is not good for the output of start/end time in the test-suite, we can revert [1b7d5ee5b46a96e8] - with the possible consequences I mentioned above.
      But they would happen only on certain circumstances.
      
    4. login: "sebres"
    5. mimetype: "text/x-fossil-wiki"
  16. Ticket change [4b60092ad1] (rid 243793) by dgp on 2025-08-05 15:58:44:

    1. closedate changed to: "2460893.16578738"
    2. closer changed to: "dgp"
    3. icomment:
      
      Thanks for the reply.  To summarize my understanding.
      
        * Yes, the change results in user-visible changes to tcltest output
        * The revised output is more robust, predictable, and standards
          compliant than the prior output.
      
      I plan to take the following steps.
      
        * Bump the tcltest version on the changed branches to 2.6.0
        * When version tcltest 2.6.0 is included in a Tcl release, include
          release notes information about the change.
        * I will not make tcltest 2.6 a part of Tcl 8.6.* releases (following
          the existing state where the change was not backported there).
      
    4. login: "dgp"
    5. mimetype: "text/plain"