June 26th, 2024

Y292B Bug

The Y292B bug is a potential timekeeping issue in Unix systems due to a rollover in the year 292,277,026,596. Solutions involve using dynamic languages or GNU Multiple Precision Arithmetic Library in C, emphasizing the need for kernel-level fixes.

Read original articleLink Icon
Y292B Bug

The article discusses the Y292B bug, a potential issue in timekeeping systems that could occur in the distant future due to the limitations of the Unix time system. The Unix time system measures time by incrementing seconds in a single integer variable, which will reach its rollover point in the year 292,277,026,596. The article proposes using dynamically typed languages or the GNU Multiple Precision Arithmetic Library in C to address this issue. It also outlines a method for handling large integers with arbitrary precision using arrays in C. The author shares code snippets and discusses the challenges faced in implementing these solutions, highlighting the need for fixing the Y292B problem on a kernel level for future generations. The article concludes by offering the fixed.c code under the GPLv3 license for those interested in addressing the Y292B bug.

Link Icon 6 comments
By @mlichvar - 5 months
The Linux kernel keeps time as a 64-bit integer, but it's in nanoseconds, not seconds. It's a Y2262 problem.
By @29athrowaway - 5 months
You will have worse problems in 292B years.

In 4.5 billion years we would live in the result of the Milky way galaxy merging with Andromeda, which will increase our chances of encountering either alien life, or alien artificial entities.

And after 200+ billion years, the sun, after having been a red giant and evaporated all oceans on Earth, will become a white dwarf.

By @jensenbox - 5 months
Maybe the universe is 64bit? It just starts all over again... and again... and again...
By @marcus_holmes - 5 months
I love the thought that we have a new Year 0, and I was alive for it (just). I can see a point where we forget why the year numbers start at 1,970 instead of 0, or consider it a historical oddity.
By @verall - 5 months
I can't really tell if this is a sort of satire or joke?

It seems to implement BigInts as BCD where each decimal digit gets it's own int32, implements division, then suggests kernel upstreaming. All as a solution for arbitrary spans of time.