So how about the following simple explanation?

According to POSIX.1-2017 tm_isdst must be set to 0 to indicate that
Daylight Savings Time
is not in effect for the specified time.



On Fri, May 14, 2021 at 6:28 PM Geva, Erez <erez.geva....@siemens.com> wrote:
>
> One of my hardest bug was one a single bit.
> Do not measure bugs by code. Measure by complexity.
>
> Erez
>
> -----Original Message-----
> From: Lars Munch <l...@segv.dk>
> Sent: Friday, 14 May 2021 18:14
> To: Geva, Erez (ext) (DI PA DCP R&D 3) <erez.geva....@siemens.com>
> Cc: linuxptp-devel@lists.sourceforge.net
> Subject: Re: [Linuxptp-devel] [PATCH 1/4] ts2phc: Fix uninitialized variable 
> in nmea_scan_rmc
>
> So much work for a one-liner. I see If I can come up with a better 
> explanation.
>
> On Fri, May 14, 2021 at 4:34 PM Geva, Erez <erez.geva....@siemens.com> wrote:
> >
> > Hi,
> >
> >
> >
> > I think it is better to use a short explanation how does mktime() use the 
> > tm_isdst flag, and why should it be set to 0.
> >
> > For me the problem is that we did not comply with proper use of mktime().
> >
> > Fixing glibc only revealed the bug in linuxptp.
> >
> > So we fix linuxptp, not trying to comply with a specific glibc!
> >
> >
> >
> > The choice of libc is up to the user, as long as it comply to the standards 
> > (ISO C or POSIX).
> >
> > I do not see the purpose of links to bugs in glibc.
> >
> > It is also does not helps the Developers to understand, why do we need the 
> > patch (which we do need).
> >
> >
> >
> > We are a source project, not a binary one
> >
> >
> >
> > Erez
> >
> >
> >
> > -----Original Message-----
> > From: Lars Munch <l...@segv.dk>
> > Sent: Friday, 14 May 2021 13:34
> > To: linuxptp-devel@lists.sourceforge.net
> > Subject: [Linuxptp-devel] [PATCH 1/4] ts2phc: Fix uninitialized variable in 
> > nmea_scan_rmc
> >
> >
> >
> > tm_isdst needs to be initialized to make sure mktime does not fail on 
> > recent versions of glibc
> >
> >
> >
> > See:
> >
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.redhat.com%2Fshow_bug.cgi%3Fid%3D1653340&amp;data=04%7C01%7Cerez.geva.ext%40siemens.com%7Cbb3c26d6fe6243c5653c08d916f35332%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C637566057003345547%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=%2BiIYzGcoTO%2FoSXwswIGKV%2B%2F1%2B%2FJ%2FTeNy0YmbS5vFMAo%3D&amp;reserved=0
> >
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceware.org%2Fbugzilla%2Fshow_bug.cgi%3Fid%3D24630&amp;data=04%7C01%7Cerez.geva.ext%40siemens.com%7Cbb3c26d6fe6243c5653c08d916f35332%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C637566057003345547%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=Z6FYtLeYtUpCZ%2B5zuv%2FBA8gLjTCns%2FtIU30UnYcytmE%3D&amp;reserved=0
> >
> >
> >
> > Signed-off-by: Lars Munch <l...@segv.dk>
> >
> > ---
> >
> > nmea.c | 1 +
> >
> > 1 file changed, 1 insertion(+)
> >
> >
> >
> > diff --git a/nmea.c b/nmea.c
> >
> > index dc865d0..44c7c01 100644
> >
> > --- a/nmea.c
> >
> > +++ b/nmea.c
> >
> > @@ -157,6 +157,7 @@ static int nmea_scan_rmc(struct nmea_parser *np, struct 
> > nmea_rmc *result)
> >
> >                }
> >
> >                tm.tm_year += 100;
> >
> >                tm.tm_mon--;
> >
> > +             tm.tm_isdst = 0;
> >
> >                result->ts.tv_sec = mktime(&tm);
> >
> >                result->ts.tv_nsec = msec * 1000000UL;
> >
> >                result->fix_valid = status == 'A' ? true : false;
> >
> > --
> >
> > 2.25.1
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> >
> > Linuxptp-devel mailing list
> >
> > Linuxptp-devel@lists.sourceforge.net
> >
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Flinuxptp-devel&amp;data=04%7C01%7Cerez.geva.ext%40siemens.com%7Cbb3c26d6fe6243c5653c08d916f35332%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C637566057003345547%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=W%2FcRIT%2FxVV%2BoClCJ%2Fpw1nOZFAwfC0rCsMu9oJra3O9g%3D&amp;reserved=0


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to