9 ms·
The end of an Era – changing every single instance of a 32-bit time_t in Linux
- ncmncm 7y agoMeanwhile, the unsigned 32-bit count of seconds (also) since 1970 used in pcap output from tcpdump, and used universally throughout the financial industry with no hint of a move away from it, will not roll over until 2106. If they are still in use then, code will interpret small values as implying a time after 2106, rather than as an ancient historical time before 2000. It is hard to know why anybody thought it so urgent to go to 64-bit seconds counters for internal use in the kernel.
- viraptor 7y ago> It is hard to know why anybody thought it so urgent to go to 64-bit seconds counters for internal use in the kernel. I would like to know if there's a better explanation, but at least one reason is: time_t is by C standard suppressed to be able to represent real time - this may include past and future. You definitely want it 64b on the userland side. But once you do that, you either need to do careful conversation everywhere in kernel/user boundary, or use 64b in both.
- brobot182 7y agoHow do they work?
- shpx 7y ago86 years ought to be enough for anybody!
- einpoklum 7y agoHow old are you tho?
- cyphar 7y ago> Meanwhile, the unsigned 32-bit count of seconds (also) since 1970 used in pcap output from tcpdump, and used universally throughout the financial industry with no hint of a move away from it, will not roll over until 2106. If they are still in use then, code will interpret small values as implying a time after 2106, rather than as an ancient historical time before 2000. The format would need to change before 2106, because I'm pretty sure that the time is stored as a big-endian encoded value -- to expand it requires changing the format. There really is nothing revolutionary about using an unsigned value, it just delays the problem by 80 years. Yeah, it's not something we'll have to worry about but our (great-)grandkids will. > It is hard to know why anybody thought it so urgent to go to 64-bit seconds counters for internal use in the kernel. There are many digital infrastructure projects which are planning to ship today's Linux for the next few decades (think things like traffic lights, as is the case in Japan). Fixing the 2038 problem now is necessary, because those deployments won't be updated until it's too late. But more importantly, the UAPI used to represent time as a 32-bit integer so it's necessary to replace those syscalls with new versions -- and you need to give enough time for userspace to migrate. The same problem of deployed software equally applies here. And if you're going to fix the UAPI you might as well fix the problem entirely.
- deleted 7y ago[deleted]
- pabs3 7y agoThe pcap-ng format uses 64-bit timestamps and has replaced pcap in Wireshark/dumpcap at least. It sounds like tcpdump supports reading but not writing pcap-ng. https://pcapng.github.io/pcapng/ https://pcapng.github.io/pcapng/ https://wiki.wireshark.org/Development/PcapNg https://wiki.wireshark.org/Development/PcapNg
- zrav 7y ago> It is hard to know why anybody thought it so urgent to go to 64-bit seconds counters for internal use in the kernel. I routinely encounter systems running 15-20 year old kernels. Given that, NOW is the time to fix the 2038 problem.
- loeg 7y agoNote that 2106 is about 86 years from now — quite a bit more than 15-20. Also, 20 years ago was before the Linux 2.4 kernel. You encounter systems running Linux 2.2 routinely?!
- leoedin 7y agoThere's at least a couple of reasons that doesn't apply. Software projects don't develop linearly. 20 years ago the Linux kernel was 8 years old, today it's 28 years old. The motivation to upgrade the relatively mature 2020 kernel will be much less than that to upgrade the immature 2000 kernel. And perhaps the biggest one - computers have changed. 20 years ago a PC that could run Linux was a big power hungry thing. Today it's the size of a box of matches. Embedded Linux PCs with limited upgrade paths are everywhere today. When I worked on satellites (stopped in 2015) we'd routinely use electronic test equipment which was running an embedded version of Windows 98. Given that the stuff shipping today is even further down the maturity curve, I think it's almost certain that it'll be used in 20 years (if it still works).
- zrav 7y agoEarly versions of 2.6 and 2.4, release >= 15 years ago.
- pabs3 7y ago15-20 year old kernels are probably very insecure, what contexts are you seeing such old systems in?
- protomyth 7y agoPeople aren't really concerned about the security of their non-internet connected HVAC controller or elevator. If it's in the wall people don't really think about it or update it.
- Dylan16807 7y agoIn some circumstances a rolling window will work. But for generic timekeeping, the files and records we have now are not going away. You can use unsigned numbers to delay the problem, but if you change the interpretation of small values you are going to break many many things.
- eru 7y agoA rolling window probably adds more complexity and heuristics than adding a few bits once.
- throwaway_pdp09 7y agoThis attitude blows my mind. There have been comments on HN, and for that matter by people I actually know, that covid isn't a problem because only a few people have it (heard that less than 2 weeks ago, just 1 day before UK lockdown started).It's as if they cannot see the future and they literally have to crash into something before they acknowledge it exists. That kind of blindness will kill a lot of people. I just don't understand it.
- deleted 7y ago[deleted]
- loeg 7y agoCovid is a poor metaphor for this. Time_t is perfectly observable and predictable and approaches linearly. 2106 is a long time away.
- fpoling 7y agotime_t is also used in code for relative time and that has to be signed.
- Edward9 7y agoThis team did an amazing job that will most likely go completely unnoticed if they are successful
- legooolas 7y agoIsn't that the point of such fixes? (And also why a lot of people thought that the Y2k but was over-hyped, when there was a lot of background work which fixed the problems so few people noticed when it did come to roll-over time)
- gear54rus 7y agoIt's not about the point, it's more about giving credit/praise/acknowledgement where it's due. Parent is probably saying those things will most likely be disproportionally low for that kind of effort/impact.
- close04 7y agoOutside of the field most people see it as: - It failed, the people in charge must be incompetent; - It works, it's probably routine and simple; - What works? Is that a thing?
- setr 7y agoSystem administration is a terrible job -- the only time people talk to you is because they're angry that something broke.
- BrandoElFollito 7y agoOn the other hand there are places where you are pretty free to do what you want in that job. It really depends on the place.
- eru 7y agoY2k was definitely overhyped. Yes, lots and lots of background work went on. My grandfather made a nice chunk of cash from being able to work with some near extinct programming languages and assembly variants on obsolete machines. But: the hypetrain wasn't so much focusing on glitches in banks and insurance companies, but on catastrophic failures in missile control software etc and embedded systems that often don't even have any concept of date.
- basementcat 7y agoI for one am glad that some sparc kernel bugs got fixed.
- akie 7y agoFantastic! Thank you so much for taking care of this.
- bArray 7y agoI love how Unix concepts have been around so long that their initial representations and assumptions of time will soon break. I wonder if the engineers at the time thought that programmers in the future will run into such issues. Perhaps 64 bit time will also cause some headaches in the far future! I was also trying to think of other computing implementations/assumptions that have shown their age. We've see a decrease in support for 32 bit CPUs, we ran out of addresses in IPv4, much security became obsolete - any others that come to people's minds?
- adrianN 7y agoBooting a modern CPU is a bit like time traveling through all eras of CPU architecture.
- close04 7y agox86 at least. Is it the same on ARM, MIPS, PPC, etc?
- JdeBP 7y agoOnly in the Intel Architecture and only then if one is bootstrapping in the old way. It is quite possible for a machine with EFI firmware, and no need of compatibility support, to go straight from the initial unreal mode to protected mode, never entering real mode.
- Baeocystin 7y agoOntology recapitulates phylogeny. :D
- JdeBP 7y agoPossibly at the time. Definitely, a mere 20 years in. I for one wrote a 32-bit C++ standard library in the early 1990s, and I used a 64-bit time_t. It ran on top of 32-bit OS/2, which was already keeping time internally using a 64-bit integer. I published two toolkits of command-line utilities, including a replacement DATE command, that used it. * http://jdebp.uk./FGA/keeping-time-in-os2.html http://jdebp.uk./FGA/keeping-time-in-os2.html I wasn't alone in this, by any means. Other library writers were implementing this. Solaris went 64-bit in the 1990s, as did IRIX. Windows NT had a 64-bit (albeit different) time format from the 32-bit start. TAI64NA was invented in 1997. * https://cr.yp.to/libtai/tai64.html https://cr.yp.to/libtai/tai64.html Thinking about this in the 2010s and 2020s is somewhat late. Indeed, even AIX 5.3 in 2004 was comparatively late.
- westurner 7y agoThanks! Year 2038 Problem > Solutions is already updated re: 5.6. https://en.wikipedia.org/wiki/Year_2038_problem https://en.wikipedia.org/wiki/Year_2038_problem
- tyingq 7y agoMySQL appears to still be mulling it over. https://bugs.mysql.com/bug.php?id=12654 https://bugs.mysql.com/bug.php?id=12654
- rini17 7y agoMariaDB: "Use DATETIME as a storage type if you require dates beyond this." https://mariadb.com/kb/en/from_unixtime/ https://mariadb.com/kb/en/from_unixtime/ ...so it may end up that nothing will be fixed, just TIMESTAMP will get deprecated.
- ars 7y agoTimestamp automatically handles the timezone, datetime does not. They are not interchangeable. One is used to record an instant in the world, the other to record a specific number for display back without modifying it because of changes in time zone.
- moviuro 7y agoWelcome to 2014! /s [0] [0] https://www.openbsd.org/55.html https://www.openbsd.org/55.html
- yjftsjthsd-h 7y agoThis is actually an interesting case study in different systems and how they deal with these things. OpenBSD has a smaller community of developers, an overwhelmingly strong focus on correct code and a willingness to break things if it helps. Linux, on the other hand, has probably orders of magnitude more developers, but is obsessed with backwards (ABI) compatibility and has a harder time coordinating changes.