The computer glitch that could cause chaos
Lost satellites, errant missiles and planes falling from the sky: Why the number 2,147,483,647 could be about to wreak havoc with the world.Peter Iantorno May 12, 2015
With the Gulf War in its final throes of violence, on February 25, 1991, Iraqi forces fired a scud missile towards an American barracks in Dhahran, Saudi Arabia. While this was a cause for concern, it was nothing out of the ordinary, in fact over the past seven weeks or so of open war, almost one-hundred of these missiles had been fired at both Saudi and Israel and very few had managed to hit their targets.
However, this particular missile eluded the US Patriot air defence system that had been protecting the base up to that point, and exploded exactly on its target, killing 28 US soldiers and injuring a further 98.
It was a tragic event, which saw the US-led coalition launch an immediate and aggressive ground campaign that ended the war within 72 hours of the attack, but after the dust settled and the last shot had been fired, the question on everyone's minds was, "how did the missile get past the defence system?" The answer, it transpired, was a tiny, yet ultimately deadly, computer bug. The way the system was supposed to work was quite simple: track an incoming missile, gauge its location via radar and fire a counter missile to intercept. This relied on precise measurements of the latitude, longitude and velocity of the incoming missile, however, unfortunately, a software bug that arose when the system had been running continuously for an extended period of time caused the velocity measurement to be thrown off slightly, which in turn meant that the system was scanning an area half a kilometre away from where it should have been, therefore it missed the incoming missile completely.
Without going into too much geeky tech talk, the most basic explanation for the bug is that the Patriot system - which had been designed to cope with much slower Soviet cruise missiles - simply didn't have enough computing power to keep up with the fast-moving Iraqi scuds. While it was fine being operated for short bursts, the longer the system was working, the higher the margin of error became, and after more than 100 hours of working solidly, the system finally fell down.
But what has a faulty early 90s computer got in common with today's modern, high-tech machines? Well, quite a lot actually, as even today, many computers - including some of those installed on things as important as missile-defence systems and aeroplanes - have a maximum capacity, and if they go over that, mistakes start to happen.
Of course, today's limitations are a damn sight higher than that ill-fated computer in 1991, but they are still very much in place, and a number of historic events can be put down to the very glitch that was responsible for the missile-defence system's failure.
For example, in 1996, the unmanned Ariane 5 rocket self-destructed just 39 seconds after take-off due to an unexpectedly high sideways velocity reading overwhelming the on-board computer. Or for a more recent example, in 2013, NASA lost contact with its Deep Impact space probe, again, thought the be down to a similar integer limit issue.
But perhaps the most famous, yet certainly the most trivial, example comes from the end of last year when PSY's Gangnam Style "broke" YouTube. Yes, you heard right, the K-pop artist's insanely popular - and also infuriatingly annoying - video was viewed so many times, it was too much for the YouTube view counter to take and YouTube had to update its storage to keep up.
The magic number that broke YouTube was 2,147,483,647, and while this may seem like a figure plucked completely at random, that's far from the case. In fact, this number is extremely important, because it is the maximum positive value of a 32-bit signed register - a piece of kit used in many computers.Now, the importance of this figure cannot be overstated, and its potential for catastrophe was hit home earlier this month when the Federal Aviation Administration issued a directive to all Boeing 787 operators, informing them that if the plane's generator control units (GCUs) are not restarted every 248 days (which just so happens to be 2,147,483,647 hundredths of a second), power to the plane will shut down "resulting in a loss of all AC electrical power, regardless of flight phase". In short, planes could start falling from the sky.
Of course, these things are all monitored and the GCUs are restarted as part of the plane's maintenance, but it's certainly a scary thought that these computers we rely so heavily upon are so fragile. With this in mind, the real question is, why are we using such limited capacities when numbers are infinite?
In the past, storage space on computers was expensive and slowed the processing power down - and on something like a missile-defence system, slow processing is not good. So by calculating a limit which is almost certain not be exceeded, in theory the whole system should be cheaper and run a lot smoother. However, the only problem with that is, of course, theory is not always right and sometimes that limit proves to be insufficient.The GCU on a Boeing 787 must be restarted at least every 248 days.[/caption] One theory that was ultimately proved wrong was that of the 'Millennium Bug', or Y2K, which some experts predicted would cause havoc with the world's computers as the year ticked over from 1999 to 2000. While Y2K didn't have the dramatic effect many had predicted, there remains a school of thought that believes the real bug is yet to come, and it will, in fact, arrive in 2038 - at 03:14:07 UTC on March 19, to be exact.
At that precise moment, it will have been 2,147,483,647 seconds since 1970 - the year after which all current computer systems measure time - therefore any computers still using a 32-bit processor will run out of space and fail. Now, of course almost all computers will have been replaced before 2038 anyway, but for those older embedded systems integrated into infrastructure such as transport systems, power stations and - dare we say it - planes, it could cause a problem if the software isn't replaced.
So, will 2038 see a disastrous global computer crash with planes dropping from the skies and missiles exploding all over the world? Probably not. But what is for almost certain is that at some point in the future, another limit will be exceeded and another computer we've all been relying on will fail.