OpenSmalltalk / opensmalltalk-vm

Cross-platform virtual machine for Squeak, Pharo, Cuis, and Newspeak.
http://opensmalltalk.org/
Other
563 stars 111 forks source link

Verify Y2k38 issue, 64-bit time #676

Open marceltaeumel opened 9 months ago

marceltaeumel commented 9 months ago

https://lwn.net/ml/debian-devel-announce/Zb0WpSukajgythGe@homer.dodds.net/

We might want to think about a strategy für 32-bit VM flavors and how OSVM (and Squeak, Cuis, ... for that matter) would be affected by this issue. Let's discuss this here.

eliotmiranda commented 9 months ago

Luckily our exposure is very small:

$ find src platforms -type f -exec grep -lw time_t {} \;
platforms/minheadless/unix/sqUnixHeartbeat.c
platforms/minheadless/unix/sqPlatformSpecific-Unix.c
platforms/minheadless/windows/sqWin32Backtrace.c
platforms/minheadless/windows/sqPlatformSpecific-Win32.c
platforms/Plan9/plugins/FilePlugin/sqPlan9file.c
platforms/Plan9/vm/sqPlan9io.c
platforms/Plan9/vm/sqPlatformSpecific.h
platforms/Mac OS/plugins/LocalePlugin/sqMacLocaleOS9.c
platforms/Mac OS/plugins/LocalePlugin/sqMacLocaleCarbon.c
platforms/Mac OS/vm/Developer/sqMacMinimal.c
platforms/Mac OS/vm/sqMacMain.c
platforms/Mac OS/vm/sqMacTime.c
platforms/Mac OS/vm/sqMacNSPluginUILogic.c
platforms/Mac OS/vm/sqMacTime.h
platforms/Cross/plugins/OggPlugin/sqOgg.c
platforms/Cross/vm/sqVirtualMachine.c
platforms/iOS/plugins/LocalePlugin/sqIOSLocale.c
platforms/iOS/plugins/FilePlugin/sqUnixFile.c
platforms/iOS/vm/Common/Classes/sqMacV2Time.c
platforms/iOS/vm/Common/Classes/sqSqueakMainApp.m
platforms/iOS/vm/Common/Classes/sqSqueakMainApplication.m
platforms/unix/misc/threadValidate/sqUnixHeartbeat.c
platforms/unix/plugins/LocalePlugin/sqUnixLocale.c
platforms/unix/plugins/FileAttributesPlugin/faSupport.c
platforms/unix/plugins/FileAttributesPlugin/faSupport.h
platforms/unix/plugins/FilePlugin/sqUnixFile.c
platforms/unix/vm-display-X11/sqUnixXdnd.c
platforms/unix/vm/sqUnixITimerTickerHeartbeat.c
platforms/unix/vm/sqUnixHeartbeat.c
platforms/unix/vm/sqUnixMain.c
platforms/unix/vm/sqUnixITimerHeartbeat.c
platforms/win32/vm/sqWin32Main.c
platforms/win32/vm/sqWin32Backtrace.c

And these uses are pretty localized:

$ grep time_t platforms/unix/vm/*
platforms/unix/vm/sqUnixHeartbeat.c:    time_t utctt;
platforms/unix/vm/sqUnixHeartbeat.c:  extern time_t timezone, altzone;
platforms/unix/vm/sqUnixITimerHeartbeat.c:  time_t utctt;
platforms/unix/vm/sqUnixITimerHeartbeat.c:  extern time_t timezone, altzone;
platforms/unix/vm/sqUnixITimerTickerHeartbeat.c:    time_t utctt;
platforms/unix/vm/sqUnixITimerTickerHeartbeat.c:  extern time_t timezone, altzone;
platforms/unix/vm/sqUnixMain.c:time_t convertToSqueakTime(time_t unixTime);
platforms/unix/vm/sqUnixMain.c:sqLong convertToLongSqueakTime(time_t unixTime);
platforms/unix/vm/sqUnixMain.c: * WARNING: On 32 bit platforms time_t is only 32 bits long.
platforms/unix/vm/sqUnixMain.c:time_t
platforms/unix/vm/sqUnixMain.c:convertToSqueakTime(time_t unixTime)
platforms/unix/vm/sqUnixMain.c:convertToLongSqueakTime(time_t unixTime)
platforms/unix/vm/sqUnixMain.c: time_t now = time(NULL);
platforms/unix/vm/sqUnixMain.c: time_t now = time(NULL);
platforms/unix/vm/sqUnixMain.c:  if (sizeof(time_t) != 4) error("This C compiler's time_t's are not 32 bits.");

I would expect we can deal with this in a few hours. I need to check what their proposed changes are, and then we can package the differences in abstractions, and deal with 32-bit and 64-bit time_t on 32-bit platforms pretty straight-forwardly. Thanks for the heads up!