Today I tried to update my Squeak VM for Win10, 2004, and found out that the hearbeat primitives (primitiveUtcWithOffset/utcMicrosecondClock) are broken on Windows: DateAndTime now. "586455-01-18T09:55:51.955317+02:00"
Time utcMicrosecondClock. "18446744073363013317" The issue occurs both on 32-bit and 64-bit platforms, using a fresh Squeak Trunk image. I tried to narrow down the origin of this issue, but because bintray builds were defect or incomplete between 202010191814 and 202010200140, I can only tell that the issue was born somewhere in the interval (202009300634, 202010210155]. Without ever having read the relevant implementation, I would assume that the issue was introduced in — |
PS: Also, after keeping an empty Squeak image open for ~15 minutes, it breaks itself inside — |
In reply to this post by David T Lewis
Hi Christoph, first it's not true that Time is broken on Windows: Smalltalk os platformName 'Win32' It is true that unless you have 8.1 or later and have GetSystemTimePreciseAsFileTime in kernel32 then Time will not work. Here:
— |
In reply to this post by David T Lewis
Now, that said, I am happy to work with anyone to write this code such that it works on older versions. But the use of GetSystemTimePreciseAsFileTime is a huge improvement over the previous code. I apologise for breaking your setup, but I'm curious to understand why it did, given that GetSystemTimePreciseAsFileTime has been around since 8.0. BTW, I've been running this VM on Windows for hours using Terf without any issues with delays. HTH — |
In reply to this post by David T Lewis
Hi Eliot, I don't think this is a backward compatibility issue. As mentioned, I'm using Windows 2004 (Build 19041.572), which is definitely a younger Windows version than 8.1 (which was released in 2013 compared to 2020). Microsofts and its versioning chaos :-) And on my machine, time is definitively broken, or at least returning wrong values: Smalltalk os platformName. "'Win32'"
Smalltalk getSystemAttribute: 1007. "'CoInterpreter VMMaker.oscog-eem.2850 uuid: 4d7fc8a4-2c7d-4bad-8aeb-5f8c5766e12a Oct 21 2020'"
DateAndTime now. "586455-01-18T10:21:42.099068+02:00"
Time utcMicrosecondClock. "1194520452"
Should it be relevant that I am using the 64-bit edition of Windows? However, I can reproduce the issue using both the 32-bit and the 64-bit version of OSVM. — |
In reply to this post by David T Lewis
That's weird. What's the definition for Time class>>utcMicrosecondClock? It should be primitive 240. Also, if you write a C program to print out the result of GetSystemTimePreciseAsFileTime, and to convert it to the Smalltalk epoch via WindowsTime / 10 + (microseconds from 1601 to 1901), what does that look like? — |
In reply to this post by David T Lewis
It is. I'm using a fresh trunk image.
Did I mention that my C is very rudimentary? #include <stdio.h>
#include <windows.h>
int main(void) {
FILETIME ft;
ULARGE_INTEGER ui;
GetSystemTimePreciseAsFileTime(&ft);
ui.LowPart=ft.dwLowDateTime;
ui.HighPart=ft.dwHighDateTime;
printf("%i", ui.QuadPart / 10 - 9467020800000000);
} And it outputs:
Does this help? :-) — |
In reply to this post by David T Lewis
— |
In reply to this post by David T Lewis
Note that WINVER is defined differently in Makefile.tools and Makefile.msvc.tools... That explains why cygwin/mingw compilation took a different path. — |
In reply to this post by David T Lewis
Ah, thanks a lot, Nicolas! I confirm that the issues do no longer occur with the 202010232046 build. :-) — |
Free forum by Nabble | Edit this page |