| Ticket UUID: | 1b8df101101c94cefa2caf9857e87b73cb5a3011 | |||
| Title: | Tcl_GetTime returns wrong usec value on Windows | |||
| Type: | Bug | Version: | 8.6 | |
| Submitter: | apnadkarni | Created on: | 2023-03-04 08:15:24 | |
| Subsystem: | 03. Timer Events | Assigned To: | jan.nijtmans | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Closed | Last Modified: | 2023-03-04 10:14:35 | |
| Resolution: | Fixed | Closed By: | jan.nijtmans | |
| Closed on: | 2023-03-04 10:14:35 | |||
| Description: |
When called from a stubs-enabled extension, Tcl_GetTime returns the wrong value for the usecs field on Windows. This is illustrated by the winTime-2.1 test failure in all Tcl versions 8.6 onward. The test failure was ignored all this while because of the comment in the test case that the test fails because of Windows OS discrepancies. Debugging reveals that it is in fact a Tcl bug cause by [these lines](https://core.tcl-lang.org/tcl/file?ci=tip&name=generic/tclDecls.h&ln=3967-3983) The usec value gets overwritten on line 3979 with the low 32 bits of the secs value (union with the reserved field). Based on the comment there, the purpose of that macro wrapper is to allow loading a non-Cygwin Tk into a Cygwin tclsh. I don't quite understand the issue there but in any case, it is the cause of the above bug. I don't know what the fix is because I don't know what the underlying issue is that is being fixed. As an aside, in my opinion supporting mixed Cygwin-native Win32 configurations is fraught with peril and should not be a supported configuration. | |||
| User Comments: |
jan.nijtmans added on 2023-03-04 10:14:35:
Fixed [b004b97979d5249c|here]. Thanks for the report! | |||