[Cuis-dev] ATTENTION. maybe nasty bug in Time management on Summer/Winter time change

Juan Vuletich juan at jvuletich.org
Tue Nov 9 13:19:48 PST 2021


After comments from Gerald (below) and Dave (at the opensmalltalk-vm 
issue you opened), this is my take.

This touches a rather basic area of the system, so any bug could affect 
a lot of code. Folks, please, review.

Thanks,

On 11/3/2021 1:08 PM, Nicola Mingotti via Cuis-dev wrote:
>
> I put it here:
> https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/602
>
> bye
> Nicola
>
>
>
>
> On 11/3/21 16:51, Nicola Mingotti wrote:
>>
>> Hi Gerald !
>>
>> thank you for looking into it !
>>
>> for me this is still too much above my head, I have
>> not tweaked the VM up to now, and this seems a central subject
>> that should be taken care by somebody who understands well
>> the possible consequences of a change.
>>
>> I am going to forward the problem to the vm mailing list.
>>
>> bye
>> Nicola
>>
>>
>>
>>
>>
>>
>>
>>
>> On 11/3/21 12:05, Gerald Klix wrote:
>>> Nicola,
>>>
>>> If you look at
>>>
>>> https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/634e4e3c8556a72d54f43beefc3069c60e594a21/platforms/unix/vm/sqUnixHeartbeat.c#L139 
>>>
>>>
>>> you see that "vmGMTOffset" is added to the new time.
>>> "vmGMTOffset" is updated here:
>>>
>>> https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/634e4e3c8556a72d54f43beefc3069c60e594a21/platforms/unix/vm/sqUnixHeartbeat.c#L150 
>>>
>>>
>>> which is only called during VM initialization:
>>>
>>> https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/634e4e3c8556a72d54f43beefc3069c60e594a21/platforms/unix/vm/sqUnixHeartbeat.c#L273 
>>>
>>>
>>>
>>> All this is only an educated guess.
>>>
>>>
>>> HTH, Gerald
>>>
>>>
>>> PS: This is really nasty, it may also ignore leap seconds:
>>>
>>> https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/634e4e3c8556a72d54f43beefc3069c60e594a21/platforms/unix/vm/sqUnixHeartbeat.c#L135 
>>>
>>>
>>>
>>> On 11/3/21 10:56 AM, Nicola Mingotti via Cuis-dev wrote:
>>>>
>>>> Hi guys,
>>>>
>>>> I report you what i discovered this morning.
>>>>
>>>> . I have 2 services running in Cuis in 2 independent Linux/Debian 
>>>> servers.
>>>>
>>>> . In weekend in Italy we changed time from CEST to CET
>>>>
>>>> . The OSes changed time correctly
>>>>
>>>> . But Cuis services are 1 hour forward !?!?
>>>>
>>>> . If i run a fresh new Cuis now in my laptop (Linux/debian vm), I 
>>>> see it has the correct time, corresponding to the OS time
>>>>
>>>> . I did not change my localTimeZone in Cuis, in any machine. It is 
>>>> acceptable for me it says UTC
>>>>    even if it is actually localtime.
>>>>
>>>> . Seeing 'DateAndTime now' I discovered that Cuis by default uses 
>>>> primLocalMicrosecondClock, so it should
>>>>    always use the OS local clock and think it is in the UTC 
>>>> timezone. But, it is not doing
>>>>    so on images that were started some days ago (max 20). It does 
>>>> so on new run images.
>>>>
>>>> I don't know well how to fix this. Maybe some time config is made 
>>>> when Cuis starts up?
>>>> It seems it is remembering the time when it was stared.
>>>>
>>>>
>>>> EXTRA. NOT IMPORTANT AS THE PREVIOUS.
>>>> If there are some changes to make I have a suggestion for improvement.
>>>> Could we set localTimeZone to "system", or "local" ? At present we 
>>>> are reading localTime from the OS
>>>> and setting to UTC. Which is a bit confusing.
>>>>
>>>> bye
>>>> Nicola
>>>>
>>>>
>>>>
>>>>
>>
>


-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20211109/11d483ab/attachment-0001.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4972-Remove-TimeZone-JuanVuletich-2021Nov09-16h47m-jmv.001.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20211109/11d483ab/attachment-0005.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4971-Cleanup-JuanVuletich-2021Nov09-16h44m-jmv.001.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20211109/11d483ab/attachment-0006.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4970-Cleanup-JuanVuletich-2021Nov09-16h43m-jmv.001.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20211109/11d483ab/attachment-0007.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4969-Tweak-JuanVuletich-2021Nov09-16h29m-jmv.001.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20211109/11d483ab/attachment-0008.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4968-UseUTCtimePrimitives-JuanVuletich-2021Nov09-15h59m-jmv.002.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20211109/11d483ab/attachment-0009.ksh>


More information about the Cuis-dev mailing list