词条 | Year 2038 problem |
释义 |
The Year 2038 problem relates to representing time in many digital systems as the number of seconds passed since 1 January 1970 and storing it as a signed 32-bit binary integer. Such implementations cannot encode times after 03:14:07 UTC on 19 January 2038. Just like the Y2K problem, the Year 2038 problem is caused by insufficient capacity of the chosen storage unit. Technical causeThe latest time that can be represented in Unix's signed 32-bit integer time format is 03:14:07 UTC on Tuesday, 19 January 2038 (2{{sup|31}}-1 = 2,147,483,647 seconds after 1 January 1970).[1] Times beyond that will wrap around and be stored internally as a negative number, which these systems will interpret as having occurred on 13 December 1901 rather than 19 January 2038. This is caused by integer overflow. The counter runs out of usable digit bits, flips the sign bit instead, and reports a maximally negative number (then continues to count up, to zero, and then up through the positive integers again). Resulting erroneous calculations on such systems are likely to cause problems for users and other reliant parties. Programs that work with future dates will begin to run into problems sooner; for example a program that works with dates 20 years in the future should have been fixed no later than 19 January 2018. Early problemsIn May 2006, reports surfaced of an early manifestation of the Y2038 problem in the AOLserver software. The software was designed with a kludge to handle a database request that should "never" time out. Rather than specifically handling this special case, the initial design simply specified an arbitrary time-out date in the future. The default configuration for the server specified that the request should time out after one billion seconds. One billion seconds (approximately 32 years) after 01:27:28 UTC on 13 May 2006 is beyond the 2038 cutoff date. Thus, after this time, the time-out calculation overflowed and returned a date that was actually in the past, causing the 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.[2][3] Players of games or apps which are programmed to impose waiting periods[4] are running into this problem when they attempt to work around the waiting period on devices which harbor the coding, by manually setting their devices to a date past 19 January 2038, but are unable to do so, since a 32-bit Unix time format is being used. Vulnerable systemsEmbedded systems that use dates for either computation or diagnostic logging are most likely to be affected by the 2038 bug.[5]Many transportation systems from flight to automobiles use embedded systems extensively. In automotive systems, this may include anti-lock braking system (ABS), electronic stability control (ESC/ESP), traction control (TCS) and automatic four-wheel drive; aircraft may use inertial guidance systems and GPS receivers. However, this does not imply that all these systems will suffer from the bug, 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 problem. This is the case for automotive diagnostics based on legislative standards such as CARB (California Air Resources Board).[6] Another major use of embedded systems is in communications devices, including cell phones and Internet appliances (routers, wireless access points, etc.) which rely on storing an accurate time and date and are increasingly based on UNIX-like operating systems. For example, the bug makes some devices running 32-bit Android crash and not restart when the time is changed to that date.[7] Despite the modern 18–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 impractical or, in some cases, impossible to upgrade the software running these systems, ultimately requiring replacement if 32-bit UNIX_TIMESTAMP() will return 0 after 03:14:07 UTC on 19 January 2038.[8]Data structures with time problemsMany data structures in use today have 32-bit time representations embedded into their structure. 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:
Examples of systems using data structures that may contain 32-bit time representations include:
Any system making use of data structures containing 32-bit time representations will present risk. The degree of risk is dependent on the mode of failure. Network Time Protocol timestampsThe Network Time Protocol (NTP) has a related overflow issue, which manifests itself in 2036, rather than 2038. The 64-bit timestamps used by NTP consist of a 32-bit part for seconds and a 32-bit part for fractional second, giving NTP a time scale that rolls over every 232 seconds (136 years) and a theoretical resolution of 2−32 seconds (233 picoseconds). NTP uses an epoch of 1 January 1900. The first rollover occurs in 2036, prior to the UNIX year 2038 problem. Implementations should disambiguate NTP time using a knowledge of the approximate time from other sources. Since NTP only works with the differences between timestamps and never their absolute values, the wraparound is invisible in the calculations as long as the timestamps are within 68 years of each other. However, after a wraparound the clients can still face two problems:
This means that for NTP the rollover will be invisible for most running systems, since they will have the correct time to within a very small tolerance. However, systems that are starting up need to know the date within no more than 68 years. Given the large allowed error, it is not expected that this is too onerous a requirement. One suggested method is to set the clock to no earlier than the system build date or the release date of the current version of the NTP software. Many systems use a battery-powered hardware clock to avoid this problem. Even so, future versions of NTP may extend the time representation to 128 bits: 64 bits for the second and 64 bits for the fractional-second. The current NTP4 format has support for Era Number and Era Offset, that when used properly should aid fixing date rollover issues. According to Mills, "The 64 bit value for the fraction is enough to resolve the amount of time it takes a photon to pass an electron at the speed of light. The 64 bit second value is enough to provide unambiguous time representation until the universe goes dim."[9][10] {{anchor|292,277,026,596}}Possible solutionsThere is no universal solution for the Year 2038 problem. Any change to the definition of the There is also no universal solution for the issue with DVB and ATSC real-time transmitted dates due to issues with legacy receivers. The issue has yet to be acknowledged or resolved by either organization. The only workaround would be to discontinue all time-related metadata services such as programming guides and automatic date synchronization after the affected dates. One possible option would be to create new table types for the affected part of the specifications and use ISO 8601 date strings rather than fixed integers—as are used in ISO 9660 and ISO 13346 filesystems. Most operating systems designed to run on 64-bit hardware already use signed 64-bit FreeBSD uses 64-bit Starting with NetBSD version 6.0 (released in October 2012), the NetBSD operating system uses a 64-bit time_t for both 32-bit and 64-bit architectures. In contrast to NetBSD, there is no binary compatibility layer. Therefore, applications expecting a 32-bit time_t and applications using anything different from time_t to store time values may break.[14]Linux uses a 64-bit time_t for 64-bit architectures only; the pure 32-bit ABI is not changed due to backward compatibility.[15]There is ongoing work, mostly for embedded Linux systems, to support 64-bit The x32 ABI for Linux (which defines an environment for programs with 32-bit addresses but running the processor in 64-bit mode) uses a 64-bit Network File System version 4 has defined its time fields as Alternative proposals have been made (some of which are in use), such as storing either milliseconds or microseconds since an epoch (typically either 1 January 1970 or 1 January 2000) in a signed 64-bit integer, providing a minimum range of 300,000 years at microsecond resolution.[19][20] 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 of leap seconds. In particular, TAI64[21] is an implementation of the Temps Atomique International standard, the current international real-time standard for defining a second and frame of reference. See also
Notes1. ^{{cite book |title= Code quality: the open source perspective. |series= Effective software development series in Safari Books Online |author= Diomidis Spinellis |edition= illustrated |publisher= Adobe Press |year= 2006 |isbn= 0-321-16607-8 |url= https://books.google.com/books?id=vEN-ckcdtCwC&pg=PA49&dq=292,277,026,596&cd=1#v=onepage&q=292%2C277%2C026%2C596&f=false |page=49}} 2. ^{{cite web | url=http://substitute.livejournal.com/1430908.html | title=The Future Lies Ahead | date=28 June 2006 | accessdate=19 November 2006}} 3. ^Weird "memory leak" problem in AOLserver 3.4.2/3.x 12 May 2006 4. ^{{cite web|title=It isn't cheating it's time travel|url=http://kotaku.com/5977630/infinite-lives-in-candy-crush-saga-isnt-cheating-its-time-travel}} 5. ^{{cite news|url=https://www.theguardian.com/technology/2014/dec/17/is-the-year-2038-problem-the-new-y2k-bug|title=Is the Year 2038 problem the new Y2K bug?|newspaper=The Guardian|date=17 December 2014|accessdate=11 October 2018}} 6. ^{{cite web|url=http://www.arb.ca.gov/testmeth/testmeth.htm#vehicles|title=ARB Test Methods / Procedures|first=california air resources|last=board|website=www.arb.ca.gov}} 7. ^{{cite web |title=ZTE Blade running Android 2.2 has 2038 problems |url=https://issuetracker.google.com/issues/36928638 |accessdate=20 November 2018}} 8. ^{{cite web|url=https://bugs.mysql.com/bug.php?id=12654|title=MySQL Bugs: #12654: 64-bit unix timestamp is not supported in MySQL functions|website=bugs.mysql.com}} 9. ^University of Delaware Digital Systems Seminar presentation by David Mills, 2006-04-26 10. ^2−64 seconds is about 54 zeptoseconds or 54 x 10−21 seconds (light would travel 16.26 picometres, or approximately 0.31 × Bohr radius), and 264 seconds is about 585 billion years. 11. ^{{cite web|url=http://stablecross.com/files/End_Of_Time.html|date=17 April 2010|title=The End of Time|accessdate=19 March 2012}} 12. ^https://www.freebsd.org/cgi/man.cgi?arch 13. ^{{cite web|url=https://www.netbsd.org/releases/formal-6/NetBSD-6.0.html|date=17 October 2012|title=Announcing NetBSD 6.0|accessdate=18 January 2016}} 14. ^{{cite web|url=http://www.openbsd.org/plus55.html|date=1 May 2014|title=OpenBSD 5.5 released (May 1, 2014)|accessdate=18 January 2016}} 15. ^{{cite web|url=http://elinux.org/images/6/6e/End_of_Time_--_Embedded_Linux_Conference_2015.pdf|archiveurl=https://web.archive.org/web/20150922123604/http://www.elinux.org/images/6/6e/End_of_Time_--_Embedded_Linux_Conference_2015.pdf|archivedate=22 September 2015|date=25 March 2015|title=The end of time (32bit edition)|author=Arnd Bergmann|accessdate=9 March 2016}} 16. ^{{cite web|url=https://lwn.net/Articles/643234/|deadurl=no|archiveurl=https://web.archive.org/web/20151011035422/https://lwn.net/Articles/643234/|archivedate=11 October 2015|date=5 May 2015|title=System call conversion for year 2038|author=Jonathan Corbet|accessdate=9 March 2016}} 17. ^1 {{cite web|url=https://lwn.net/Articles/563285/|deadurl=no|archiveurl=https://web.archive.org/web/20160304081847/https://lwn.net/Articles/563285/|archivedate=4 March 2016|date=14 August 2013|title=Pondering 2038|author=Jonathan Corbet|accessdate=9 March 2016}} 18. ^{{cite web|url=https://tools.ietf.org/html/rfc7530#section-2.2 |title=RFC 7530}} 19. ^{{cite web|url=http://unununium.org/articles/uuutime|archiveurl=https://web.archive.org/web/20060408161959/http://unununium.org/articles/uuutime|archivedate=8 April 2006 |title=Unununium Time|accessdate=19 November 2006}} 20. ^{{cite web|url=https://docs.oracle.com/javase/9/docs/api/java/lang/System.html#currentTimeMillis--|title=Java API documentation for System.currentTimeMillis()|author=Sun Microsystems|accessdate=29 Sep 2017}} 21. ^{{cite web|url=http://cr.yp.to/libtai/tai64.html|title=TAI64|publisher=}} References{{Reflist|30em}}External links
7 : 2038|Future problems|Operating system technology|Time formatting and storage bugs|Unix|Linux|Software bugs |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。