Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Linux

Linux is Ready for the End of Time (zdnet.com) 100

January 19, 2038 is for Linux what Y2K was for mainframe and PC computers in 2000, reports ZDNet. It's the day that the value for time "runs out of numbers" and, in the case of 32-bit Unix-based operating systems like Linux and older versions of macOS, "starts counting time with negative numbers..."

"But the fixes are underway to make sure all goes well when that fatal time rolls around." nickwinlund77 shared their report: Linux developers have seen this coming for decades. So, Linux kernel developer Arnd Bergmann and others have been working on a repair. These corrections are now in the forthcoming Linux 5.6 kernel. Bergmann explained, "Linux-5.6, or my backport of the patches to 5.4, should be the first release that can serve as a base for a 32-bit system designed to run beyond year 2038."

There are some caveats:

- All user space must be compiled with a 64-bit time_t, which will be supported in the coming musl-1.2 and glibc-2.32 releases, along with installed kernel headers from Linux-5.6 or higher.

- Applications that use the system call interfaces directly need to be ported to use the time64 syscalls added in Linux-5.1 in place of the existing system calls.

- Applications that use a private copy of kernel uapi header files or their contents may need to update to the Linux-5.6 version.

- A few remaining interfaces cannot be changed to pass a 64-bit time_t in a compatible way, so they must be configured to use CLOCK_MONOTONIC times...

After we fix this, we won't have to worry about 64-bit Linux running out of seconds until 15:30:08 GMT Sunday, December 4, 29,227,702,659. Personally, I'm not going to worry about that one.

This discussion has been archived. No new comments can be posted.

Linux is Ready for the End of Time

Comments Filter:
  • You hear frantic screams of panic.
    "How are we going to fix this?!"

    • by Zorpheus ( 857617 ) on Saturday February 15, 2020 @12:57PM (#59731160)
      That's 6 times as far in the future as the sun will last. Guess it's ok to call this being ready for the end of time
      • I don't get it. We use UNIX timestamps on old mainframes also... In fact, any device that uses TCP/IP would use timestamps as it's in the header fields...
        • by Sique ( 173459 )
          But as long as you don't expect IP packets older than 68 years, you can always use a moving time window in TCP/IP.
          • by Sique ( 173459 )
            I have to admit: In interstellar communications, this can be a problem. We won't be able to use TCP/IP for communications going farther than maybe a Cephei.
            • I have to admit: In interstellar communications, this can be a problem. We won't be able to use TCP/IP for communications going farther than maybe a Cephei.

              Clearly UDP is the solution

            • Also: 2,150,000,000,000 ms ping does take some getting used to.
          • Connection reset by peer
      • by SeaFox ( 739806 )

        That's 6 times as far in the future as the sun will last. Guess it's ok to call this being ready for the end of time

        Yes. I, too, do not expect manned interstellar space travel to ever be a reality at this rate.

    • by Z00L00K ( 682162 )

      If Linux code still is around at that time then it may be that nobody will understand the code because they aren't homo sapiens. And it would be a "surprise m*f-er" moment.

      • by Viol8 ( 599362 ) on Saturday February 15, 2020 @01:11PM (#59731200) Homepage

        The sun would have died 24 billion years earlier evaporating the inner planets so there'll be no earth for anyone or thing to be around on.

        However, it might just be the Year of Linux on the Desktop! ;)

        • by Z00L00K ( 682162 )

          Unless we have sent out probes that someone else have re-purposed. Or humans have found a way to spread themselves and their pets over the universe.

          • by aix tom ( 902140 )

            Or humans have found a way to spread themselves and their pets over the universe.

            By then Humans will have reached the peak of their existence, by having become pets to the cat people of the planet Stoxx, who watch us playing with our computers as we watch our cats playing with strings.

        • The sun would have died 24 billion years earlier evaporating the inner planets so there'll be no earth for anyone or thing to be around on.

          However, it might just be the Year of Linux on the Desktop! ;)

          And somewhere in the distance a space probe with 64bit time which was adopted by an intelligent race of computer beings who declared the probe its supreme leader enters an intergalactic war with far flung earthling colonies due to the supreme leader's death.

          You have to think these things through.

    • by samwichse ( 1056268 ) on Saturday February 15, 2020 @02:43PM (#59731442)

      It reminds me Vernor Vinge's Deepness in the Sky. There's a job there called "Programmer Archaeologist" because everything is just piled layers and layers deep and digging to the bottom, the Unix timer is still there, ticking away tens of thousands of years later.

      • And they had emulators/VMs nested into each other. I have to look where I placed that book, it is actually quite good.

  • hahaha, not ready (Score:4, Informative)

    by iggymanz ( 596061 ) on Saturday February 15, 2020 @12:40PM (#59731124)

    No, the 32 bit Linux, 32 bit compat and a ton of popular applications aren't ready. Even if you're on 64 bit Linux many of the popular apps still aren't, like MySQL.

    It's gonna be a mess for years.

    • No, the 32 bit Linux, 32 bit compat and a ton of popular applications aren't ready. Even if you're on 64 bit Linux many of the popular apps still aren't, like MySQL.

      It's gonna be a mess for years.

      Well there are still 18 years or so to fix this. I'm sure Oracle has "top people" on it... /s

      The problem is there are many decades of applications and libraries that all need to be re-written.

      • At least it will be possible to do all of that. I can’t begin to count the number of times I’ve run into antiquated closed source software that wasn’t being updated or maintained dictating other technical decisions or requiring other antiquated products. Internet Explorer was notorious for this back in the day and even last year I ran into a situation where a company still had to run an XP box because some software wouldn’t work properly on newer versions of windows.
        • Yea, I've ran into several "mission critical" web portals that run only on IE 6 and a specific Java 1.6.0_X version (looking at you, Cisco). I 'loved' the scenario where a second "mission critical" web portal came into play that required a specific, different 1.6.0 version than the other one. *Hides in a dark room and screams*

          • My company has one. I've only been here a year and they are already tired of me telling them they really need to replace it. Silver light was killed by Microsoft in 2012ish IIRC. Silverlight only runs on IE to boot too. They finally agreeded that we need to do something about it when I showed them that Silverlight will be completely unsupported and unavailable to download for new machines in October 2021. I mean, I get it believe it or not. It's a portal that our partners in China use to know what we
      • by AmiMoJo ( 196126 ) on Saturday February 15, 2020 @01:17PM (#59731214) Homepage Journal

        The summary makes it sound like it's mostly just a re-compile but that's far from it in practice. I bet a lot of code assumes time_t is 32 bit and breaks when it isn't, e.g. because it's stored in a binary file somewhere or shoved in a packet that only allocated 32 bits to it. Or worse the packet buffer is overlaid with a struct containing time_t and now half of it doesn't line up, or compatibility with older versions is broken.

        What other operating systems suffer from this? To their credit Microsoft fixed this decades ago but I don't know about MacOS.

        • MacOS has _just_ jumped to 64-bit only in userland. No more 32-bit compatibility. So I would guess they fixed it at the OS level while back.

          • by AmiMoJo ( 196126 )

            Looks like it was fixed in Leopard: https://apple.stackexchange.co... [stackexchange.com]

            Interesting that Apple apparently lied about it around the year 2000.

            Anyway, that doesn't tell us the size of time_t and I couldn't immediately find the header file. There are pros and cons to changing it, on the plus side it fixes this issue but on the negative side it can break a lot of stuff like the aforementioned time_t in structs and binary files or passing time_t between 64 and 32 bit apps.

            So usually they introduce a new API for the

            • I think that statement was true for their built-from-scratch Mac OS 9, especially considering all PPC CPUs were 64 bit; but they lost that improvement when they switched to Unix-based OS X and the inferior x86 architecture.

              • I think that statement was true for their built-from-scratch Mac OS 9, especially considering all PPC CPUs were 64 bit; but they lost that improvement when they switched to Unix-based OS X and the inferior x86 architecture.

                MacOS 9 was not built from scratch.
                PowerPC based Macs were 32-bit.
                Nothing was lost moving to x86 except having to make the choice "Mac or PC?". The move allowed us to have one machine running either Mac OS X or MS Windows natively, boot to whichever one you needed at startup.

                • Though PowerPC had many advantages, moving to x86 was one of Apple's best moves for PCs. It came down to interoperability. The ability to use software and hardware that was designed for the much larger x86 market. I even had ran into hard drives, that should have been compatible, that didn't work on the PowerPCs because the firmware assumed a x86 architecture. If they were still on PowerPC (unlikely as IBM was lagging on updating the CPUs as they had lost interest in the architecture), Macs would not ha

                  • Though PowerPC had many advantages, moving to x86 was one of Apple's best moves for PCs. It came down to interoperability. The ability to use software and hardware that was designed for the much larger x86 market.

                    As someone who has ported many a Windows program to MacOS and MacOS X just having the same endianness eliminates quite a bit of the effort. I looked at some cross-platform code I did in the 1990s for a master's thesis. Lots of #ifdefs for byte swapping, threading and synchronization; the code ran under Win32, Linux/BSD and MacOS. The move to Intel takes care of byte swapping, the move to a *nix based environment combined with modern C++ compilers (which support threading and synchronization and calls win32

          • Apple have been warning Users and Devs about the cessation of 32 bit support for THREE major OS revs. now.

            They cannot say they havenâ(TM)t had plenty of time to avoid this being an issue; but people are lazy.

        • Wrong, Microsoft did NOT "fix this decades ago." where did you get that nonsensical idea?

          32 bit windows and 32 bit windows applications have the 2038 bug. Also, if your windows app for recent version of Windows happened to be built with Studio 7 or before you're fucked.

          • Re:hahaha, not ready (Score:5, Informative)

            by AmiMoJo ( 196126 ) on Saturday February 15, 2020 @04:27PM (#59731672) Homepage Journal

            32 bit Windows apps that use the standard library time_t are affected but that's not the normal way you handle time on Windows. It's only really there for POSIX.

            Windows system time and file times are both good for tens of thousands of years yet. I believe that the 64 bit file timestamps were brought in with FAT32, way back when, and Win32 was using the same from the start for time APIs. So at least since 1995.

            • Yep, most win32 functions would use the FILETIME struct which is just two DWRODs, or something that can be converted to/from it:

              Contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).

              typedef struct _FILETIME {
              DWORD dwLowDateTime;
              DWORD dwHighDateTime;
              } FILETIME, *PFILETIME, *LPFILETIME;

              So even though it's in 100 ns since 1601, I think that would still give us enough time to work something out.

              • by guruevi ( 827432 )

                I am not sure many people use that struct. Even Microsoft's own Excel doesn't use it consistently. Some date formulas starting from 1601 and even then it's not consistent because depending on the formula if it was present in older versions of Excel the epoch starts January 1, 1900 (or 1904) in a 32-bit integer. and Microsoft's own .NET calls starts the epoch at January 1, 1 AD and the older Win16-based calls like DDE have epochs in 1980 which is broken up into 16-bit packets representing mmddyy and add-on

                • by tlhIngan ( 30335 )

                  I am not sure many people use that struct. Even Microsoft's own Excel doesn't use it consistently. Some date formulas starting from 1601 and even then it's not consistent because depending on the formula if it was present in older versions of Excel the epoch starts January 1, 1900 (or 1904) in a 32-bit integer. and Microsoft's own .NET calls starts the epoch at January 1, 1 AD and the older Win16-based calls like DDE have epochs in 1980 which is broken up into 16-bit packets representing mmddyy and add-on t

                  • by guruevi ( 827432 )

                    Yes, that's if your whole program is sanely programmed and doesn't need to interact with any Microsoft software, which is the only reason you're writing for Windows anyway. The system libraries are rarely called in my experience, most interact with some other software or the .NET or VB or OLE libraries which for historical reasons everybody does something different.

          • 32 bit windows and 32 bit windows applications have the 2038 bug. Also, if your windows app for recent version of Windows happened to be built with Studio 7 or before you're fucked.

            With Windows the native OS representation uses a different structure than time_t. time_t is something the c library implements as a shim on top of the OS. Whether 32-bit applications have 2038 issues depends on the compiler runtime the application was built with.

        • The summary makes it sound like it's mostly just a re-compile but that's far from it in practice.

          In my experience it has been mostly just a re-compile.

          I bet a lot of code assumes time_t is 32 bit and breaks when it isn't, e.g. because it's stored in a binary file somewhere or shoved in a packet that only allocated 32 bits to it.

          32-bits is sufficient for up to 2106. The way to deal with legacy wire formats is to treat the 32-bit field as unsigned and move on.

          Or worse the packet buffer is overlaid with a struct containing time_t and now half of it doesn't line up, or compatibility with older versions is broken.

          Good, anyone who designs protocols like this deserve everything they get.

          What other operating systems suffer from this? To their credit Microsoft fixed this decades ago but I don't know about MacOS.

          What Microsoft fixed was compiler/runtime.

        • Are there any good tutorials/writeups on how to migrate off 32-bit time_t in existing code? The linked articles just talk about Linux kernel fixes, what's the guidance for application devs who have to target 32-bit systems?
          • by AmiMoJo ( 196126 )

            I don't know of any... Basically you have to look at every instance where time_t is used and think through the ramifications of it being 64 bit. Storage space, overflows, conversions to other types etc. And then carefully test it of course.

            It's one of the reasons why Y2K was such a big pay-day for developers who could fix it. It's not trivial in many cases.

        • Any real-world facing sub-system to the kernel can have Y2038 issues independently of whether the kernel is 32-bit or 64-bit. This includes protocols that are defined internationally such as NTP (Internet Network Time Protocol) and filesystems such as cpio that are not Y2038 compliant.

          Recompilation is necessary to update 32-bit userland programs to use the Y2038 compliant glibc and other libraries on a 32-bit or 64-bit Y2038 compliant kernel.

          In other words, the core of your operating system needs to be Y203

      • The problem is there are many decades of applications and libraries that all need to be re-written.
        You don't have to rewrite anything, except perhaps a formatting and a parsing function. The rest is changing a typedef, and thats it. Basically a recompile.

        • While in the strictest sense that is true, that presumes you have the original compiler, and the original source. Going to be shitshow otherwise, either rewrite, replace entirely, or if the source doesn't play well with being compiled with a newer compiler (this SHOULDN'T happen but... some of the stuff is old as hell).
        • It is not that simple to just recompile as computers need to communicate with each other with standardised protocols for inter-operability reasons. If the protocol itself is not Y2038 compliant then no amount of recompilation will help. The only solution is to replace the protocol with a Y2038 compliant variant of the protocol eg. release a new specification of the protocol.

      • If you say 18 years, then you will be too late. Sounds like a typical out by 1 error to me. There are only 17 whole years to go.

    • by Z00L00K ( 682162 )

      Monty is probably already on it for MariaDB.

    • On the other hand, the end of times is ready for Linux on the desktop.

    • Even if you're on 64 bit Linux many of the popular apps still aren't, like MySQL.

      Meanwhile, Postgres has been ready since before Y2K!

    • Iâ(TM)m pretty sure that was one of the biggest reasons why Apple just ripped off the bandage for their OSes (ended all 32 bit support), instead of this Kludgy, Half-Solution.

      • by Megane ( 129182 )
        They've had 64-bit time since OS X was called NeXTstep. (NSTimeInterval/NSDate) [apple.com] Except that it uses a double float, so delta times can be represented in microseconds, and dates with millisecond precision for at least a 10000 year range.
    • Not sure what your point is. He didn't say Linux apps we're ready, he said Linux was. And of course if you are choosing the old incompatible version, then it's going to be incompatible. That's not exactly the most insightful observation.

      And "a mess for years"? I'm not sure how that qualifies as a mess. This won't hit for 18 years, and until then it doesn't really have any consequence if someone wants 10 years to patch their app.
      • Not just apps, Linux the operating system is not ready. There is much more above the kernel in any distro that makes a linux distribution, and it is not ready.

        If you don't know why there is a huge mess, you don't understand the problem. Businesses and many science users already project dates into the future for projects, that's broken and causes problems long before 2038 arrives (actuaries and similar have already been fucked by it many times for over a decade). Business databases, apps and filesystems

  • by The New Guy 2.0 ( 3497907 ) on Saturday February 15, 2020 @12:51PM (#59731146)

    Y2K wasn't really discussed until the 1990s, and everything critical got fixed in time. Seems like this post needs to go into the "time file" and pulled out in Y2K+28...

    • by Entrope ( 68843 )

      Some people I work with ran into a Y2K18 problem. They used signed 32-but integers to hold timestamps from software that counted from 1950 (due to VMS heritage). That system typically uses doubles or double doubles to hold timestamps, so they really should have known better. They didn't.

      • Some people I work with ran into a Y2K18 problem. They used signed 32-but integers to hold timestamps from software that counted from 1950 (due to VMS heritage). That system typically uses doubles or double doubles to hold timestamps, so they really should have known better. They didn't.

        The VMS base date is November 17, 1858.

    • by Anonymous Coward

      Y2K+28

      How the hell is "Y2K+28" easier to type or say or read than "2028"? WTF.

      • Y2K+28

        How the hell is "Y2K+28" easier to type or say or read than "2028"? WTF.

        "Y2K+28" provides a context that "2028" does not, ie a calendar based computer bug. That a lot of context with only 2 more characters.

    • Some embedded systems might last longer than 10 years. By then, that might include your pacemaker.

      --
      .nosig

  • by thegarbz ( 1787294 ) on Saturday February 15, 2020 @12:55PM (#59731154)

    instead of just kicking the can down the road.

  • There are still lots of embedded and retro systems in use that will use old kernels. Just look at the market share of Windows XP and Internet Explorer. The Y2020 problem happened this year and it will happen again.
  • Its not like no one knew this date was coming. Was there some kind of expectation in the linux community that 32 bit would have gone the way of T Rex by now or was it just inertia?

    • by vadim_t ( 324782 )

      Linux implemented POSIX, which specifies time_t is a 32 bit integer.

      So the blame seems to go back to 1988 or so, if you blame the POSIX committee, or before that because it was a 32 bit int even before then.

      As to why Linux didn't do differently, probably because people wanted software written for other unixes to work on it, and was a 100% hobby project at the beginning, which nobody probably expected to be this big today.

      • [citation please] Seriously, POSIX doesn't contain anything to restrict time_t to a 32bit value. Everyone was using 32bit time_t at the time, but it wasn't mandatory. That's essentially the opposite situation as with off_t where everyone already knew that 32bit is a stupid choice, but GNU/Linux still decided to default to it for "performance" reasons.
      • Why did anyone choose to have "system time" be a signed value?
        If you want to work with time - at the non system level - use something like - Excel.....

        • So that the same typedef could be used to represent time differences, and so the compiler won't yell at you when you subtract one time value from another.

    • Well kiddo, you also had to walk to the store to make a phone call if you weren't at home in those days.

      "You'll have to fix this within 30 years" was never perceived as "the way of the `T Rex'" it was merely "the future." As in, now. As in, fixing it now was planned for in the past. And they were right, most computers switched to 64 bit and never had to be fixed, it would have been a wasted effort to worry about it back then.

      • by Viol8 ( 599362 )

        I don't know about you "kiddo", but we had these things called payphones where I lived, no walking into anywhere to make a call.

  • by Greyfox ( 87712 ) on Saturday February 15, 2020 @01:27PM (#59731252) Homepage Journal
    I kind of expect a bunch of old 386s running SCO to come crawling out of the woodwork when the time rolls over. Yes, I know SCO has been dead for over two decades and it's nearly two more before it's a problem, but the companies that deployed them weren't terribly big on IT spending in the first place and may not even realize there's some ancient SCO box in the basement, running the company. Those are the ones who still have moldy old '90's era C programs installed, you know, the ones that used ints instead of longs, pointers or time_ts. They probably don't even have the source code for the programs they depend on, if they ever did.

    Honestly, I don't even expect there to be more than a handful of those, but I think there will be a few companies, and I'm kinda curious if we'll actually even hear about any of them.

  • ... it is, as the article says, preparing. Then there is all the testing and discovering the areas where special work needs to be done. But it is good that the developers are finally starting to tackle this issue. Since Linux distributions often are used in embedded applications with long lifetimes, it is good that Linux is finally getting around to this.
  • "we won't have to worry about 64-bit Linux running out of seconds until 15:30:08 GMT Sunday, December 4, 29,227,702,659"

    Sure...and 640K ought to be enough for anybody.
  • Thanks for the (future) present. ;)

  • I have a rendez-vous at 03:14:08 UTC on 19 January 2038.

  • Question ..

    2^64 = 18,446,744,073,709,551,616 seconds
    signed = 9,223,372,036,854,775,808 seconds
      = 292,271,023,045 years, 114 days, 9 hours, 30 minutes, 40 seconds (year ~365.25 days)
    + epoch = April 24, 292,271,025,015 @ 9:30:40

    The article mentions year 29,227,702,659 but appears this is off by about a factor of 10? Granted, ultimately doesn't matter but am I missing something?

    • The real question is:
      Does the new time_t use milli seconds or nanoseconds?
      And on top of that, is it still called time_t or got a new name? E.g. time_t64?

  • - A few remaining interfaces cannot be changed to pass a 64-bit time_t in a compatible way, so they must be configured to use CLOCK_MONOTONIC times...

    Better to use CLOCK_BOOTTIME. CLOCK_MONOTONIC doesn't count while the computer is asleep.

  • I am sure Milliways will update their POS systems

  • This is a Unix-like problem. NetBSD and OpenBSD released their fixes in 2012 and 2014 respectively, Linux has been slower but has still allowed 18 years, which is plenty of time.

    It won't affect Linux computers, where hardware and software turns over fairly quickly, cycles before 2038. Linux software is also updated fairly regularly, or becomes orphaned and is replaced by something new. It will affect Linux legacy software but there probably isn't going to be lot of that affected by 2038. The main reason f

  • Check out /usr/include/time.h. Seems to me this was fixed all the way back to at least 2005 when I fired up a var and it turned out to be a long.

    Should have been fixed when they came out with 64 bit kernels.

It's a naive, domestic operating system without any breeding, but I think you'll be amused by its presumption.

Working...