mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [bug] musl Daylight Saving Time across year bug
       [not found] <8d5aae4414f34d9eb0e8fbdd1f667428@huawei.com>
@ 2023-12-19  1:52 ` wanghaitao (G)
  2024-02-26  1:28   ` Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: wanghaitao (G) @ 2023-12-19  1:52 UTC (permalink / raw)
  To: musl


[-- Attachment #1.1: Type: text/plain, Size: 1308 bytes --]

Hello everyone,
I found a bug related to musl daylight saving time setting.
We are set to enter Daylight Saving Time at 10pm on the last day of 2021,
offset Daylight Saving Time by 2 hours, and end Daylight Saving Time on the first day of 2022.

However, it did not recover immediately after entering 2022, but it was delayed for more than ten hours before recovery to normal time.

We use the musl version 1.2.3
We put the TZ variable settings in /var/time/TZ and use soft links to use it.

cat /var/time/TZ
GMT-08:00DST-10:00:00,M12.5.5/18:45:0,M1.1.6/6:0:0
we have a soft link from /system/etc/TZ -> /var/time/TZ, and /etc/TZ -> /var/time/TZ
Here is our env info:
root:/# cat /proc/version
Linux version 5.10.97+ (z30045507@kwemhisprc00189) (aarch64-none-linux-gnu-gcc (
Arm GNU Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205, GNU ld (Arm GNU
Toolchain 12.2.Rel1 (Build arm-12.24)) 2.39.0.20221210) #1 SMP PREEMPT Thu Dec 1
4 10:14:45 CST 2023

After looking at the src code I found in the src/time/__tz.c:406, there is a comment:
FIXME: may be broken if DST changes right at year boundary? Also, this could be more efficient.

I would like to ask if the current bug is the FIXME written in the comments here. Is there any solution?

[cid:image003.png@01DA31CC.C3E3DA30]

[-- Attachment #1.2: Type: text/html, Size: 7708 bytes --]

[-- Attachment #2: image003.png --]
[-- Type: image/png, Size: 134348 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [musl] [bug] musl Daylight Saving Time across year bug
  2023-12-19  1:52 ` [musl] [bug] musl Daylight Saving Time across year bug wanghaitao (G)
@ 2024-02-26  1:28   ` Rich Felker
  0 siblings, 0 replies; 2+ messages in thread
From: Rich Felker @ 2024-02-26  1:28 UTC (permalink / raw)
  To: wanghaitao (G); +Cc: musl

On Tue, Dec 19, 2023 at 01:52:59AM +0000, wanghaitao (G) wrote:
> Hello everyone,
> I found a bug related to musl daylight saving time setting.
> We are set to enter Daylight Saving Time at 10pm on the last day of 2021,
> offset Daylight Saving Time by 2 hours, and end Daylight Saving Time on the first day of 2022.
> 
> However, it did not recover immediately after entering 2022, but it was delayed for more than ten hours before recovery to normal time.
> 
> We use the musl version 1.2.3
> We put the TZ variable settings in /var/time/TZ and use soft links to use it.
> 
> cat /var/time/TZ
> GMT-08:00DST-10:00:00,M12.5.5/18:45:0,M1.1.6/6:0:0
> we have a soft link from /system/etc/TZ -> /var/time/TZ, and /etc/TZ -> /var/time/TZ
> Here is our env info:
> root:/# cat /proc/version
> Linux version 5.10.97+ (z30045507@kwemhisprc00189) (aarch64-none-linux-gnu-gcc (
> Arm GNU Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205, GNU ld (Arm GNU
> Toolchain 12.2.Rel1 (Build arm-12.24)) 2.39.0.20221210) #1 SMP PREEMPT Thu Dec 1
> 4 10:14:45 CST 2023
> 
> After looking at the src code I found in the src/time/__tz.c:406, there is a comment:
> FIXME: may be broken if DST changes right at year boundary? Also, this could be more efficient.
> 
> I would like to ask if the current bug is the FIXME written in the comments here. Is there any solution?
> 
> [cid:image003.png@01DA31CC.C3E3DA30]

I looked at this briefly when you first posted it, but then I think it
slipped through the cracks. Thanks for bringing it to our attention. I
hope to follow up on it sometime after the upcoming 1.2.5 release.

BTW, is this a real timezone you're trying to make use of, or a
constructed corner case for testing purposes?

Rich

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-26  1:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <8d5aae4414f34d9eb0e8fbdd1f667428@huawei.com>
2023-12-19  1:52 ` [musl] [bug] musl Daylight Saving Time across year bug wanghaitao (G)
2024-02-26  1:28   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).