[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Weird time-zone oscillation



On Sun, Dec 13, 2009 at 06:14:41PM +0100, David Kubicek wrote:
> It may be your glib, but you didn't say if this also happens when using  
> just POSIX API (basic libc). If it's affected too, your system is borked  
> on a lower level. What you report is impossible unless there is a  
> serious bug (or rather data corrution) somewhere.
>
> I'm attaching a piece of code, same as yours except pure libc instead of  
> glib. Please, try it out and let me know whether it has the same issues.

No need, read further.

> After that, I'd make sure all relevant packages in your system are  
> up-to-date and not corrupted. You may want to "refresh" these:
>
> # apt-get update
> # apt-get install --reinstall libc6 tzdata libglib2.0-0 libglib2.0-data
>
> When we're sure relevant libraries are OK, we can explore other  
> possibilities if the issue persists. I doubt it will after this action,  
> unless, of course, you have some very peculiar configuration I cannot  
> imagine somewhere. :)

Once I reinstall the above packages, my own program seems to give
1260517800 as output consistently. Mysterious.

Now, let me move to your posix.c

[kumar@bluemoon ~] for i in `seq 1 10`;do ./a.out ;done
1260517800
1260521400
1260517800
1260517800
1260521400
1260521400
1260521400
1260517800
1260521400
1260521400

Again, please note the difference of 3600 seconds. Now, let's try it
with a time zone where there's no Daylight savings; my home time zone:

[kumar@bluemoon ~] for i in `seq 1 10`;do TZ=Asia/Calcutta ./a.out;done
1260480000
1260480000
1260480000
1260480000
1260480000
1260480000
1260480000
1260480000
1260480000
1260480000

I'm dumbfounded. But I'd REALLY like to get to the bottom of this!
Could you please help me explore the other possibilities which could
have lead to this?

Also, what output do you get if you run your posix.c with
TZ=America/Chicago?

Thank you very much for the pointers.

Kumar
-- 
But what can you do with it?
		-- ubiquitous cry from Linux-user partner

Attachment: signature.asc
Description: Digital signature


Reply to: