On Tuesday the train system here in the Netherlands, run by a company called Nederlandse Spoorwegen or more commonly NS for short, went to hell. Well, maybe not literally, but I am sure a lot passengers thought it was!
The craziness actually started around 17:45, when a 21-year-old shoplifter stole something from Albert Heijn at Schiphol airport and fled down the escalators to the train platform. As he noticed he was being chased – by the military police, due to shoplifting at a national airport! – he decided to jump into one of the train tunnels to get away. He was found and arrested anyway.
But think about it – what happens when someone runs onto the tracks? The trains are immediately stopped, of course. Anything in the general vicinity. That was the begin of the chaos – Schiphol is an important hub for both travelers entering and leaving the country. But no, it gets even worse.
About an hour later, NS tweets there is a major issue with the railroad switches (which determine what direction a train should go in, this platform or that platform; this direction or that direction) in and around Amsterdam. Because of this, no trains can enter or leave the city. Amsterdam isn’t that far from Schiphol airport – about 15 minutes by train, give or take. Coincidence? Hmmm.
Around 20:00, NS reports that the situation has been fixed and they are bringing the system back online. Around 20:30, this proves not to be the case, with the train system around Amsterdam still down. By 22:00, NS has about 70,000 stranded passengers on its hands and is forced to shut down a train station at Amsterdam-zuid (Amsterdam south) because of overcrowding on the platform.
Passengers begin referencing a seldom used hashtag, #treinpoolen (car pools for train passengers) to try and get car pools organized for people to get in and out of the city. NS even references it in a tweet. It’s too complicated to bring in buses to get people home, since it is too overcrowded and most of the buses are in use elsewhere in the country for other ongoing construction projects. The NS does however promise to get the remaining passengers home that night, with roughly one train running every hour (manually) in each of the directions from Amsterdam. Around about 03:30 that night, the system is fully cleaned and restarted. The only hinderance left is that some trains might be shorter than normal Wednesday morning, since they aren’t in the right starting place anymore. The NS promises to look into the situation.
Later on Wednesday the report is released with the cause of the railway chaos (article in Dutch). It turns out that the thief running into the train tunnels and the major issue with railroad switches around Amsterdam are connected. Cause and effect. When the trains around Schiphol were forced to stop and remain in their current position, one of the trains found itself in a very unlucky place. It was sitting right above the area where the software determines whether a train goes this way or that way. The software thought that a train was repeatedly arriving, and so it repeatedly passed information about which platform to go to. Just over 32,000 times, or 32,768 in exact terms. With 16-bit software, this causes an integer overflow. At the same time, a worker tried to add a platform number by hand for this train. The two events together caused a minor meltdown. Here’s the official article about the cause (still in Dutch).
The crash caused some corruption in the data. Around 20:00, the corrupt data seemed to be removed, but when the system was re-started this was not the case. By 03:30 that night, the system had been fully cleaned and brought back online, just in time for the morning rush hour.