Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 11 Jun 2014 21:40:47 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: REG_STARTEND (regex)

On Wed, Jun 11, 2014 at 09:00:00PM -0400, bfdamkoehler wrote:
> 
> Hello,
> 
> I noticed an issue with localtime() in musl-1.1.2. In my environment
> TZ is set to EST5EDT. There is a test program below that
> demonstrates this. localtime() is returning with isdst == 1 for for
> a time_t value of 1394327858 (08-Mar-14 20:17). Daylight savings
> time starts on 09-Mar-14. Note that if you decrement the time_t
> value in the test program isdst remains set.
> 
> This time_t value is the st_atime value of a file on my machine, as
> returned by stat64().
> 
> Just as further test I moved the file around to an AIX 5.2 machine,
> HPUX 11.11, and OpenBSD 5.0 system and a Centos 6.5 linux machine. I
> used ls and tar on them to display the file date and they all came
> out as 08-Mar-14 20:17, as does the output from my application if it
> is linked with the gcc libc. When my application is linked with musl
> it produces a time of 08-Mar-14 21:17.
> 
> I just wanted to mention that I had noticed this.

I think the issue is just that you don't have a complete POSIX TZ rule
for EST5EDT written. With TZ=EST5EDT,M3.2.0/2,M11.1.0/2 (corresponding
to the current rules in effect for this timezone) I get the expected
output. Without specifying the full rule like this, I don't think you
can expect the right behavior since it changes every few years.
However, I think musl is also wrong not to have some sort of
meaningful default. I'll look into it more.

BTW if you intended to use the modern zoneinfo file rather than the
POSIX TZ string for EST5EDT, try TZ=:EST5EDT or TZ=US/Easter. glibc
may use the zoneinfo file before treating the string as a POSIX TZ
string but musl doesn't since doing so is non-conforming; the leading
':' can force it to treat it as a file though.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.