Debian lenny hangs on leap second

Kernels & Hardware, configuring network, installing services

Debian lenny hangs on leap second

Postby cortiver » 2009-01-01 02:10

My Debian Lenny computer hanged at precisely 23:59:59 Dec 31 UTC, just when the leap second should have been applied. Not even Alt+SysRq+REISUB worked, so I guess the kernel itself must have locked up. Has anyone else experienced the same thing? I'd like to find out where the fault lies so I can file a bug report, but I have no idea where to start. Since there's not going to be another leap second for a while it's going to be hard to reproduce this. For reference, I'm running ntpd and my timezone is posix/Australia/Sydney.
cortiver
 
Posts: 17
Joined: 2009-01-01 00:41

Postby BioTube » 2009-01-01 15:34

I don't think my system did(on the logic the 0:0:0-6:0:0=18:00:00 and I was using the machine then), but it's either in the kernel(unlikely, we've had other leapseconds before and it'd be shoddy programming not to handle them) or in your BIOS. I know some Zunes had a problem with this(consider yourself lucky that you didn't have to wait a day or two).
Image
Ludwig von Mises wrote:The elite should be supreme by virtue of persuasion, not by the assistance of firing squads.
User avatar
BioTube
 
Posts: 7551
Joined: 2007-06-01 04:34

Postby lancelot » 2009-01-01 18:46

I didn't know about this leap second. This morning I have seen thus morning that something occured on my system precisely upon the shift to 2009. I don't know what it is, maybe a bug on my account, but something unforeseen happened.

Has anyone else experienced the same thing?


No. The worse thing is that I had sworn I would be in front of my computer at 00:00:00 last night, but finally I accepted an invitation to party. I don't think I can consider myself to belong to geekdom anymore.

I don't know if my system hung upon entering the new year, but there could have been something unusual. I happen to have a script which loops infinitely on my computer in order to write the current time, day, month and year on my Logitech G15 keyboard LCD screen. The script runs a bit less than 10 times per second ( there's a "sleep 0.1" in the infinite loop).

In order to not waste too much CPU, I don't compute the current minute, hour, day, month and year at every call of the script. Instead it only computes the current second and tests if it is necessary to change the other values. Here's how:

Code: Select all
export sec=$(date +%S)
        # pour une raison inconnue, il faut un double crochet au niveau du test de $hour contre notdef. Pourquoi?
        if [ $sec == 00 ] || [ $min == notdef ] ; then export min=$(date +%M); if [ $min == 00 ] || [[ $hour == notdef ]] ; then export hour=$(date +%H); if [ $hour == 00 ] || [ $day == notdef ] ; then export day=$(date +%d) wkday=$(date +%A);  if [ $day == 01 ] || [ $mnth == notdef ] ; then export mnth=$(date +%B);  if [ $mnth == 01 ] || [ $year == notdef ] ; then export year=$(date +%Y); fi ; fi ; fi ; fi ; fi


"notdef" is simply the initial value of the environment variables, that I define in /etc/profile.

I've already witnessed that my script handles correctly the shift to a new minute, or to a new hour, or to a new day, or to a new month.

I very much wanted to see by myself if it managed to shift to a new year correctly, as that was the most demanding test condition. Instead I have left bash to work alone while I was shamefully socializing with human beings.

This morning it appeared that $day, $wkday and $mnth had been updated by the script correctly, but $year hadn't. I find it a bit strange because those four values should have been updated together precisely at the second of the new year.

Could this be related to the leap second?
User avatar
lancelot
 
Posts: 365
Joined: 2008-12-27 11:50
Location: France

Same thing here

Postby YannickPatois » 2009-01-02 00:51

Hi,

My machine also crashed precisely at 0:59:59 (screen froze, KDE bar displaying this time).

My current kernel is:
Linux 2.6.26-1-686 #1 SMP Mon Dec 15 18:15:07 UTC 2008 i686 GNU/Linux

This is an average 32 bits sempron 2600 machine.

I really doubt the BIOS is anyhow involved here. This is purely software, maybe not in kernel (NTP?), but, that's pretty strange...

I would be very interested to understand what's happened.

Yannick
YannickPatois
 
Posts: 1
Joined: 2009-01-02 00:25

Postby cortiver » 2009-01-02 00:51

lancelot wrote:
Code: Select all
export sec=$(date +%S)
        # pour une raison inconnue, il faut un double crochet au niveau du test de $hour contre notdef. Pourquoi?
        if [ $sec == 00 ] || [ $min == notdef ] ; then export min=$(date +%M); if [ $min == 00 ] || [[ $hour == notdef ]] ; then export hour=$(date +%H); if [ $hour == 00 ] || [ $day == notdef ] ; then export day=$(date +%d) wkday=$(date +%A);  if [ $day == 01 ] || [ $mnth == notdef ] ; then export mnth=$(date +%B);  if [ $mnth == 01 ] || [ $year == notdef ] ; then export year=$(date +%Y); fi ; fi ; fi ; fi ; fi


date +%B returns months in the form "January", "February", and so on, that is as words rather than numbers. So the line
Code: Select all
if [ $mnth == 01 ] || [ $year == notdef ]

should be
Code: Select all
if [ $mnth == January ] || [ $year == notdef ]

EDIT: I don't think you're gaining any CPU time by doing this way anyway. I'd imagine that the date command takes about the same time no matter which date format you request.

BioTube wrote:in the kernel(unlikely, we've had other leapseconds before and it'd be shoddy programming not to handle them)

There can always be bugs... There was apparently a bug in Linux 2.6.21 which caused hangs on leap seconds, but it's supposedly been fixed and the example code given in that thread for triggering the bug simply inserts a leap second without incident on my computer.

Also, there's a thread on debian-user in which some people seem to have had similar problems.

Edit2: And it's even on Slashdot...
cortiver
 
Posts: 17
Joined: 2009-01-01 00:41

Postby lancelot » 2009-01-02 03:35

You're right. Obviously it occurs it's a casual mistake on my share and not related to the leap second at all.

That's what it is with scripts you can debug only once a year (unless I wanted to mess with the system date, which I'd prefer not to do, be it just because of my web server). Thanks for the tip.

EDIT: I don't think you're gaining any CPU time by doing this way anyway. I'd imagine that the date command takes about the same time no matter which date format you request.


Probably true enough for the last sentence, but well, the thing is, I wanted to have it in a format that I haven't managed to obtain with a single call to date. Then it's sent to the g15composer which displays it on the LCD screen like this, along with some other text:

04:16:55
Friday January, 2nd 2009AD

(...)


And with blinking dots, mind you. Without the blinking dots, it's ugly.
In order to obtain this, the script does that:

Code: Select all
        echo -e (...) \"$hour$(if  let $(echo ${sec:1:2})%2==0 ; then echo : ; else echo \  ; fi )$min$(if  let $(echo ${sec:1:2})%2==0 ; then echo : ; else echo \  ; fi)$sec\" \"$wkday $mnth, $(if let ${day:0:1}!=0 ; then echo $day ; else echo ${day:1:2}  ; fi)$(if let ${day:1:2}==1 ; then echo st ; elif let ${day:1:2}==2 ; then echo nd ;  else echo th  ; fi) ${year}AD (...) > /path/to/a/named/pipe


Even though it's unefficient and consumes ressources, I want to have it this exact way and none else. Probably a bit of psychological rigidity on my share :oops: .

Although this little thing still consumes exagerated ressources compared to what it does, it's still better than multiple calls to the date command.
User avatar
lancelot
 
Posts: 365
Joined: 2008-12-27 11:50
Location: France


Return to System configuration

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable