ctime() was updated in 0.9.31 to call localtime_r() instead of localtime() to avoid using a static buffer. Unfortunately, this change replaces the static buffer (which is zeroed out on initialization) with an uninitialized local buffer. In the common case, this has no effect. However, with a sufficiently large time_t value, the value returned differs from that returned by asctime(localtime(t)), and thus violates the ANSI/ISO standard. An example input is (on a 64-bit machine): time_t t = 0x7ffffffffff6c600; When passed to uClibc 0.9.30.3, the resulting string is: "Sun Jan 0 15:32:16 1900" When passed to uClibc 0.9.31, the resulting string is: "??? ??? ?? 15:32:16 ????" The recommended fix is to zero-out the 'tm' struct using memset() before calling localtime_r.
(In reply to comment #0) > The recommended fix is to zero-out the 'tm' struct using memset() before > calling localtime_r. yes. Perhaps you could provide a testsuite entry for this one (test/time/tst-futimens1.c is a good example for a test)? That'd be awesome..
Created attachment 2239 [details] Patch containing testcase and proposed fix
Applied as 85b7ea33088fa16d319adbd228fc152f5b9da730. Thanks!