Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Year 2038 problem

From Wikipedia, the free encyclopedia
Computer software bug occurring in 2038
An animated visual of the bug in action. Theoverflow error will occur at 03:14:08 UTC on 19 January 2038.

Theyear 2038 problem (also known asY2038,[1]Y2K38,Y2K38 superbug, or theEpochalypse[2][3]) is atime computing problem that leaves some computer systems unable to represent times after 03:14:07UTC on 19 January 2038.

The problem exists in systems which measureUnix time—the number of seconds elapsed since the Unixepoch (00:00:00 UTC on 1 January 1970)—and store it in asigned 32-bit integer. The data type is only capable of representing integers between −(231) and 231 − 1, meaning the latest time that can be properly encoded is 231 − 1 seconds after epoch (03:14:07 UTC on 19 January 2038). Attempting to increment to the following second (03:14:08) will cause theinteger to overflow, setting its value to −(231) which systems will interpret as 231 secondsbefore epoch (20:45:52 UTC on 13 December 1901). Systems usingunsigned 32-bit integers will overflow in2106. The problem resembles theyear 2000 problem but arises from limitations inbase-2 (binary) time representation, rather thanbase-10.

Computer systems that use time for critical computations may encounter fatal errors if the year 2038 problem is not addressed. Some applications that use future dates have already encountered the bug.[4][5] The most vulnerable systems are those which are infrequently or never updated, such aslegacy andembedded systems. Modern systems and software updates to legacy systems address this problem by using signed64-bit integers instead of 32-bit integers, which will take 292 billion years to overflow—approximately 21 times the estimatedage of the universe.[6]

Cause

[edit]

Many computer systems measure time and date usingUnix time, an international standard for digital timekeeping. Unix time is defined as the number of seconds elapsed, ignoringleap seconds, since 00:00:00UTC on 1 January 1970, known as theUnix epoch.

Unix time has historically been encoded as asigned 32-bit integer, a data type composed of 32binary digits (bits) which represent an integer value, with 'signed' meaning that the number can represent both positive and negative numbers, as well as zero; and is usually stored intwo's complement format.[a] Thus, a signed 32-bit integer can only represent integer values from −(231) to 231 − 1 inclusive. Consequently, if a signed 32-bit integer is used to store Unix time, the latest time that can be stored is 231 − 1 (2,147,483,647)[b] seconds after epoch, which is 03:14:07 UTC on 19 January 2038.[7] Systems that attempt to increment this value by one more second to 231 seconds after epoch (03:14:08) will sufferinteger overflow, inadvertently flipping the sign bit to indicate a negative number. This changes the integer value to −(231), or 231 secondsbefore epoch rather thanafter, which systems will interpret as 20:45:52 UTC on 13 December 1901. From here, systems will continue to count up, toward zero, and then up through the positive integers again. As many computer systems use time computations to run critical functions, the bug may introduce serious problems.

Vulnerable systems

[edit]

Any system usingdata structures with signed 32-bit time representations has an inherent risk of failing. A full list of these data structures is virtually impossible to derive, but there are well-known data structures that have the Unix time problem:

  • File systems that use 32 bits to represent times ininodes, such asext2,ext3, andreiserFS.
  • Databases with 32-bit time fields.
  • Database query languages (such asSQL) that haveUNIX_TIMESTAMP()-like commands.
  • Many 32-bitAndroid devices on Android 4 or earlier, includingZTE Blade,[8]Google Nexus 7[9] and 2012ToshibaAndroid tablets.[10]
  • OS X-eraPowerPC Macs will have their system clock get stuck on the rollover time as ofMac OS X Tiger.[11]
  • 32-bitiOS devices as ofiPhone 5 on circaiOS 9 will be unable to unlock or to consistently enter charging mode, and the lockscreen clock will not show up.[12]
  • As of circaWindows 10 version22H2, if anx86 (32-bit) device has not been turned on at the rollover point, but is started up after the rollover, the system clock skips ahead to April 12, 2160, and the date options in Windows 10's main settings menu does not show any selectable numbers.[13]
  • Software built withVisual Studio has the_gmtime32 format (which serves as a mapping oftime_t's 32-bit version) roll over at 19 January 2038 00:00:00. Software built with pre-2005 versions of Visual Studio were known to have_gmtime correspond to_gmtime32, and the correspondence can be forced when building with 32-bit versions of Visual Studio through Visual Studio 2019 by specifying_USE_32BIT_TIME_T.[14]

Embedded systems

[edit]

Embedded systems that use dates for either computation or diagnostic logging are most likely to be affected by the Y2038 problem.[1] Despite the modern18–24 month generational update in computer systems technology, embedded systems are designed to last the lifetime of the machine in which they are a component. It is conceivable that some of these systems may still be in use in 2038. It may be difficult or, in some cases, impossible to upgrade the software running these systems, ultimately requiring replacement if the 32-bit limitations are to be corrected.

Many transportation systems, from flight to automobiles, use embedded systems extensively. In automotive systems, this may includeanti-lock braking system (ABS),electronic stability control (ESC/ESP),traction control (TCS), and automaticfour-wheel drive; aircraft may useinertial guidance systems andGPS receivers.[c]

Another major use of embedded systems is in communications devices, includingcell phones and Internet-enabled appliances (e.g.routers,wireless access points,IP cameras) which rely on storing an accurate time and date and are increasingly based on Unix-like operating systems.

However, this does not imply that all embedded systems will suffer from the Y2038 problem, since many such systems do not require access to dates. For those that do, those systems which only track the difference between times/dates and not absolute times/dates will, by the nature of the calculation, not experience a major problem. This is the case for automotive diagnostics based on legislated standards such as CARB (California Air Resources Board).[15]

Early problems

[edit]

In May 2006, reports surfaced of an early manifestation of the Y2038 problem in theAOLserver software. The software was designed with akludge to handle a database request that should "never" time out. Rather than specifically handling this special case, the initial design simply specified an arbitrarytime-out date in the future with a default configuration specifying that requests should time out after a maximum of one billion seconds. However, one billion seconds before the 2038 cutoff date is 01:27:28 UTC on 13 May 2006, so requests sent after this time would result in a time-out date which is beyond the cutoff. This made time-out calculations overflow and return dates that were actually in the past, causing software to crash. When the problem was discovered, AOLServer operators had to edit the configuration file and set the time-out to a lower value.[4][5]

Many types of self-signedCA certificates generated on 32-bit systems can have very long expiration dates that go beyond the rollover point, which will make them not work correctly, affectingHTTPS verifications on services (for instanceVPNs) and sites that use them.[16]

The MS Filtering Engine Update anti-malware functions ofMicrosoft Exchange Server installations broke on January 1, 2022 after an update. The functions mapped the processed UpdateVersion numbers (which used a 9- or 10-digit YY-MM-DD-n format) to the Unix time stamp numbers despite their times being very different, so when the engine received the 220101001 (22-01-01 v001) update, which it took to mean 2201010001 with an extra zero near the end, it tried mapping it to the 32-bit Unix time's number and failed due to being higher than 2147483647.[17] Affected Exchange servers failed to work unless they turned off the anti-malware functions, and an automated fix was published on January 5, 2022.

InOracle Access Management version 10.1.4.3 for Windows, the Identity Console component sets a cookie containingUI preferences with an expiry of 500,000,000 seconds in the future (approximately 15 years, 312 days). This is beyond 19 January 2038 and so it throws anexception for certain search activities after 02:20:48 UTC on 17 March 2022 because thegmtime_r() call cannot convert the number provided to a date to write to the cookie.[18]

Some versions ofWindows Media Player Legacy refuse to run or be set up if the system time is on or after January 1, 2038.[19]

Solutions

[edit]

There is no universal solution for the Year 2038 problem. For example, in theC language, any change to the definition of thetime_t data type would result incode-compatibility problems in any application in which date and time representations are dependent on the nature of the signed 32-bittime_t integer. Changingtime_t to an unsigned 32-bit integer, which would extend the range to 2106[20] (specifically, 06:28:15 UTC on Sunday, 7 February 2106), would adversely affect programs that store, retrieve, or manipulate dates prior to 1970, as such dates are represented by negative numbers. Increasing the size of thetime_t type to 64 bits in an existing system would cause incompatible changes to the layout of structures and the binary interface of functions.

Most operating systems designed to run on 64-bithardware already use signed 64-bittime_t integers. Using a signed 64-bit value introduces a new wraparound date that is over twenty times greater than the estimatedage of the universe: approximately 292 billion years from now.[21] The ability to makecomputations on dates is limited by the fact thattm_year uses a signed 32-bit integer value starting at 1900 for the year. This limits the year to a maximum of 2,147,485,547 (2,147,483,647 + 1900).[22]

Alternative proposals have been made (some of which are already in use), such as storing eithermilliseconds ormicroseconds since an epoch (typically either 1 January 1970 or 1 January 2000) in a signed 64-bit integer, providing a minimum range of 292,000 years at microsecond resolution.[23][24] In particular, Java's and JavaScript's use of 64-bit signed integers to represent absolute timestamps as "milliseconds since 1 January 1970" will work correctly for the next292 million years. Other proposals for new time representations provide different precisions, ranges, and sizes (almost always wider than 32 bits), as well as solving other related problems, such as the handling ofleap seconds. In particular, TAI64[25] is an implementation of theInternational Atomic Time (TAI) standard, the current international real-time standard for defining a second and frame of reference.

Implemented solutions

[edit]
  • Starting withRuby version 1.9.2 (released on 18 August 2010), the bug with year 2038 is fixed,[26] by storing time in a signed 64-bit integer on systems with 32-bittime_t.[27]
  • Starting withNetBSD version 6.0 (released in October 2012), the NetBSD operating system uses a 64-bittime_t for both 32-bit and 64-bit architectures. Applications that were compiled for an older NetBSD release with 32-bittime_t are supported via a binary compatibility layer, but such older applications will still suffer from the Y2038 problem.[28]
  • OpenBSD since version 5.5, released in May 2014, also uses a 64-bittime_t for both 32-bit and 64-bit architectures. In contrast toNetBSD, there is no binary compatibility layer. Therefore, applications expecting a 32-bittime_t and applications using anything different fromtime_t to store time values may break.[29]
  • Linux originally used a 64-bittime_t for 64-bit architectures only; the pure 32-bitABI was not changed due to backward compatibility.[30] Starting with version5.6 of 2020, 64-bittime_t is supported on 32-bit architectures, too. This was done primarily for the sake ofembedded Linux systems.[31]
  • GNU C Library since version 2.34 (released August 2021), added support for using 64-bittime_t on 32-bit platforms with appropriate Linux versions. This support can be activated by defining preprocessor macro_TIME_BITS to64 when compiling source code.[32]
  • FreeBSD uses 64-bittime_t for all 32-bit and 64-bit architectures except 32-bit i386, which uses signed 32-bittime_t instead.[33]
  • Thex32 ABI for Linux (which defines an environment for programs with 32-bit addresses but running the processor in 64-bit mode) uses a 64-bittime_t. Since it was a new environment, there was no need for special compatibility precautions.[30]
  • Network File System version 4 has defined its time fields asstruct nfstime4 {int64_t seconds; uint32_t nseconds;} since December 2000.[34] Version 3 supports unsigned 32-bit values asstruct nfstime3 {uint32 seconds; uint32 nseconds;};.[35] Values greater than zero for the seconds field denote dates after the 0-hour, January 1, 1970. Values less than zero for the seconds field denote dates before the 0-hour, January 1, 1970. In both cases, the nseconds (nanoseconds) field is to be added to the seconds field for the final time representation.
  • Theext4 filesystem, when used with inode sizes larger than 128 bytes, has an extra 32-bit field per timestamp, of which 30 bits are used for the nanoseconds part of the timestamp, and the other 2 bits are used to extend the timestamp range to the year 2446.[36]
  • TheXFS filesystem, starting with Linux 5.10, has an optional "big timestamps" feature which extends the timestamp range to the year 2486.[37]
  • While the native APIs ofOpenVMS can support timestamps up to 31 July 31086,[38] the C runtime library (CRTL) uses 32-bit integers fortime_t.[39] As part of Y2K compliance work that was carried out in 1998, the CRTL was modified to use unsigned 32-bit integers to represent time; extending the range oftime_t up to 7 February 2106.[40]
  • As ofMySQL 8.0.28, released in January 2022, the functionsFROM_UNIXTIME(),UNIX_TIMESTAMP(), andCONVERT_TZ() handle 64-bit values on platforms that support them. This includes 64-bit versions of Linux, macOS, and Windows.[41][42] In older versions, built-in functions likeUNIX_TIMESTAMP() will return 0 after 03:14:07UTC on 19 January 2038.[43]
  • As ofMariaDB 11.5.1, released in May 2024, the data typeTIMESTAMP and functionsFROM_UNIXTIME(),UNIX_TIMESTAMP(), andCONVERT_TZ() handle unsigned 32-bit values on 64-bit versions of Linux, macOS, and Windows.[44] This extended the range to 2106-02-07 06:28:15 and allowed users to store such timestamp values in tables without changing the storage layout and thus staying fully compatible with existing user data.
  • Starting withVisual C++ 2005, the CRT uses a 64-bittime_t unless the_USE_32BIT_TIME_T preprocessor macro is defined.[45] However, theWindows API itself is unaffected by the year 2038 bug, asWindows internally tracks time as the number of 100-nanosecond intervals since 1 January 1601 in a 64-bit signed integer, which will not overflow until year30,828.[46]
  • The OS X rollover stuck system clock bug had been fixed as ofMac OS X El Capitan.
  • DOSBox-X removed a dependency on the Int32x32To64 macro for time calculation in version 2025.02.01.[47]
  • For Windows devices whose clocks have jumped ahead, a number of software tools to edit system settings or to sync with time servers exist that can mitigate any effects.
  • Microsoft's syntax guides for Visual Studio have discouraged the use of_USE_32BIT_TIME_T, and it has not been allowed when building with 64-bit versions of Visual Studio.[14]
  • Despite the age of the Oracle Access Manager version in question (18 June 2009), Oracle issued the patch 33983548 on 6 April 2022. Newer versions of Oracle Access Manager are not known to be affected by the problem.

See also

[edit]

Notes

[edit]
  1. ^Unless otherwise specified, all the numbers provided in this article have been derived using two's complement for signed integer arithmetic.
  2. ^2,147,483,647 is a double Mersenne prime
  3. ^GPS suffers its own time counter overflow problem known asGPS Week Number Rollover.

References

[edit]
  1. ^abGibbs, Samuel (17 December 2014)."Is the Year 2038 problem the new Y2K bug?".The Guardian.Archived from the original on 25 January 2022. Retrieved11 October 2018.
  2. ^Bergmann, Arnd (6 February 2020)."The end of an Era". Linaro.Archived from the original on 7 February 2020. Retrieved13 September 2020.
  3. ^Wagenseil, Paul (28 July 2017)."Digital 'Epochalypse' Could Bring World to Grinding Halt".Tom's Guide.Archived from the original on 29 November 2021. Retrieved13 September 2020.
  4. ^ab"The Future Lies Ahead". 28 June 2006.Archived from the original on 28 November 2006. Retrieved19 November 2006.
  5. ^abWeird "memory leak" problem in AOLserver 3.4.2/3.xArchived 4 January 2010 at theWayback Machine 12 May 2006
  6. ^263 seconds ÷ 60 seconds/minute ÷ 60 minutes/hour ÷ 24 hours/day ÷ (146097 days/400 years =) 365.2425 days/Gregorian year [≈ 292.277 billion (Gregorian) years] ÷13.79 billion years ≈ 21.19 times the estimated age of the universe after midnightUTC on January 1, 1970, neglectingleap seconds.
  7. ^Diomidis Spinellis (2006).Code quality: the open source perspective. Effective software development series inSafari Books Online (illustrated ed.).Adobe Press. p. 49.ISBN 978-0-321-16607-4.
  8. ^"ZTE Blade running Android 2.2 has 2038 problems".Archived from the original on 19 May 2022. Retrieved20 November 2018.
  9. ^Larry Seltzer (19 January 2013)."25 Years From Today: A Time for Bugs".InformationWeek.Archived from the original on 26 August 2025. Retrieved16 August 2025.
  10. ^"Toshiba TOSHIBA AT300"(PDF). 2012.Archived(PDF) from the original on 4 September 2025. Retrieved16 August 2025.
  11. ^"The year 2038 problem". Interlinked. Archived fromthe original on 16 July 2014. Retrieved16 August 2025.
  12. ^Ternary (10 December 2015)."The iPhone Apocalypse: January 19, 2038".MacRumors. Retrieved17 August 2025.
  13. ^Sayan Sen (6 March 2024)."Remember Y2K? Windows 95, 98, 2000-era app surprisingly stands tall against Y2K38 superbug".Neowin.Archived from the original on 3 September 2025. Retrieved19 August 2025.
  14. ^ab"gmtime, _gmtime32, _gmtime64". Microsoft Learn. 2 March 2024.Archived from the original on 8 December 2024. Retrieved11 September 2025.
  15. ^"ARB Test Methods / Procedures".ARB.ca.gov.California Air Resources Board. Archived fromthe original on 18 November 2016. Retrieved12 September 2013.
  16. ^Thomas Claburn (9 February 2025)."Curious tale of broken VPNs, the Year 2038, and certs that expired 100 years ago".The Register.Archived from the original on 1 August 2025. Retrieved17 August 2025.
  17. ^Dean Howell (1 January 2022)."Y2K22 bug: Microsoft rings in the new year by breaking Exchange servers all around the world".Neowin.Archived from the original on 24 August 2025. Retrieved19 August 2025.
  18. ^"Oracle Access Manager".Oracle Communities. Oracle Corporation. 24 March 2022. Retrieved25 February 2023.
  19. ^"Your outdated version of Windows Media Player 6 will still work after the Y2K38 bug ends civilization".www.techspot.com. Techspot. 7 March 2024.Archived from the original on 7 March 2024. Retrieved2 November 2023.
  20. ^"DRAFT: Y2038 Proofness Design".Archived from the original on 21 September 2019. Retrieved25 May 2024.
  21. ^Endrestøl, Trond (10 March 2015)."When does the 64-bit Unix time_t really end?".Ximalas.Archived from the original on 23 September 2022. Retrieved24 September 2022.
  22. ^Felts, Bob (17 April 2010)."The End of Time".Stablecross.com.Archived from the original on 11 October 2012. Retrieved19 March 2012.
  23. ^"Unununium Time". Archived fromthe original on 8 April 2006. Retrieved19 November 2006.
  24. ^Sun Microsystems."Java API documentation for System.currentTimeMillis()".Archived from the original on 30 September 2017. Retrieved29 September 2017.
  25. ^"TAI64".Archived from the original on 26 September 2012. Retrieved4 September 2012.
  26. ^"Ruby 1.9.2 is released". 18 August 2010.Archived from the original on 8 April 2022. Retrieved1 April 2022.
  27. ^"time.c: use 64bit arithmetic even on platforms with 32bit VALUE".GitHub.Archived from the original on 3 November 2023. Retrieved3 November 2023.
  28. ^"Announcing NetBSD 6.0". 17 October 2012.Archived from the original on 15 January 2016. Retrieved18 January 2016.
  29. ^"OpenBSD 5.5 released (May 1, 2014)". 1 May 2014.Archived from the original on 22 December 2015. Retrieved18 January 2016.
  30. ^abJonathan Corbet (14 August 2013)."Pondering 2038".LWN.net.Archived from the original on 4 March 2016. Retrieved9 March 2016.
  31. ^"LKML: Arnd Bergmann: [GIT PULL] y2038: core, driver and file system changes".lkml.org.Archived from the original on 14 February 2020. Retrieved30 January 2020.
  32. ^O'Donell, Carlos (2 August 2021)."The GNU C Library version 2.34 is now available".Sourceware.Archived from the original on 30 April 2024. Retrieved30 April 2024.
  33. ^"arch".www.freebsd.org.Archived from the original on 26 September 2018. Retrieved26 September 2018.
  34. ^Haynes, Thomas; Noveck, David, eds. (March 2015)."Structured Data Types".Network File System (NFS) Version 4 Protocol. sec. 2.2.doi:10.17487/RFC7530.RFC7530.
  35. ^Staubach, Peter; Pawlowski, Brian; Callaghan, Brent (June 1995)."NFS Version 3 Protocol Specification".Archived from the original on 15 May 2024. Retrieved25 May 2024.
  36. ^"ext4 Data Structures and Algorithms".Archived from the original on 13 September 2022. Retrieved13 September 2022.
  37. ^Michael Larabel (15 October 2020)."XFS File-System With Linux 5.10 Punts Year 2038 Problem To The Year 2486".Phoronix.Archived from the original on 13 September 2022. Retrieved13 September 2022.
  38. ^"Why is Wednesday, November 17, 1858 the base time for OpenVMS (VAX VMS)?".Stanford University. 24 July 1997.Archived from the original on 24 July 1997. Retrieved8 January 2020.
  39. ^"VSI C Run-Time Library Reference Manual for OpenVMS Systems"(PDF). VSI. November 2020. Archived fromthe original(PDF) on 17 April 2021. Retrieved17 April 2021.
  40. ^"OpenVMS and the year 2038". HP.Archived from the original on 17 April 2021. Retrieved17 April 2021.
  41. ^"What Is New in MySQL 8.0".dev.mysql.com.Archived from the original on 13 November 2021. Retrieved13 November 2021.
  42. ^"Changes in MySQL 8.0.28 (2022-01-18, General Availability)".dev.mysql.com.Archived from the original on 8 December 2023. Retrieved14 May 2024.
  43. ^"MySQL Bugs: #12654: 64-bit unix timestamp is not supported in MySQL functions".bugs.mysql.com.Archived from the original on 29 March 2017. Retrieved28 March 2017.
  44. ^"MariaDB 11.5.1 Release Notes".MariaDB KnowledgeBase.Archived from the original on 7 September 2024. Retrieved6 September 2024.
  45. ^"Microsoft C/C++ change history 2003 - 2015".learn.microsoft.com. 25 May 2023. Retrieved13 August 2024.
  46. ^"About Time - Win32 apps".learn.microsoft.com. 7 January 2021. Retrieved13 August 2024.
  47. ^Jon Campbell."DOSBox-X 2025.02.01 Release Notes".Archived from the original on 23 April 2025. Retrieved19 August 2025.

External links

[edit]
Year-related problems
Decimal or BCD storage related
Binary storage related
Hexadecimal storage related
Technological
Sociological
Ecological
Climate change
Earth Overshoot Day
Biological
Extinction
Others
Astronomical
Eschatological
Others
Fictional
Organizations
General

Retrieved from "https://en.wikipedia.org/w/index.php?title=Year_2038_problem&oldid=1321223308"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp