11 ms·
Approaching the kernel year-2038 end game
- LeonM 8y agoI have been working in the embedded world for some time. What worries me is that even new embedded systems come with ancient kernels and stdlibs, most of which won't be y2k38 compatible. Many of these devices will still be operating in 2038, but long forgotten. Think HVAC control systems, kitchen appliances, security systems, etc. Cars, trains, information signs, traffic lights, many of these public infrastructure systems will fail. And these systems are very, very hard to update, if possible at all. We'll be having a lot of e-waste in 2038.
- chungy 8y agoI wonder how many of these systems would really be sensitive to the clock overflowing to 1901. HVAC, kitchen applications, information signs, traffic lights... they all seem relatively low-risk to me. As long as things still happen in regular intervals, it's hard to imagine a crisis. (I would be surprised if many of these even have synced clocks in the first place, I can imagine them happily thinking it's somewhere in the 1980s and nobody is the wiser.)
- corbet 8y agoI imagine that most of those applications are very much tied to the calendar — traffic lights and HVAC systems need to behave differently on different days. Trying to minimize the amount of broken code that's still running in 2038 is a big part of why people are working hard to fix the problem now.
- chungy 8y agoMaybe we could set them to 1907 and remain happy that near-future leap years and weekdays will align perfectly well. At least until 2100 needs to be skipped as a leap year ;)
- robocat 8y agoUnix epoch: the number of seconds passed since 1 January 1970 and storing it as a signed 32-bit binary integer The minimum representable date turns out to be on 1901 and zero is a valid value (1 January 1970)... I wonder what problems people with that birth date have? Similar to the person named Null, or Bobby Drop Tables?
- axiak 8y agoEven if the system isn't calendar aware, if all of a sudden you have negative timestamps you can have strange boundary conditions where loops might run forever, hanging the system.
- erik_seaberg 8y agoI will never forget discovering that "SELECT FROM_UNIXTIME(-1)" would instantly crash MySQL.
- DuskStar 8y agoDoes your system need to connect to a service on the internet? Does that service use an SSL cert? If so, it almost certainly has a not-before time, and overflowing back to January 1st, 1970 will be before that not-before time. And so any behavior relying on that IoT device connecting to a service will fail.
- artursapek 8y agoI certainly hope traffic lights are never connected to the internet.
- nopassrecover 8y agoI’d always assumed they must be connected to support the ability of fire engines to setup route plans or the central traffic management teams to be able to override light sequences. I see now there are other novel ways of supporting preemption for emergency vehicles, although I’m still unconvinced that’s what our city uses as the lights often preempt several minutes in advance and from over a kilometre away.
- adrianN 8y agoThey don't have to be connected to the Internet for that functionality.
- FireBeyond 8y agoMost US preemption devices are just a visible (and sometimes optional infrared) stroke at 80Hz. Visibility to the sensor/receiver device is largely subject to prevailing light (bright day, more challenging, night/shade, then it's easy to pick out the strobe). -- fire/ems provider.
- nexuist 8y agoQuestion, since I've always been curious about this: How difficult would it be to make your own preemption device? Are such things available on online stores? I'm assuming it's illegal to use one obviously, but I wonder what precautions are used to prevent unauthorized usage, if that can even be disclosed to the public. What's stopping the average joe from getting one from Alibaba?
- derekp7 8y agoThe rule I follow is the same one I had for Y2K. If there is no interface to enter a date, you don't have to worry about it. For example, on the sensationalized "documentaries" we had leading up to Y2K, they showed a stream of appliances and gadgets that had processors in them -- hair dryers, microwave ovens, dishwashers, food processors, etc saying they all would be vulnerable. Some of these display the time, but I haven't run across a microwave yet that accepted a date input.
- andrewflnr 8y agoThese days, the "date input" tends to be the internet connection.
- 3pt14159 8y agoThis is great for thinking about the non-internet connected devices. What's also interesting about this idea is that we can test what 2038 will be like by slowly shifting the time for certain networks forward to see if a subset of stuff will fail. If it does, we can resort to turning off systems.
- iClaudiusX 8y agoThe first-generation Zune had a leap year bug that caused it to get stuck in an infinite boot loop on December 31, 2008. Not exactly the kind of thing you want happening to traffic infrastructure.
- fyfy18 8y agoEven if it has no issues rolling over, a big problem could be that anything that works on a weekly cycle (I imagine traffic lights, HVAC, etc have different schedules for workdays compared to weekends) will skip some days, as Jan 19th 2038 is a Tuesday and Jan 13th 1901 is a Friday.
- max76 8y agoFollowing up with this, it is highly unlikely the overflow will happen at midnight, or at the top of an hour. Even if a timezone or clock adjustment is possible on the system leap years and other calendar offsets will be different that can cause some continuing frustration for any workaround with an out of sync clock.
- pishpash 8y agoYou never know, some devices may start incorporating AI algorithms that make behaviors based on past data, so a consistent timeline can become important even if there should be no inherent reliance on absolute dates.
- groby_b 8y agoHaving worked in embedded, I'm perfectly comfortable with horrible kludges that nonetheless solve the problem: In 2036, factory reset to wipe all state, and keep using the same ancient kernel with a tiny hotpatch to assume 1/1/2035 as time base. If your kitchen appliance is still around by the time that is a problem, you'll get an award ;) But don't tell anybody, I plan to hawk my consulting skills from 2030-2038 to pad my retirement income. Just like the good old Y2K days & COBOL.
- LeonM 8y agoSssssh, you just told the world my retirement plan!
- mulmen 8y agoHow does the hot patch solve the logistical challenge of installing firmware updates on thousands of devices that generally receive no updates at all? Am I supposed to pull my microwave out of the wall and ship it back to GE? Does it have a USB port for installing this hot patch? How does GE tell me about it?
- anyfoo 8y agoDo you care about your microwave showing the correct date? Does your microwave even keep track of the date? Devices like your microwave won't magically stop working in 2038. For most non-networked and, in 2038, ancient appliances, there shouldn't be that much of a problem.
- klodolph 8y agoShouldn’t, but I have to deal with things that “shouldn’t“ happen all the time. Remember, the Zune wouldn’t boot in 2009 because 2008 was a leap year, and that wasn’t tested.
- anyfoo 8y agoYeah, but I specifically said non-networked appliances. Most microwaves I know don't even let you input the date. For those that do, and that you still want to keep in 2038, you can just enter a fake, old date. I understand that there might be some smart microwaves with Wifi and whatever (setting all sentiments about that aside), but those are not what are meant.
- cjensen 8y agoTraffic lights were a concern for Y2K... but it turns out that in the real world, traffic lights just need a day-of-week so they continue to work fine.
- mulmen 8y agoOk but what happens when the date overflows? Will they still know Monday is Monday or will they start thinking Monday is Sunday?
- eridius 8y agoIs "y2k38" a common way to reference this issue? That doesn't save any characters over "y2038".
- jeremyjh 8y agoIt also doesn't cost any more characters, and instantly calls to mind the y2k issue to which it is related.
- stesch 8y ago> Some of the final steps in this transition for the core kernel have been posted, and seem likely to be merged for 5.1. This doesn't sound as good as they wanted it to sound. I thought they were already save. On the other hand, planned obsolescence could help and nobody is using 20 year old kernels in 2038 anymore. Hopefully.
- dtech 8y agoThis is only for 32-bit systems. 64-bit systems have always used a 64-bit timestamp. The difficulty is that the ABI defines a 32-bit timestamp on 32-bit kernels so that can't easily be changed without breaking backwards compatibility. That's what this post is about. So for desktops and servers this has been solved for years already. I don't know how prevalent 32-bit is in embedded versus 64-bit.
- keeperofdakeys 8y agoThe popular Raspberry Pi platform only started shipping with a 64-bit ARM cpu in 2016, and ARM chipsets with 64-bit support only started appearing around 2012/2013. So I'd expect many new embedded platforms to continue using 32-bit systems well into the next decade.
- akiselev 8y agoThere are still probably billions of devices made each year with 8 bit microcontrollers that are decades old designs. We won't be free of 32bit ARM until the turn of the century.
- tyingq 8y agoOn the other hand, current mysql has this problem now, still unfixed, even running in 64 bit environments. https://bugs.mysql.com/bug.php?id=12654 https://bugs.mysql.com/bug.php?id=12654
- jzl 8y ago"This may seem like a distant problem, but, as Tom Scott recently observed, the year-2038 apocalypse is now closer to the present than the year-2000 problem." Wow, I knew it was approaching soonish, but that's an eye-opening way of putting it. I wonder how many pre-2000 kernel versions are being used in devices right this moment.
- gmueckl 8y ago> I wonder how many pre-2000 kernel versions are being used in devices right this moment. That one is simple to answer: too many.
- BurningFrog 8y agoThat doesn't change that it's a solid 19 years away.
- ams6110 8y agoExactly what programmers were saying in 1981.
- jeremyjh 8y agoWere they wrong? y2k was a non-event, unless you were a consultant cashing in.
- Dylan16807 8y ago"Fixing the brakes on my car was a non-event, unless you count the mechanic cashing in."
- jeremyjh 8y agoRoutine automative work is a good analogy. There was programming work to do, people did it in time, and life went on.
- throw9away 8y agoBut what are we going to do about the year-292,277,026,596 problem!? (And what about the year-2,147,485,547 for systems that have to do date computations!?)
- sys_64738 8y agoIt’s all thanks to hardworking software people that Y2K wasn’t.
- jzl 8y agoYeah, huge shout out to Initech specifically for their amazing work in that field. ;)
- hermitdev 8y agoThe 32-bit Unix 2038 end has already been an issue in some fields. For instance, in finance, it was already an issue in 2008 when calculating risk, payments, etc on say a 30 year bond.
- adtac 8y agoAha, the real reason behind the 2008 crisis!
- maxander 8y ago“Supporting 32-bit time system calls after 2038” will serve future generations as an example of the lengths that developers are supposed to go to in order to ensure backwards compatibility, even in the face of apparent absurdity. Alternately, it will serve as a joke about how scared everyone was of breaking things written with our primitive and brittle 21st century programming techniques.
- hermitdev 8y agoAlso, how "X" will always be enough. It May be sufficient for the foreseeabke future, but software engineers are horrible about underestimating how long the software we write will stick around. Pretty sure I made some short sited decisions as an intern, and most of that code is approaching 20 years old, and I bet it hasnt been fixed or rewritten, because for the time being, it works.
- kijin 8y agoWhen it comes to the kernel, "We don't break userspace" is explanation enough. Feel free to add swearwords in English or Finnish depending on how you think 68-year-old Linus will feel about the matter.
- ryanbertrand 8y agoWe launched a crime based RPG game on iOS back in the day that had a leaderboard which tracked in game net worth (cash, investments, etc). I still remember the day we woke up to multiple emails and lawsuit threats from our top player whose net worth suddenly went negative on the leaderboard. Our players were very competitive and loved pushing the boundaries by trying to find vulnerabilities, shortcuts, etc so we assumed the worst and thought we had a bug in our system! Turned out to be our JSON parsing library was using integerValue on our NSNumber instances causing the ints to overflow. It was a tough week waiting for Apple to review the app while our players lost faith in us. Lesson learned :) (Luckily the player and our community was understanding and stay around)
- teacpde 8y agoI like stories like this. Finding where the overflow happens could be a lot of fun. How did you figure it out? Did it take a long time?
- rwmj 8y agoIn other news there's a GPS epoch arriving this April: https://www.spirent.com/blogs/positioning/2018/january/gps-rollover-week https://www.spirent.com/blogs/positioning/2018/january/gps-r...
- ilovetux 8y agoHow much time does moving to 64 nits buy us? it's likely considerable, but I cant help but imagine a time when we have to address this problem for a third time. It seems to me like a more robust solution is possible.
- jorams 8y agoWhile 32-bit time_t lasts for roughly 68 years, 64-bit time_t lasts for roughly 292270958501 years.
- perl4ever 8y agoWell, what if you want to measure small fractions of a second? If your timestamps have significantly higher resolution than a nanosecond, you've used up your extra 32 bits. And there is technology that operates on much shorter intervals, like about 10^-18 seconds. While it may not be very relevant today, if you really want to future proof things for the next 1000 years, I think you need around 90 bits or more. "12 attoseconds is the world record for shortest controllable time" https://phys.org/news/2010-05-attoseconds-world-shortest.html https://phys.org/news/2010-05-attoseconds-world-shortest.htm... After further consideration, the ultimate timestamp would be able to denote any point in time measured in Planck units (10^-44 seconds) between the beginning of the universe and its ultimate heat death in about 3 x 10^21 seconds. Therefore 218 bits should be enough for anyone.
- ecma 8y agoReally? I'm not sure if this is bait or not, but 64b time_t extends the epoch over 200 billion years into the future. I figure we'll handle it in Linux 7.0 or 8.0 at the earliest :P
- lucb1e 8y agoIt's probably not bait. It's easy to intuitively think 64 bits is only double. I do these calculations regularly as security professional (password strength for example) but not everyone does.
- brodouevencode 8y agoI found this article better explains the issue: https://fossbytes.com/year-2038-problem-linux-unix/ https://fossbytes.com/year-2038-problem-linux-unix/
- rurban 8y agoI really don't like the _NEW suffix, as in SO_TIMESTAMP_NEW, opposed to the normal SO_TIMESTAMP64 naming scheme, as in the function names. But it renders the existing names as old and outdated, so it does make some sense.
- aasasd 8y agoPersonally I'll wait for SO_TIMESTAMP_NEW_NEW_FINALTHISTIME.
- ge0rg 8y agoIt only makes sense from a shortsighted "today's" perspective. What happens if there is another API change? Do you call the new new suffix _NEWER? _NEWNEW?
- rurban 8y agoThanksfully 64 is the endpoint. "We'll never need 128bit time_t struct's!" Famous last words. But really, we don't. We don't need to mix low precision with high precision times, "one for all" . Calculating in ns does not make sense in the year scale.
- seotut2 8y agoHopefully, this will be humanity's last problem of this kind. Or, now that I think of it, hopefully it won't be.
- bloak 8y agoJust for fun, I installed Debian i386 unstable under QEMU and set the date with date -s '2038-01-19 03:14'. The time rolled over to 1901. Then I tried using git. It was badly broken: on 32-bit systems, git 2.20.1 seems unhappy with dates before 1970 or after 2038. Will Debian 11 work after 2038 on 32-bit hardware, I wonder?