H.Merijn Brand wrote:
>> What's your LOCALTIME_MIN and LOCALTIME_MAX please?
>
> perl-current 103 > grep LOCALTIME_ config.sh
> sLOCALTIME_max='974284125319987199'
> sLOCALTIME_min='-62167219200'
That's year 0 to 30873836848. 0 makes sense, the other one I have no idea.
> # system time.h limits, as JSON
> { "gmtime": { "max": 42489252465868800, "min": -42489252465868800 },
> "localtime": { "max": 42489252465868800, "min": -42489252465868800 },
That's not a significant point either, and its troublesome that check_max is
getting different results than Configure. Its not a hard coded hint, is it?
>> If LOCALTIME_MAX is over 2**48 could you try localtime(2**48) in C please>> and see if the system library is at fault?> > tmp 107 > ./timecheck> 0:7fffffffffffffff: 1587287-03-17 15:30:07> 0:8000000000000000: 4293383948-10-16 08:29:52> ======================> Sizeof time_t = 8> 8:7fffffffffffffff: 1587287-03-17 15:30:07> max: 0x7fffffffffffffff 9223372036854775807> 8:8000000000000000: 4293383948-10-16 08:29:52> min: -0x8000000000000000 -9223372036854775808Well that ain't right.
> gmtime 2**48> ======================> Sizeof time_t = 8> 8: 1000000000000: 4292129631-11-18 10:44:16> 0x0001000000000000 281474976710656 >
> localtime 2**48> ======================> Sizeof time_t = 8> 8: 1000000000000: 4292129631-11-18 10:44:16> 0x0001000000000000 281474976710656That ain't right either. Should be 1346432780-9-28.
Does Time::y2038 pass tests?
What it looks like is your time functions go wonky in an unpredictable way.
So the binary search that check_max and Configure do will hit a good slice and
get stuck in it. Looks like this is going to have to be hard coded. Try this
little C program that walks through from 2**1-1 to 2**63-1 until the year
stops going up.
--
Whip me, beat me, make my code compatible with VMS! #include <time.h>
#include <stdio.h>
#include <math.h>
int main() {
time_t now;
int max = 63;
long double count;
struct tm *date;
int i;
int last_year = 70;
for( i = 1; i <= max; i++ ) {
count = powl(2,i) - 1;
now = (time_t)count;
date = gmtime(&now);
printf("2^%d-1 %s", i, asctime(date));
if( last_year > date->tm_year )
break;
last_year = date->tm_year;
}
return 0;
}