Bug compatibility

From HandWiki
Short description: Programming term

Computer hardware or software is said to be bug compatible if it exactly replicates an undesirable feature[1] of a previous version. The phrase is found in the Jargon File.[2]

An aspect of maintaining backward compatibility with an older system is that such systems' client programs often do not only depend on their specified interfaces but also bugs and unintended behaviour. That must also be preserved by the newer replacement. Besides the significantly higher complexity that needs to be maintained during the natural evolution of the code or interface, it can sometimes cause performance or security issues, and the inconsistencies in the behaviour of interfaces can sometimes lead to new bugs in the software using it, creating difficult to resolve multi-directional cross dependencies between various pieces of code.[3]

Examples

DOS

Examples can be found in MS-DOS/PC DOS: When MS-DOS/PC DOS 3.1 and higher (including Windows 9x) and OS/2 detect certain FAT OEM labels, they do not trust some BIOS Parameter Block (BPB) values and recalculate them from other disk geometry parameters in order to work around several off-by-one calculation errors caused by some of their formatter software under earlier issues of these systems.[4][5][6][7] While this undocumented behaviour allows them to cope with these incorrectly formatted volumes specifically, it limits the flexibility of disk geometries they can work with in general and can cause them to trash validly formatted volumes created by third-parties if they deviate from the defaults used by Microsoft and IBM.[6][7] When MS-DOS/PC DOS 5.0 and higher are running on 286 or higher processors, the resident executable loader contains code specially designed to detect and fix certain widespread applications and stub loaders (such as programs linked with older versions of Microsoft's EXEPACK or Rational Systems' 386 DOS extenders) by patching the loaded program image before executing it.[8] Under certain conditions an underlying DOS also patches Windows (WINA20.386).[9]

Over the course of development, DR-DOS also had to be modified to not only emulate many undocumented peculiarities and undesirable properties of MS-DOS and PC DOS (like having to use certain misleading filenames such as IBMBIO.COM, IBMDOS.COM or COUNTRY.SYS for files which do not follow the specs for executables under DOS,[10][11][12][nb 1] or having to introduce a directory path length-limited Current Directory Structure (CDS) internally[9][13][14]), but also actual bugs in the kernel and several drivers, in order to make certain other drivers and applications run on DR-DOS, when they were tested on specific versions of MS-DOS only.[9][6][8][15][16][17]

Windows

Windows, which has traditionally emulated many old system bugs to allow older low-level programs to run, is another example. As a result, Wine, which makes it possible to run many Windows applications on other platforms, also needs to maintain bug compatibility with Windows.[18]

When Microsoft phased out support for 16-bit code in Windows by no longer including NTVDM in 64-bit editions of the operating system, the executable loader was modified to recognize some specific 16-bit stub launchers and installers and replace them on-the-fly with equivalent code stubs that run on 64-bit processors.[19][20]

Other

During development of its IBM PC compatible, Compaq engineers found that Microsoft Flight Simulator would not run because of what subLOGIC's Bruce Artwick described as "a bug in one of Intel's chips", forcing them to make their computer bug-compatible with the IBM PC.[21] Another hardware example is found in the design of the IBM Personal Computer/AT A20 address line to emulate the behaviour in older processors.[8][15]

Microsoft Excel has always had a deliberate leap year bug, which falsely treats 29 February 1900 as an actual date, to ensure backward compatibility with Lotus 1-2-3.[22]

Hyrum Wright, an engineer at Google, talks about this problem that he observed firsthand while working on C++ core libraries. It was Titus Winters, also an engineer at Google, who popularized this concept on a larger scale as "Hyrum's Law".[23]

See also

Notes

  1. The IBMBIO.COM and IBMDOS.COM files are special binary images containing executable code. Accidentally trying to run them from the prompt as if they were normal COM-style programs would result in the system to crash. This is the reason why these files have the hidden attribute set under MS-DOS/PC DOS. This could have been avoided by choosing other file extensions (like with DRBIOS.SYS and DRBDOS.SYS), but could not be done later on in order to remain compatible with various tools expecting these particular filenames. To eliminate the risk of crashes, these files were changed into fat binaries with DR-DOS 7.02 and higher now including tiny stubs to exit gracefully when invoked inappropriately.[a][b]

References

  1. "bug-for-bug compatible". http://www.catb.org/jargon/html/B/bug-for-bug-compatible.html. "Same as bug-compatible, with the additional implication that much tedious effort went into ensuring that each (known) bug was replicated." 
  2. "Bug-compatible - www.jargon.net". http://www.jargon.net/jargonfile/b/bug-compatible.html. 
  3. Pontin, Jason (26 December 1994). "Windows 95's third delay; needs polish". InfoWorld (InfoWorld Media Group, Inc.) 16 (52): 18. https://books.google.com/books?id=gDgEAAAAMBAJ&pg=PA18. 
  4. Programmer's Technical Reference for MSDOS and the IBM PC. 1992-01-12. DOSREF. ISBN 1-878830-02-3. http://www.o3one.org/hwdocs/bios_doc/dosref22.html. Retrieved 2012-01-08.  (NB. The author mentions that DOS 4.0 checks the OEM label, but denies that DOS 3.2 checks it as well (although it does).)
  5. Bass, Wally (1994-02-14). "Cluster Size". Newsgroupcomp.os.msdos.programmer. Archived from the original on 2017-09-09. Retrieved 2006-10-14.
  6. 6.0 6.1 6.2 "Need DOS 6.22 (Not OEM)". alt.msdos.programmer. 2002-02-20. https://groups.google.com/d/msg/alt.msdos.programmer/MAv9LuYQjs8/HuYCph4KsQYJ. 
  7. 7.0 7.1 "NOVOLTRK.REG". www.drdos.org. 2004-08-25. http://www.ibiblio.org/pub/micro/pc-stuff/freedos/win9x/NOVOLTRK.ZIP.  [1]
  8. 8.0 8.1 8.2 "Re: masm .com (PSP) related trouble". alt.lang.asm. 2002-10-07. https://groups.google.com/d/msg/alt.lang.asm/PNOd9zfYow0/vXbab16j4XwJ. 
  9. 9.0 9.1 9.2 Undocumented DOS: A programmer's guide to reserved MS-DOS functions and data structures - expanded to include MS-DOS 6, Novell DOS and Windows 3.1 (2 ed.). Reading, Massachusetts: Addison Wesley. 1994. ISBN 0-201-63287-X. https://archive.org/details/undocumenteddosp00andr_0.  (xviii+856+vi pages, 3.5"-floppy) Errata: [2][3]
  10. "Caldera OpenDOS 7.01/7.02 Update Alpha 3 IBMBIO.COM README.TXT". 1997-10-02. http://www.uni-bonn.de/~uzs180/download/ibmbioa3.zip.  [4]
  11. DR-DOS 7.03 WHATSNEW.TXT - Changes from DR-DOS 7.02 to DR-DOS 7.03. Caldera, Inc.. 1998-12-24. http://www.lookas.net/ftp/incoming/darbui/Justas/DRDOS/WHATSNEW.TXT. Retrieved 2019-04-08. 
  12. "DOS COUNTRY.SYS file format". 2001-06-10. http://www.columbia.edu/~em36/wpdos/MatthiasPaulCPI.zip. 
  13. "Chapter 1.3.xi: Überlange Pfade" (in de). NWDOS7UN.TXT — Zusammenfassung der dokumentierten und undokumentierten Fähigkeiten von Novell DOS 7. MPDOSTIP. 1997-06-07. http://www.antonis.de/dos/dos-tuts/mpdostip/html/nwdos7un.htm. Retrieved 2016-11-07. 
  14. (in de) NWDOS-TIPs — Tips & Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds. MPDOSTIP (3 ed.). 1997-07-30. http://www.antonis.de/dos/dos-tuts/mpdostip/html/nwdostip.htm. Retrieved 2014-08-06.  (NB. NWDOSTIP.TXT is a comprehensive work on Novell DOS 7 and OpenDOS 7.01, including the description of many undocumented features and internals. It is part of the author's yet larger MPDOSTIP.ZIP collection maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the NWDOSTIP.TXT file.) [5]
  15. 15.0 15.1 "Treiber dynamisch nachladen (Intra-Segment-Offset-Relokation zum Laden von TSRs in die HMA)" (in German). de.comp.os.msdos. 2002-02-02. https://groups.google.com/d/msg/de.comp.os.msdos/tdvpBoMVN6A/a_zqDxGk22IJ.  (NB. Gives a comprehensive overview on the history and "nature" of the HMA and the non-obvious design constraints to be observed when developing resident system extensions to be loaded into the HMA.)
  16. Paul, Matthias R. (2002-04-01). "Fix for CauseWay DOS extender under DR-DOS 7.0x EMM386.EXE". Newsgroupcomp.os.msdos.programmer. Archived from the original on 2018-09-19. Retrieved 2018-09-19.
  17. "Re: [fd-dev On GRAFTABL and DISPLAY.SYS (Was: Changing codepages in FreeDOS)"]. freedos-dev. 2001-08-18. https://marc.info/?l=freedos-dev&m=99816495921290&w=2. 
  18. "WineFeatures - The Official Wine Wiki". https://wiki.winehq.org/Wine_Features. 
  19. "Application Installation on 64-bit Systems". Microsoft. 2018-05-31. https://msdn.microsoft.com/en-us/library/windows/desktop/aa384143(v=vs.85).aspx. 
  20. "64-bit versions of Windows do not support 16-bit components, 16-bit processes, or 16-bit applications". Microsoft. 2020-09-08. https://support.microsoft.com/en-us/kb/896458. 
  21. "Bruce Artwick / The Designer Behind Flight Simulator II". Compute!'s Gazette: p. 32. January 1985. https://archive.org/stream/1985-01-computegazette/Compute_Gazette_Issue_19_1985_Jan#page/n33/mode/2up. 
  22. Excel incorrectly assumes that the year 1900 is a leap year. Retrieved 2019-05-01.
  23. "Software Engineering at Google [Book"] (in en). https://www.oreilly.com/library/view/software-engineering-at/9781492082781/.