[prev in list] [next in list] [prev in thread] [next in thread] 

List:       musl
Subject:    [musl] [bug] musl Daylight Saving Time across year bug
From:       "wanghaitao (G)" <ouyang.wanghaitao () huawei ! com>
Date:       2023-12-19 1:52:59
Message-ID: 0202da277f3d4972a8a70571c5b39a73 () huawei ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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 del=
ayed 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 i=
t.

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 -> /va=
r/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 coul=
d 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 #5 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:DengXian;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:DengXian;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:"Microsoft YaHei";
	panose-1:2 11 5 3 2 2 4 2 2 4;}
@font-face
	{font-family:"Microsoft YaHei";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:DengXian;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
span.EmailStyle18
	{mso-style-type:personal;
	font-family:DengXian;
	color:windowtext;}
span.EmailStyle19
	{mso-style-type:personal-reply;
	font-family:DengXian;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-CN" link="#0563C1" vlink="#954F72" \
style="text-justify-trim:punctuation"> <div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">Hello \
everyone,<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">I found a \
bug related to musl daylight saving time setting. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">We are \
set to enter Daylight Saving Time at 10pm on the last day of 2021, \
<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">offset \
Daylight Saving Time by 2 hours, and end Daylight Saving Time on the first day of \
2022.<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">However, \
it did not recover immediately after entering 2022, but it was delayed for more than \
ten hours before recovery to normal time.<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">We use \
the musl version 1.2.3<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">We put \
the TZ variable settings in /var/time/TZ and use soft links to use \
it.<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">cat \
/var/time/TZ <br>
GMT-08:00DST-10:00:00,M12.5.5/18:45:0,M1.1.6/6:0:0<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">we have a \
soft link from /system/etc/TZ -&gt; /var/time/TZ, and /etc/TZ -&gt; \
/var/time/TZ<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">Here is \
our env info:<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">root:/# \
cat /proc/version<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">Linux \
version 5.10.97&#43; (z30045507@kwemhisprc00189) (aarch64-none-linux-gnu-gcc \
(<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">Arm GNU \
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205, GNU ld (Arm \
GNU<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">Toolchain \
12.2.Rel1 (Build arm-12.24)) 2.39.0.20221210) #1 SMP PREEMPT Thu Dec \
1<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">4 \
10:14:45 CST 2023<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">After \
looking at the src code I found in the src/time/__tz.c:406, there is a \
comment:<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">FIXME: \
may be broken if DST changes right at year boundary? Also, this could be more \
efficient.<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><b><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif">I would \
like to ask if the current bug is the FIXME written in the comments here. Is there \
any solution?<o:p></o:p></span></b></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif"><img \
width="1053" height="1052" style="width:10.9687in;height:10.9583in" \
id="_x56fe__x7247__x0020_3" src="cid:image003.png@01DA31CC.C3E3DA30" \
alt="cid:image003.png@01DA31CC.C3E3DA30"></span><span lang="EN-US" \
style="font-family:&quot;&#24494;&#36719;&#38597;&#40657;&quot;,sans-serif"><o:p></o:p></span></p>
 </div>
</body>
</html>


["image003.png" (image/png)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic