Year 2038 Problem

Year 2038 Problem

March 2022

In Unix-based systems, such as Linux or BSD, the so-called Unix time is used as a standard for timekeeping and is defined as the number of seconds elapsed since 1 January 1970, 00:00:00 UTC [1].

Within the above-mentioned Unix-like systems, this Unix time was and partly still is stored in form of a signed 32-bit integer value, resulting in a maximum value of 231 - 1 or 2,147,483,647 seconds. Based on the starting point, 1 January 1970, 00:00:00 UTC, this maximum value will be reached on 19 January 2038 at 03:14:07 UTC and will be exceeded in the following second. Such a counter overflow of a signed integer would cause a change of sign and in this context a jump back to 13 December 1901, 20:45:52 UTC within the affected systems.

While this problem is only partly relevant for systems based on 64-bit architectures due to the increased value range of integer data types, systems based on 32-bit architectures are especially at risk of showing unpredictable and potentially incorrect behavior on 19 January 2038 [2]. For embedded systems, this problem is particularly relevant because, on the one hand, embedded systems have very long planned lifetimes of often several decades and, on the other hand, even today a large part of the installed hardware is based on 32-bit architectures.

As an approach to overcome this problem, changing the data type of the Unix time from a 32-bit to a 64- bit integer has proven to be successful even for operating systems based on 32-bit architectures. While on some operating systems this change took place very early, such as NetBSD with version 6.0 in 2012 or OpenBSD with version 5.5 in 2014, the Linux kernel supports 64-bit data types for the Unix time on 32-bit architectures not until 2020 with version 5.6 [3] [4] [5].

Despite the transition to 64-bit data types within the kernels, there are still some remaining challenges for entire operating systems, including:

  • Affected software libraries, particularly the implementations of the C standard library, must be adapted to the new 64-bit data types and system calls.
    - musl libc: support for new data types and system calls since version 1.2 [6]
    - glibc: the implementation and support of the new data types and system calls has been in an ongoing process since version 2.32 and is with the current version 2.34 still not
    completed [7][8].
  • All applications based on these affected libraries must be recompiled with the adapted versions of the libraries.
  • For applications in which direct system calls affected by the changes are used, a corresponding adaptation is necessary.
  • Affected file systems, such as ext2, ext3 and partly also ext4, may need to be adapted or replaced by others.

Despite the progress that has already been made in the user space with regard to the 2038 problem, for example the partly existing implementation and support of the new 64-bit data types and system calls by the C standard libraries, the requirements for preventing both existing and new systems based on 32-bit architectures from behaving incorrectly in 2038 are still lacking in some places.

We will continue to follow future developments in this area and will inform you as soon as the necessary conditions for appropriate action have been created.


References

[1] Ed.: The Open Group, "General Concepts," [Online]. Available: pubs.opengroup.org/onlinepubs/009695399/xrat/xbd_chap04.html. [accessed on 17 February 2022].

[2] Ed.: The Open Group, "64-bit and Data Size Neutrality," [Online]. Available: unix.org/whitepapers/64bit.html. [access on 17 February 2022].

[3] Ed.: OpenBSD, "OpenBSD 5.5 Changelog," [Online]. Available: www.openbsd.org/plus55.html. [accessed on 17 February 2022].

[4] Ed.: NetBSD, "Announcing NetBSD 6.0," [Online]. Available: www.netbsd.org/releases/formal6/NetBSD-6.0.html. [accessed on 17 February 2022].

[5] A. Bergmann, "[GIT PULL] y2038: core, driver and file system changes," [Online]. Available: lkml.org/lkml/2020/1/29/355. [accessed on 17 February 2022].

[6] Ed: musl libc, "musl time64 Release Notes," [Online]. Available: musl.libc.org/time64.html. [access on 17 February 2022].

[7] Ed.: GNU - Free Software Foundation, "The GNU C Library version 2.32 is now available," 6 August 2020. [Online]. Available: sourceware.org/pipermail/libc announce/2020/000029.html. [accessed on 17 February 2022].

[8] Ed.: GNU - Free Software Foundation, "The GNU C Library: 64-bit time symbol handling in the GNU C Library," [Online]. Available: www.gnu.org/software/libc/manual/html_node/64_002dbit-timesymbol-handling.html. [accessed on 17 February 2022