Date: Fri, 9 Jun 2017 22:36:29 -0500 From: "A. Wilcox" <awilfox@...lielinux.org> To: musl@...ts.openwall.com Subject: Re: detect timezone changes by monitoring /etc/localtime (like glibc) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 09/06/17 07:15, Rich Felker wrote: > On Fri, Jun 09, 2017 at 05:15:40PM +1000, Patrick Oppenlander > wrote: >> During some recent testing I came across a bug when adjusting >> timezones on an embedded system by changing /etc/localtime. The >> cause ended up being a behavioural difference between glibc and >> musl. > > This difference is intentional; I believe there are past > discussions in the list archives. > > Aside from the glibc behavior giving abysmal performance (syscalls > on every time operation), there's a more fundamental issue of > usability of the results. A common important idiom with time > functions is to perform several operations together in succession > to get a result -- for example, obtain the current time as time_t, > format it with localtime[_r], make some adjustment e.g. for a > relative time, then call mktime to convert back to time_t. Such > operations rely on the time zone being consistent for each > suboperation, which is true as long as the application does not > modify its own environment, but only assuming libc doesn't impose > asynchronous changes on the timezone. Fun and true facts: this has actually revealed itself as a horrible behaviour in Pidgin. When I moved from the east coast to the central US, I woke up my laptop and changed the TZ. It was running a glibc Linux at that point. Pidgin wouldn't make noise or show notifications until an hour went by; some internal counter had a local time_t and it thought it was receiving old notifications (since the timezone shifted backwards an hour). So this isn't a theoretical problem. It's a very real one. (And one I have yet to experience running musl Linux on my laptop now.) - --arw - -- A. Wilcox (awilfox) Project Lead, Adélie Linux http://adelielinux.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZO2k6AAoJEMspy1GSK50UcqoP/1+W4LHdIqHjiPLigvKJSuRG nr1DfpsFDyOxPYZa7fJMvkUrycsgM8o9kWlIuoGss8eqGQa6iW95hk4dVmnzjTOF YELSQYxZ0X0w2dFYC2i5WwLs5MuG2gjg1Egr70i5i2uFBkm2qkl5qtmX3hGdU6V/ yPtOOaAGvgLgrKxjq5BjlssGVgqhLtPD4Y3cT1HAg6UZMtKHN3hcufeRYbha12VE UW90k/XcoOOTvZCAAKZrbCbqzAjtuplIOB6uaTjNUpDmlhHXHy+uE4GJOQ3ohdWV 9occL5wGNsj+BM6+4qhhSmBTJdbHxwZ32t+0XWTejE0imDB1Y+zFphGX9utN6PwM Fkk6BcJTK8tg1/gbXwaHNYNe6L9hnnynnLo2tpWI64zZAgDDhUpkWx4sojAA795q 9AgjcbWucXxFkTA3gZfouWSBWpuOhUBPvvoFo0oIxbhTSzgCSEw+0C7WaVcPlPrh o7osd8WLm2U7ektOXgVSfOYBTMKYp49DekgVb4xVhSteA0L2p7BzZIxvPc0ebf7k jHPplp1WcDKJ/wJ6nybVxwRCrHDFa1lZZ62vdotKuzeNcUG2HPPlx68RA0Qsmtzw UP1yeUefOpoW1wq+jhBcV2HwLRyAZFLYqfuF/zyZ9cCBOBtC1U4uzbN0OBdAdOUX 6kwppw1yXr1xZQudzKjU =QbW2 -----END PGP SIGNATURE-----
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.