- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
If it was January 19, 2038, you wouldn't be claiming "First!". I doubt any of us could. ;)
Admin
print "I suggest finding a new vendor!" sleep 1000000000 cls #Erase comment after 30+ years
Admin
Billionth!
(Er, mind you, that's a 'Murkin billionth. .elsewhere, read that as thousand-millionth....)
Admin
WTF!? How about just removing the last two lines of the script? How useful is it to have your application shut down/crash at some random moment in the distant future?
Admin
It would appear this one is fixed, at least in modern ubuntu. Sleep 10000<snip screenful of zeroes> seems to sleep just fine.
Admin
It's always best to let sleeping oracles lie.
Admin
Admin
Admin
Admin
Looks like a poor man's approach on implementing a SIGTERM shutdown hook for a service => The shutdown script will send SIGTERM on all processes remaining after executing the shutdown scripts. Some processes even refuse to accept that, but "sleep x" will do. Once sleep exited oracle gets terminated.
The real WTF is, why they didn't just put "oracle stop" into a shutdown script.
Admin
The standard assumption of the maintenance programmer is that if something looks completely nonsensical, it is probably that way for a reason, and shouldn't be tampered with for fear it could cause a problem.
In many cases this is true. Chances are good that there is a better, cleaner solution to the problem, but figuring out first what the problem was that the ugly kluge was meant to solve, and then figuring out the more elegant solution to that problem is a lot of work. Removing a zero is not a lot of work. Ergo, rather than hurting your brain trying to figure out why this mystical incantation was originally uttered, or putting your butt on the line by assuming that the original developer was a total moron and added these two lines for no reason whatsoever, you remove a zero, and go back to sleep.
Such is the life of the third class programmer.
Admin
I find this re-post very amusing this morning as news of this spreads:
http://arstechnica.com/news.ars/post/20081231-30gb-zunes-prepare-for-new-year-by-locking-up.html
I used to a Tier 2 agent for Zune Support - glad I don't work there anymore, as the phones are going to be ringing off the hook!
Admin
Not to excuse the lack of comment, but could that sleep have been put in there because of some historical issues Oracle's had with the uptime command?
Admin
Admin
Could someone explain "2^31-10^9" means? I never was very good at maths. Also, why is time stored as an epoch, and what will the solution to the problem be (in 2038)?
CAPTCHA: paratus - that act of repeating what was just said.
Admin
Hmmmm...
Do you suppose they'll fix this permanently once enough 0's have been shaved off?
That is ...
... I mean, this could give you a whole new definition for, "Problem came back."
Admin
http://xkcd.com/376/
Admin
Admin
Get him!
Admin
Admin
See it as (2^31)-(10^9), which is "(2 to the power 31) minus (10 to the power 9)". Basically, 2 billion (approx.) minus 1 billion.
Time on a computer is normally stored as a number of seconds since a particular date. That date is known as the "epoch" of that date system.
Most systems have been using 32-bit dates, which only gives you around 136 years (2^31 seconds, or around 4 billion seconds). In 2038, time will run out for UNIX and Linux systems still using 32-bit dates. Other OSes will vary depending on the Epoch, which can be in 1900, 1901, 1970 or any other year of choice.
The solution is to store the dates using more bits, e.g. 64 bits.
Admin
Over a decade ago I was using Aegis 9.7 in test equipment based on Apollo workstations, when I became aware of the 'date bug' in that OS.
Some far sighted OS designer had based the date routines on a 31-bit counter which was expected to overflow on 2 November 1997. I forget the exact time.
The consequence of the overflow was that if the workstation was shut down, it wouldn't boot again.
Since the system real time clock could only be set when the OS wasn't running, I was able to change the date, verify the problem, and reset the date to something which would allow a reboot.
For many years we operated in a time-warp, with the clocks set to 16 years in the past.
Admin
2^31 is two raised to the 31st or 2,147,483,648. The reason it is important is that a signed 32 bit integer can only hold up to that number minus one before overflowing (to -1). 10^9 is ten raised to the nineth (1,000,000,000). If you take the current time in seconds since 1970 (the epoch time) 1,230,795,313 and add 1,000,000,000 to it you get 2,230,795,313 which is larger than what can be stored in a signed 32 bit integer, so it overflows (due to two's complement) to -2,064,171,983. A sleep for a negative value returns immediately.
As for why we use the epoch, well, how else are you going to store it? A string? Yeah, that worked real well for the COBOL guys didn't it? Seconds since a fixed point in time is a good solution as it is easy to store and do math with.
The solution is to move to using a 64 bit integer, which should last us until the heat death of the universe (or an eleven digit year, which ever comes first). Hopefully, if we have found a way to reverse entropy by then, we will switch to a 128 bit integer before it becomes an issue.
Admin
Pain in the arse with the leap second though.
Y2038 problem will be bigger than Y2K for several reasons. It's more fundamental, being at the heart of the operating system rather than just numbers in a database. It's probably more widespread - any 32 bit Unix system suffers this issue. And it's harder for the layperson to understand, so there likely won't be as much awareness of it. Oh, and in some timezones it'll hit in the middle of the working day (assuming systems using UTC as their system clock, as they should).
True, there's 30 years for problematic systems to disappear. But the developers of Y2K bugged software didn't think it would still be in use in 2000.
Admin
Thanks for explaining that.
Does this mean therefore that any date calculations are really mathematical operations on the value of the epoch? Going back before the epoch is not a problem, because I just store a negative value?
I noticed in Reflector that the DataTime object stores its data as a 'ulong', which is an unsigned 64bit integer. Can .NET applications still be affected by the epoch overflow issue? Is it dependent on the underlying OS? More to the point, is Windows still using 32bit integers for the date, or has it upgraded already? Also, what about the BIOS clock, isn't the OS taking its value from there, meaning this isn't an OS issue, but rather a BIOS one?
Admin
Why was the sleep and stop there to begin with? Perhaps it was initially put in during development but with a shorter sleep to test something. Close to release somebody might have realized it needed to be changed, but it was deemed too dangerous to make any design changes that close to release, so rather than removing the lines it was decided that increasing the sleep time was safest - a real fix could always be done later.
Time passes everybody forgets about a problem that needs to be fixed and suddenly it blows up. When the problem becomes clear it was decided that during an emergency it is not a good idea to make any design changes, so it was decided that decreasing the sleep time was safest. A real fix would of course be necessary at a later point once the emergency was over.
If my guesses above are correct, I hope the people currently responsible for this software read this article, because they have probably forgotten that they have a pending problem that needs to be fixed.
BTW. The problem did sound somewhat similar to: http://en.wikipedia.org/wiki/Year_2038_Problem#Known_problems
Admin
Admin
The problem was probably something checking if the script terminated and causing more problems.
Admin
Admin
Another WTF is that some of you can actually think about all of these numbers on the day of Hangover. ;)
CAPTCHA: damnum - Too approprate for words (or numbers as the case may be).
Admin
What no one's posted when this failure would have occurred yet? Shame on you, and you call yourselves geeks. Tut-tut. ;-)
It's Saturday the 13th of May 2006 at 01:27:28 UTC by the way.
Admin
Going to the time before the epoch depends entirely on whether the value is stored as an unsigned or a signed value. Unix uses signed values, so you can use negative numbers to go to pre-1970 dates.
Pretty much all applications can, as long as the values are stored in a fixed-size variables, which is (as you can see) the case pretty much all the time.It just takes a really freaking long time if it's stored in a 64-bit integer. As said, signed 32-bit Unix date will wrap around in January 19, 2038. 64-bit Unix date will wrap around in December 4, 292277026596. They may have invented something better by then, but I'm not sure if I should be optimistic or pessimistic about that.
As a Linux guy I regrettably don't know the specifics on Windows. I'm just kind of assuming that 32-bit OSes use 32-bit variables and the 64-bit OSes have migrated already. Someone please correct me.Anyway:
Computers are hell of a multilayered abstract beasts! There are multiple layers of date storage. The computer has a hardware clock, the operating system has its own clock (operating systems are largely portable these days and they don't want to rely on any specific kind of a hardware clock - times change!), the low-level OS API uses one kind of abstraction, the various other programming languages on top of that use their own APIs, and all of the various bits along this glorious gigantic way use their own way of storing and processing the number.
None of these have necessarily any bearing on whether or not the other parts of the chain have any specific limitations. Your standard library can be perfectly capable of handling dates in 64-bit format... while your operating system, likewise a modern thing, is busy working around the deficiencies of your antiquated BIOS. The OS grins, tells the application the correct time value, while cursing at the machine behind the application's back. Hypothetical, but it can happen.
Admin
Admin
Time travel!
Admin
What everyone seems to miss is that many industries (specifically the financial industry) often needs to refer to dates 30 years in the future. For example, mortgages... As such, this is already an issue for many financial institutions and other companies that regularly need to refer to and store future dates.
Admin
Yeah, let's get the Zune New Years bug up on dailywtf. I mean, I know bugs are gonna happen sometimes, but when we have an event where all of a certain category of mp3/general media player fail at the same time for real, well I think that's worthy of coverage here.
-- Furry cows moo and decompress.
Admin
We might be ok though if enough systems have switched over to 64-bit computing by then. Also, there's actually a lot more awareness of this problem among the people that would have to fix it than I believe there was for the Y2K bug. Of course, I suspect The Media will still hype it up during the last few years, and especially months, before the Big Event.
Embedded Linux/Unix systems are probably at the biggest risk for meltdown since they're hard to get at and they tend to get forgotten about. For example: do you know which version of which OS your home router uses?
-- Furry cows moo and decompress.
Admin
Is it dependent on the underlying OS? More to the point, is Windows still using 32bit integers for the date, or has it upgraded already? Also, what about the BIOS clock, isn't the OS taking its value from there, meaning this isn't an OS issue, but rather a BIOS one?
32-bit Windows has always used 64-bit time, but it has a resolution of 100ns instead of 1 second, so it is more precise, but goes through them much more quickly. The valid date range is 1601 through 30827.
Admin
since the time of start is somewhat random the time of the crash is also random if you dont have started the application yet
Admin
Admin
Well, he's got 35 years and 11 months to find another fix:
Sat Nov 18 17:27:28 GMT 2034
Admin
doh! that should of course be 25 years!!
Admin
Admin
If possible, networked computers get their time from the internet, using NTP. BIOS time is used at boot time, and as a backup, if the network time is not available.
Accurate network time is required for some security protocols. Since the BIOS time may not be accurate, or even correct, servers may not communicate if network time is not available.
This is not a problem for workstations, because workstations normally assume that network time may not be available, and don't implement services that fail in its abscence.
Admin
I think I'll leave that for the Y3hG programmers to worry about.
Admin
So the only way to fix it is to either break the ABI (meaning all apps need to be recompiled at once) or introduce new APIs and modify the apps to use them.
64 bit apps on a 64 bit unix like OS will most likely be fine because the ABIs for 64 bit apps tend to use 64 bit time_t. 32 bit apps on a 64 bit OS will have the same problems as they did on a 32 bit OS. And they are likely to remain 32 bit for a long time. I don't see most embedded systems needing more than 4 gigs of ram.Admin
I suggest you look it up. With pictures.
Admin
A question for you: You're not located in Redmond, WA, are you?
Admin
Admin
Palm travelling towards face...