Message147413
| Author |
pitrou |
| Recipients |
Arfrever, belopolsky, flox, nadeem.vawda, pitrou, python-dev, rosslagerwall, vinay.sajip |
| Date |
2011年11月10日.23:38:13 |
| SpamBayes Score |
1.4254056e-06 |
| Marked as misclassified |
No |
| Message-id |
<1320968294.41.0.481853718841.issue13309@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
It is definitely a glibc issue. Here's a C snippet to reproduce:
"""
#include <time.h>
#include <stdlib.h>
int main() {
time_t t;
struct tm tmp;
char str[200];
t = time(NULL);
tmp = *gmtime(&t);
tmp.tm_gmtoff = 0;
tmp.tm_zone = NULL;
strftime(str, sizeof(str), "%Z", &tmp);
puts(str);
t = -2461446500;
localtime(&t);
t = time(NULL);
tmp = *gmtime(&t);
tmp.tm_gmtoff = 0;
tmp.tm_zone = NULL;
strftime(str, sizeof(str), "%Z", &tmp);
puts(str);
return 0;
}
"""
Output:
CET
PMT
Calling localtime() or mktime() with a time largely in the past seems to corrupt the glibc's internal time structures (the "char *tm_zone[]"). |
|