Debian isn't waiting for 2038 to blow up, switches to 64-bit time for everything
- Reference: 1753451108
- News link: https://www.theregister.co.uk/2025/07/25/y2k38_bug_debian/
- Source link:
"[We will] use 64-bit time_t on 32-bit architectures to avoid the 'year 2038 problem' when the existing 32-bit signed int rolls over (potentially setting time back to 1900)," the Debian maintainers say of the move and the problem it aims to fix.
The 'nothing-happened' Y2K bug – how the IT industry worked overtime to save world's computers [1]READ MORE
"This is now less than 15 years away and plenty of systems that will have problems have already been shipped. We should stop adding to the problem."
Readers of a certain vintage will remember well the "Y2K problem," caused by retrospectively shortsighted attempts to save a couple of bytes by using two-digit years – meaning that "2000" is represented as "00" and assumed to be "1900." While predictions of aircraft falling from the skies and bank balances being wiped out by negative-decades of interest did not, thankfully, come true, that was purely due to the tireless behind-the-scenes work of software developers who were able to patch affected systems before celebrating the turn of the century.
There's another, less well-known clock problem looming, however: the [2]Unix Epochalypse ,which affects any systems that measure time the Unix way – in seconds elapsed since January 1, 1970. Come the very precise time of 03:14:07 UTC on January 19, 2038, the number of seconds elapsed will be larger than can be represented by a signed 32-bit integer. This would be fine if the decision hadn't been made all those years ago to store the number of seconds in exactly such a format.
[3]
Rather than the last-minute scramble of the Y2K fix, software developers are already working on its upcoming cousin. Any software written for and running on 64-bit hardware is already safe, but Debian – which was launched by founder Ian Murdock back in 1993, and is the second-oldest actively developed Linux distribution behind the one-month-older Slackware – is the distro of choice for older and resource-constrained embedded devices based on 32-bit processors.
[4]
[5]
"There is quite a lot of cost-sensitive 32-bit computing still out there, and still shipping new devices (automotive, IoT, TVs, routers, plant control, building monitoring/control, cheap Android phones)," the Debian developers explain. "Most such new hardware will be running build-from-source OSes like OpenEmbedded, or Alpine, Android, or Gentoo, but the Debian-based niche is likely to remain for some years, and some stuff built with it is likely to be in use/installed for long enough to hit Jan 2038."
[6]Y2K quick-fix crick? 1920s come roaring back after mystery blip at UK's vehicle licensing agency
[7]Need 32-bit Linux to run past 2038? When version 5.6 of the kernel pops, you're in for a treat
[8]Linux 5.10 to make Year 2038 problem the Year 2486 problem
[9]Curious tale of broken VPNs, the Year 2038, and certs that expired 100 years ago
[10]Epoch-alypse now: BBC iPlayer flaunts 2038 cutoff date, gives infrastructure game away
The fix is to move to a 64-bit integer, even when running on 32-bit hardware. It's no small change: Debian's maintainers found the relevant variable, time_t, "all over the place," spread across a total of 6,429 packages. As the move requires a breaking change to the application binary interface (ABI), it also has to happen across all affected libraries simultaneously.
While that was a chunk of work, Debian is confident it is now complete and tested enough that the move will be made after the release of Debian 13 "Trixie" – at least for most hardware.
"The i386 port will be left with the existing 32-bit time_t, as a compatibility architecture for existing x86 binaries," the maintainers say. "A new 'i686' x86 ABI/architecture using 64-bit time, and potentially newer ISA features, could be created if there was sufficient enthusiasm for dragging 32-bit x86 into its now very limited future. The hurd-i386 port is not going to be switched, as its kernel lacks support, and efforts are underway instead to switch to hurd-amd64."
[11]
More information, including on how developers can test to see if the shift to 64-bit time breaks their software, is available on the [12]Debian wiki . ®
Get our [13]Tech Resources
[1] https://www.theregister.com/2024/01/17/y2k_feature/
[2] https://www.theregister.com/2022/01/17/bbc_iplayer_expires_2038/
[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2aIZNLBQsUo37S8glt1vbuAAAAM0&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aIZNLBQsUo37S8glt1vbuAAAAM0&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33aIZNLBQsUo37S8glt1vbuAAAAM0&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[6] https://www.theregister.com/2020/01/13/y2k_dvla/
[7] https://www.theregister.com/2020/01/30/linux_5_6_2038/
[8] https://www.theregister.com/2020/10/19/linux_5_10_y2k38_fixes/
[9] https://www.theregister.com/2024/02/09/it_incident_report_the_clock/
[10] https://www.theregister.com/2022/01/17/bbc_iplayer_expires_2038/
[11] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aIZNLBQsUo37S8glt1vbuAAAAM0&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[12] https://wiki.debian.org/ReleaseGoals/64bit-time
[13] https://whitepapers.theregister.com/
Re: About time too
"68 years ought to be enough for anybody"
Re: About time too
"68 years ought to be enough for anybody"
In which case I'm definitely on borrowed time.
Re: About time too
Yes, for some of us, the clock is ticking ever so closer to the day that the ticker gives up for ever.
Re: About time too
"Yes, for some of us, the clock is ticking ever so closer to the day that the ticker gives up for ever."
Possibly for all of us (except thise who are Time Lords) time passing as it does.
Re: About time too
There was a heads up at the 34 year mark, when a bunch of users of various equipment discovered their NTP implementations were using signed 32 but integers to represent dates
Among other things it disabled most of the Chinese Internet for about 12 hours
1900?
Isn't Epoch 1970?
Re: 1900?
It's a signed number. The overflow wraps around to a negative value.
Re: 1900?
D'Oh - of course it is... that's about December 1901... that's probably close enough to 1900 to count, it's just too easy to assume that it's a Y2K typo...
Can't Someone Plan Ahead?
If Unix time is stored in a signed 64-bit integer, the rollover will occur approximately 292.277 billion years from January 1, 1970.
This means the new rollover time is Sunday, December 4, 292,277,026,596 AD at 15:30:08 UTC.
What are we supposed to do THEN?
Re: Can't Someone Plan Ahead?
Declare that the year of Linux on the Desktop has finally arrived?
Re: Can't Someone Plan Ahead?
Too soon...
Re: Can't Someone Plan Ahead?
Well, we now know the maximum up-time hard limit for a Linux install.
Re: Can't Someone Plan Ahead?
By then there will no longer be kernel support for anything older than 42000 core 4096-bit processors, but that will be just to keep a few grey-beards happy.
Re: Can't Someone Plan Ahead?
Well, for one, by then my grudge against you for stealing MY planned joke post, might abate!
Re: Can't Someone Plan Ahead?
" This means the new rollover time is Sunday, December 4, 292,277,026,596 AD at 15:30:08 UTC.
What are we supposed to do THEN? "
Advent Sunday. Go to church ?
Re: Can't Someone Plan Ahead?
Well, just having looked at Wiki's deep time pages, there's a chance that either the "false vacuum collapse" occurs or the Big Rip happens and the expansion of the universe ends baryonic matter.
But do I see anybody planning for *that* eventuality?! Of course not! Short-term thinking abounds!
Re: Can't Someone Plan Ahead?
The sun will have long since burnt out, so 64 bit unix time will be the least of our worries.
Re: Can't Someone Plan Ahead?
"The stars are receding...! Ohhh, the vast emptiness!" "...Yeah, yeah, I can take a hint."
And then 128-bit time be like "Bye, last proton!"
Re: Can't Someone Plan Ahead?
We will let an AI make all the changes, it will f***
up everything, and we will never have working computers ever again.
Re: Can't Someone Plan Ahead?
We can just start using 256-bit integers. Should be long enough to survive the heat-death of the entire universe.
Re: Can't Someone Plan Ahead?
Funnily enough, things will break earlier than that. The struct that converts the Unix epoch to a more understandable day month year format has the year itself as a 32-bit integer so by the year 2million something or 4 million something that int will overflow and blow up the time conversion function.
Now Microsoft has to go the way.
Will they make it before the year 8907?
Powershell:
[datetime]::FromFileTime(([int64]::MaxValue)/4)
Montag, 5. Dezember 8907 19:42:01
+- a few nanoseconds.
Best of luck
I dont envy them having to make the change over so many packages. Best of luck
Re: Best of luck
Well the actual change would just be in time.h, wouldn't it?
Okay, admittedly you'd have to recompile a sh*t-ton of code ... "Debian's maintainers found the relevant variable, time_t, 'all over the place,' spread across a total of 6,429 packages."
Re: Best of luck
That assumes that nobody is doing any maths using 'long' instead of time_t, nor are they using it in any structure/ABI that is fixed. Obvious example is reading date from a file system, I think ext4 uses 64-bit time stamps but ext3 uses 32-bit so there is some conversion needed there and you can't just compile the file system driver without checking the devilish details.
Re: Best of luck
ext3 uses 32-bit so there is some conversion needed there and you can't just compile the file system driver without checking the devilish details.
As it's impossible that any Unix file was actually created before 1st January 1970(*), 32 bit filesystem times can always be interpreted as unsigned, giving an extra 68 years to deprecate the file system format. I'm not saying it's a no brainer, but it shouldn't be impossible.
(*) Unless someone's been playing silly buggers, which is of course guaranteed to have been done somewhere. They can sort themselves out as punishment.
Re: Best of luck
"That assumes that nobody is doing any maths using 'long' instead of time_t, "
All the code littered with t ≠ (time_t)(-1) I am surprised that there isn't more brokenness 0n 64 bit platforms.
Just t ≠ -1 or t ≠ -1L for starters.
Return valid results and error indications in a single value perhaps not greatest design decision.
Re: Best of luck
@LionelB
"Well the actual change would just be in time.h, wouldn't it?
Okay, admittedly you'd have to recompile a sh*t-ton of code ... "Debian's maintainers found the relevant variable, time_t, 'all over the place,' spread across a total of 6,429 packages.""
Possibly but not guaranteed. I might be wrong but there is a length difference between 32bit and 64bit and if it is being loaded into a variable of an assumed shorter size it could cause a problem (do correct me if I am wrong I dont spend a lot of time in the lower languages). How much can and will go wrong I do not know, I did find this description of the issue for Gentoo-
https://blogs.gentoo.org/mgorny/2024/09/28/the-perils-of-transition-to-64-bit-time_t/
As I said I dont envy Debian guys and wish the best of luck
Well the actual change would just be in time.h, wouldn't it?
No. You may well have zillions of ancient tarballs and backups that were written in the days when time_t was a signed 32-bit integer.
Re: Best of luck
"Well the actual change would just be in time.h, wouldn't it?"
Nope.
Other OS components may assume/rely on time being 32bit - for example the UTMP/WTMP files used to track Unix/Linux logins/logouts (used by "w", "who", "last" etc commands) *rely* on the timestamp being 32bit as the file format is defined as so by the POSIX standard and the UTMP/WTMP files are binary files and so if 64bit values were to used instead then such files would no longer be standards compliant and they also wouldn't be backwards compatible.
One solution to the above is an alternative (i.e. new) way of tracking logins/logouts which some Linux software is starting to support - wtmpdb.
Re: Best of luck
"the file format is defined as so by the POSIX standard"
No it isn't. POSIX only defines the API used to access the utmp file, not the file format. There is no requirement that the file is just a binary containing the utmpx structures used by the API. And anyway the structure has the time as a struct timeval which has a time_t member for the seconds, and POSIX (as of the 2024 revision) requires time_t to be at least 64 bits. So on a system where the file does contain utmpx structures, the file would need to have at least 64-bit for the seconds in order to conform.
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/utmpx.h.html
Re: Best of luck
"No it isn't. POSIX only defines the API used to access the utmp file, not the file format."
Sorry, you are correct.
The point is that in order to use 64bit time values would mean changing the "standardised" (by existing software) on-disk format of UTMP/WTMP files and this would require changing a lot of software that either writes or reads (or both) these files and also would introduce compatibility issues between "old" format and "new" format files unless software was modified to detect both formats of file and act accordingly.
Some background info here: https://github.com/thkukuk/utmpx/blob/main/Y2038.md
Re: Best of luck
No, Posix doesn't mandate 32 bit time fields in utmp.
So, as with everything else, if all those programs were written properly, just altering time_t and compiling would work (Of course, it would break with historical data)
The main problems are:
1) Providing backwards compatibility (even if you don't care about old programs, there is also old data to cope with)
2) Auditing that every code does indeed use time_t appropriately and not make 32 bit assumptions. However, I suspect this auditing would have been done already when the OS started to support 64 bit architecture.
Re: Best of luck
"having to make"
Already a done deal as far as I can see,. Trixie is Debian Next and also the basis for Devuan Excalibur which I've been running as test for several weeks and is currently my daily driver because the no 1 laptop has suffered a bit of a knock & is in for repair.
Not sure about LMDE.
Excellent work
Just another reason why I keep coming back to Debian after trying anything else.
Have a few of the icon folks.
Yep. The developers learned from Y2K, Corporate applications will be in a last minute panic, though, because it's not "profitable" to fix ahead of time. They'd rather pay through the nose at the last minute after the current management has left on their golden parachutes.
The Accounts dept. have determined that the finalised budget can't be ready before Friday, December 2, 292,277,026,596 AD.
Please don't remind me about accounts departments and Y2K
Why Y2K38?
I know, I'm being pedantic, but why use "The Y2K38 bug"?
For a start, it's not a bug per se; it's how it was programmed.
Secondly, why use five characters, as in Y2K38? What's wrong with just 2038, or if you must use five characters, what's wrong with Y2038?
IT people are well aware of this potential issue and are working on it and have been working on it for years, possibly decades. There's no need to be dramatic and alert the general public, therefore no snazzy "punchline" is required.
And talking of which, yes I am of "a certain age" and was involved in mitigating things the last time and well remember the scare stories of aeroplanes falling out the sky, banks going bust and you losing all your money, etc. Where are the scare stories for this "potential year 2038 32-bit time-related potential issue with Unix systems" thingie? If you're going to be dramatic with the headlines, at least be dramatic with the copy, too. (And I'm not singling out El Reg ; other publications are as equally guilty.)
Re: Why Y2K38?
> ... or if you must use five characters, what's wrong with Y2038?
Or, for brevity, just Y38.
Re: Why Y2K38?
It's even worse than that. The K as separator has presumably been borrowed from electronics usage, but engineers are expected to know about place values.
So a 2K38 resistor is not 2038 ohms, but 2380 ohms. Any numerate person would have called it the Y2K038 problem, not saving any digits at all.
Re: Why Y2K38?
> For a start, it's not a bug per se; it's how it was programmed.
You could say the same about the Y2K bug.
I'm sure . . .
The Y2K "deniers" will be here soon to explain why the problem does not exist . . .
Well?
Re: I'm sure . . .
It's only a problem when you measure time from one of the eight corners of the Earth. On the other seven corners of the cube, time proceeds differently, so as we measure time in binary (one corner), it's really advancing in octal, so we have thirty-two times as long to resolve the problem as these so-called "programmers" believe.
In other words, this is a non-story, and everyone can stop panicking. You're welcome.
Truly, the old ones are the best...
Rest in peace, Gene Ray - truly the wisest man on Earth. Better than certain great men these days, at any rate.
Re: I'm sure . . .
" The Y2K "deniers" will be here soon to explain why the problem does not exist . . .Well? "
The planet might be fortunate to reach 2028 before a new dark age falls on us.
We will then be back to counting new moons; Ides, Kalends and Nones. :)
Re: I'm sure . . .
TBH, when we checked all our kit/software in the late 90s, nothing needed changing to be Y2K-ready. But then we weren't running any COBOL stuff. Still aren't, actually.
Re: I'm sure . . .
It wasn't just COBOL programs - there was plenty of C derived stuff that had issues. A lot of it was just display oriented (although, you never know who is doing what with the display), other parts would definitely have broken without a patch when we looked.
Re: I'm sure . . .
I saw many C and JavaScript programs that would have had the display go from 1999 to 19100. We all know what they did wrong there!
About time too
Pun intended.