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[]"). |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2011-11-10 23:38:14 | pitrou | set | recipients: + pitrou, vinay.sajip, belopolsky, nadeem.vawda, Arfrever, flox, rosslagerwall, python-dev |
| 2011-11-10 23:38:14 | pitrou | set | messageid: <1320968294.41.0.481853718841.issue13309@psf.upfronthosting.co.za> |
| 2011-11-10 23:38:13 | pitrou | link | issue13309 messages |
| 2011-11-10 23:38:13 | pitrou | create | |