Heisenbug

In computer programming jargon, a heisenbug is a software bug that seems to disappear or alter its behavior when one attempts to study it.[1] The term is a pun on the name of Werner Heisenberg, the physicist who first asserted the observer effect of quantum mechanics, which states that the act of observing a system inevitably alters its state. In electronics, the traditional term is probe effect, where attaching a test probe to a device changes its behavior.

Similar terms, such as bohrbug, mandelbug,[2][3][4] hindenbug, and schrödinbug[5][6] (see the section on related terms) have been occasionally proposed for other kinds of unusual software bugs, sometimes in jest.[7][8]

Examples

Heisenbugs occur because common attempts to debug a program, such as inserting output statements or running it with a debugger, usually have the side-effect of altering the behavior of the program in subtle ways, such as changing the memory addresses of variables and the timing of its execution.

One common example of a heisenbug is a bug that appears when the program is compiled with an optimizing compiler, but not when the same program is compiled without optimization (as is often done for the purpose of examining it with a debugger). While debugging, values that an optimized program would normally keep in registers are often pushed to main memory. This may affect, for instance, the result of floating-point comparisons, since the value in memory may have smaller range and accuracy than the value in the register[citation needed]. Similarly, heisenbugs may be caused by side-effects in test expressions used in runtime assertions in languages such as C and C++, where the test expression is not evaluated when assertions are turned off in production code using the NDEBUG macro.

Other common causes of heisenbugs are using the value of a non-initialized variable (which may change its address or initial value during debugging), or following an invalid pointer (which may point to a different place when debugging). Debuggers also commonly allow the use of breakpoints or provide other user interfaces that cause additional source code (such as property accessors) to be executed stealthily, which can, in turn, change the state of the program.[9]

End-Users can experience a heisenbug when the act of making a screenshot of the heisenbug for observation fixes the heisenbug and the screenshot shows a perfectly working state. This effect can happen when complex stacks of software work together, for example a web browser using a hardware graphic card acceleration which causes rendering errors on the physical screen that do not show on a screenshot.

Time can also be a factor in heisenbugs, particularly with multi-threaded applications. Executing a program under control of a debugger can change the execution timing of the program as compared to normal execution. Time-sensitive bugs, such as race conditions, may not occur when the program is slowed down by single-stepping source lines in the debugger. This is particularly true when the behavior involves interaction with an entity not under the control of a debugger, such as when debugging network packet processing between two machines and only one is under debugger control.

Heisenbugs can be viewed as instances of the observer effect in information technology. Frustrated programmers may humorously blame a heisenbug on the phase of the moon,[10] or (if it has occurred only once) may explain it away as a soft error due to alpha particles or cosmic rays affecting the hardware, a well-documented phenomenon known as single event effects.

A bohrbug, by way of contrast, is a "good, solid bug". Like the deterministic Bohr atom model, they do not change their behavior and are relatively easily detected.[11][12]

A mandelbug (named after Benoît Mandelbrot's fractal) is a bug whose causes are so complex it defies repair, or makes its behavior appear chaotic or even non-deterministic.[2] The term also refers to a bug that exhibits fractal behavior (that is, self-similarity) by revealing more bugs (the deeper a developer goes into the code to fix it the more bugs they find).[citation needed]

A schrödinbug or schroedinbug (named after Erwin Schrödinger and his thought experiment) is a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.[5]

A hindenbug[13] (named after the Hindenburg disaster) is a bug with catastrophic behavior.

A higgs-bugson[14][15] (named after the Higgs boson particle) is a bug that is predicted to exist based upon other observed conditions (most commonly, vaguely related log entries and anecdotal user reports) but is difficult, if not impossible, to artificially reproduce in a development or test environment. The term may also refer to a bug that is obvious in the code (mathematically proven), but which cannot be seen in execution (yet difficult or impossible to actually find in existence).

Etymology

The term was used in 1985 by Jim Gray, in a paper about software failures[16] (and is sometimes mistakenly attributed to him because of this publication) and also in 1986 by Jonathan Clark and Zhahai Stewart on the mailing list (later Usenet news group) comp.risks.[17]

Bruce Lindsay, a researcher at IBM, affirmed in a 2004 ACM Queue interview that he was present when the Heisenbug was originally defined.[18]

An earlier appearance in ACM publications is from 1983.[19]

Resolution

Heisenbugs are difficult to identify and fix; often attempting to resolve them leads to further unexpected behavior. Because the problem manifests as the result of a separate, underpinning bug, the behavior can be hard to predict and analyze during debugging. Overall the number of heisenbugs identified should decrease as a piece of software matures.[20]

See also

References

  1. ^ "The Jargon File: heisenbug".
  2. ^ a b "The Jargon File: Mandelbug". Catb.org. Retrieved 2013-09-05.
  3. ^ Raymond, Eric S.; The New Hacker's Dictionary, 3rd edition, 1996
  4. ^ Clarke, Arthur C., The Ghost from the Grand Banks, Bantam Books, 1990
  5. ^ a b "The Jargon File: Schroedinbug". Catb.org. Retrieved 2013-09-05.
  6. ^ Raymond, Eric S.; The New Hacker's Dictionary, 3rd edition, 1996
  7. ^ The following article investigates the various definitions of bohrbug, mandelbug and heisenbug proposed in the literature, as well as the statements made about the relationships between these fault types: Grottke, Michael; and Trivedi, Kishor S.; Software Faults, Software Aging and Software Rejuvenation, Journal of the Reliability Engineering Association of Japan, Vol. 27, No. 7, pp. 425–438, 2005.
  8. ^ Grottke, Michael; and Trivedi, Kishor S.; Fighting Bugs: Remove, Retry, Replicate, and Rejuvenate, IEEE Computer vol. 40, no. 2 (February 2007), pp. 107–109
  9. ^ "Java toString() override with initialization as a side effect" Archived 2014-12-30 at the Wayback Machine
  10. ^ CATB.org, "phase of the moon"
  11. ^ Goshgarian, Gary; Exploring Language, HarperCollins College Publishers, 1995
  12. ^ "Such transient software failures have been given the whimsical name 'Heisenbug' because they disappear when reexamined. By contrast, 'Bohrbugs' are good solid bugs." (IEEE Computer Group News, Volume 24, Numbers 7–12, 1991)
  13. ^ "Hinden Bug".[better source needed]
  14. ^ "New Programming Jargon". 20 July 2012.
  15. ^ "20 Hilarious Programming Jargon Phrases You Should Use When Talking to Engineers". Business Insider.
  16. ^ Gray, Jim (1985). "Why Do Computers Stop And What Can Be Done About It?". Technical Report 85.7. Tandem Computers.
  17. ^ (16 December 1986) RISKS DIGEST 4.30 - (23 December 1986) RISKS DIGEST 4.34, moderated by Peter G. Neumann
  18. ^ ""A Conversation with Bruce Lindsay", ACM Queue vol. 2, no. 8 - November 2004". Queue.acm.org. Retrieved 2013-09-05.
  19. ^ Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on High-Level Debugging, Pacific Grove, California, March 20–23, 1983, Association for Computing Machinery, 1983, Google Books search:

    This is the Heisenberg Uncertainty Principle as applied to debugging (an instance of such a bug was called a "Heisenbug" by one participant.)

    Also cited in LeBlanc, Richard J.; Robbins, Arnold D.; Event-Driven Monitoring of Distributed Programs, in Proceedings of the IEEE 5th International Conference on Distributed Computing Systems (ICDCS), IEEE Computer Society, Computer Society Press, 1985, pp. 515-522 Google Books search:

    This the Heisenberg Uncertainty Principle as applied to Debugging, sometimes called the "Heisenbug" Principle [ACM83].

  20. ^ P., Birman, Kenneth (2005). Reliable distributed systems : technologies, Web services, and applications. New York: Springer. ISBN 0387276017. OCLC 225378026.{{cite book}}: CS1 maint: multiple names: authors list (link)

Read other articles:

География Узбекистана Часть света Азия Регион Средняя Азия Координаты 41°00 с. ш., 64°00 в. д. Площадь 56-я в мире 448 900 км² вода: 10 % суша: 90 % Береговая линия 0 км Границы всего: 6221 кмАфганистан (137 км)Казахстан (2203 км)Кыргызстан (1099 км)Таджикистан (1161 км)Туркменистан (1621 км) Вы�...

 

Halaman ini berisi artikel tentang bahasa yang menjadi akar dari bahasa Indonesia dan bahasa Melayu Malaysia. Untuk bentuk bakunya di Malaysia, lihat Bahasa Melayu Malaysia. Untuk bentuk bakunya di Indonesia, lihat Bahasa Indonesia. Cari artikel bahasa  Cari berdasarkan kode ISO 639 (Uji coba)  Kolom pencarian ini hanya didukung oleh beberapa antarmuka Halaman bahasa acak Bahasa MelayuBPS: 0030 3 Bahasa Melayuبهاس ملايو • ꤷꥁꤼ ꤸꥍꤾꤿꥈ Bahasa MelindoBahas...

 

American politician Godlove OrthUnited States Ambassador to Austria In officeMarch 9, 1875 – March 10, 1876PresidentUlysses S. GrantPreceded byJohn Jay IISucceeded byEdward F. BealeMember of the U.S. House of Representativesfrom Indiana's 9th districtIn officeMarch 4, 1881 – December 16, 1882Preceded byMichael D. WhiteSucceeded byCharles T. DoxeyMember of the U.S. House of Representativesfrom Indiana's At-Large districtIn officeMarch 4, 1873 ...

A piece of equipment that distributes electric power This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Electric switchboard – news · newspapers · books · scholar · JSTOR (May 2022) (Learn how and when to remove this template message) A low-voltage switchboard A modern electric switchboard An electric switchboa...

 

American TV series or program The Fashion ShowGenreReality televisionCreated byEli HolzmanStarring Isaac Mizrahi Fern Mallis (season 1) Kelly Rowland (season 1) Iman (season 2) Laura Brown (season 2) Country of originUnited StatesOriginal languageEnglishNo. of seasons2No. of episodes22ProductionRunning time42 minutesProduction companyLeft/Right ProductionsOriginal releaseNetworkBravoReleaseMay 7, 2009 (2009-05-07) –January 25, 2011 (2011-01-25) The Fashion Show: Ultimate Col...

 

American singer and actress (1903-1965) For the attorney and author of 'Project Girl', see Janet McDonald. Not to be confused with Jane McDonald. Jeanette MacDonaldMacDonald in 1934BornJeannette Anna McDonald[1](1903-06-18)June 18, 1903Philadelphia, Pennsylvania, U.S.DiedJanuary 14, 1965(1965-01-14) (aged 61)Houston, Texas, U.S.Resting placeForest Lawn Memorial Park, Glendale, CaliforniaOther namesJeanette MacDonaldOccupationsActresssingerradio hostphilanthropistYears a...

Music genre Not to be confused with Israeli hip hop. Jewish hip hopStylistic originsJewish music, hip hop, klezmer, reggae, world musicCultural originsEarly 2000s, North America, Israel, and EuropeTypical instrumentsRapping, turntabling, beatboxing, samplingOther topicsJewish rock, Israeli hip hop Jewish hip hop is a genre of hip hop music with thematic, stylistic, or cultural ties to Judaism and its musical traditions. Characteristics Jewish hip hop artists have come from a wide variety of c...

 

Pour les articles homonymes, voir Ince. Thomas H. Ince Thomas H. Ince en 1916 Données clés Naissance 6 novembre 1882Newport, Rhode Island (États-Unis) Nationalité Américaine Décès 19 novembre 1924 (à 42 ans)Beverly Hills, Californie (États-Unis) Profession Acteur, réalisateur, producteur et scénariste modifier En 1920 Thomas Harper Ince est un cinéaste et acteur américain, pionnier du cinéma muet, né le 6 novembre 1882 à Newport (Rhode Island) et mort le 19 novembre 1924...

 

SandshrewNomor PokédexNasional #027 Sebelumnya Selanjutnya Raichu (#026) Sandslash (#028) RegionalKanto#027Johto#048Hoenn#112Unova#113Info produksiGenerasiI (Pertama) - 1996PerancangKen Sugimori Info Pokémon TipetanahSpesiesPokémon tikusKemampuanSand Veil (Selubung Pasir) Sand Rush (Terjangan Pasir) – tersembunyiTinggi0,6 m (24 in)Berat12 kg (26 pon)Rasio gender 50% jantan  •  50% betina Evolusi SandshrewSandsl...

马来亚大学University of Malaya(英語)Universiti Malaya(馬來語)老校名七州府医学堂、爱德华七世医学院、莱佛士学院校训Knowledge is the Source of Progress(英語)Ilmu Punca Kemajuan(馬來語)校訓中譯「知识乃成功之本」创办时间1905年9月28日,​118年前​(1905-09-28)[1][2]学校类型国立综合研究型大学捐贈基金$385 million(2017年8月)校监Sultan Nazrin Muizzuddin Shah ibni Almar...

 

Державний комітет телебачення і радіомовлення України (Держкомтелерадіо) Приміщення комітетуЗагальна інформаціяКраїна  УкраїнаДата створення 2003Керівне відомство Кабінет Міністрів УкраїниРічний бюджет 1 964 898 500 ₴[1]Голова Олег НаливайкоПідвідомчі ор...

 

History NameEmpire Birch OwnerMinistry of War Transport OperatorMinistry of War Transport Port of registry Hull BuilderHenry Scarr Ltd, Hessle. Yard number418 Launched9 August 1941 Completed12 December 1941 Identification UK Official Number 167111 Code Letters BCVM FateStruck mine, beached, and sank 10 August 1942 General characteristics Tonnage245 GRT, 229 NRT Length106 ft 7 in (32.49 m) Beam26 ft 7 in (8.10 m) Draught11 ft 6 in (3.51 m...

此條目可能包含不适用或被曲解的引用资料,部分内容的准确性无法被证實。 (2023年1月5日)请协助校核其中的错误以改善这篇条目。详情请参见条目的讨论页。 各国相关 主題列表 索引 国内生产总值 石油储量 国防预算 武装部队(军事) 官方语言 人口統計 人口密度 生育率 出生率 死亡率 自杀率 谋杀率 失业率 储蓄率 识字率 出口额 进口额 煤产量 发电量 监禁率 死刑 国债 ...

 

Events at the1999 World ChampionshipsTrack events100 mmenwomen200 mmenwomen400 mmenwomen800 mmenwomen1500 mmenwomen5000 mmenwomen10,000 mmenwomen100 m hurdleswomen110 m hurdlesmen400 m hurdlesmenwomen3000 msteeplechasemen4 × 100 m relaymenwomen4 × 400 m relaymenwomenRoad eventsMarathonmenwomen20 km walkmenwomen50 km walkmenField eventsHigh jumpmenwomenPole vaultmenwomenLong jumpmenwomenTriple jumpmenwomenShot putmenwomenDiscus throwmenwomenHammer throwmenwomenJavelin throwmenwomenCombined ...

 

يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (فبراير 2016) جزء من سلسلة مقالات سياسة جنوب السودانجنوب السودان الدستور الدستور حقوق الإنسان السلطة التنفيذية الرئي�...

Byzantine church in Constantinople (now Istanbul) from 880 to 1490 This article is about the Nea Ekklesia of Constantinople. For the namesake 6th-century church in Jerusalem, see Nea Ekklesia of the Theotokos. The Nea Ekklēsia (Medieval Greek: Νέα Ἐκκλησία, New Church; known in English as The Nea) was a church built by Byzantine Emperor Basil I the Macedonian in Constantinople between 876 and 880. It was the first monumental church built in the Byzantine capital after the Hagia S...

 

Private, boarding school in East Machias, Maine, United StatesWashington AcademyAddress66 Cutler RoadEast Machias, Maine 04630United StatesCoordinates44°44′03″N 67°23′19″W / 44.7343°N 67.3885°W / 44.7343; -67.3885InformationSchool typePrivate, boardingMottoVirtute de Regno Certam(The Virtue of the Kingdom is Certain)Founded1792; 232 years ago (1792)Head of schoolRichard OlivaresGrades9-12Enrollment392Student to teacher ratio10:1Campus type...

 

Gunung ColoErupsi Gunung Colo pada tahun 1983.Titik tertinggiKetinggian486 m (1.594 ft)[1]Koordinat0°10′12″S 121°36′29″E / 0.17°S 121.608°E / -0.17; 121.608 GeografiLetakSulawesi Tengah, IndonesiaGeologiJenis gununggunung berapi kerucut dengan calderaLetusan terakhirJuli-December 1983 Gunung Colo adalah sebuah gunung berapi kerucut yang terletak di Pulau Una-Una, Provinsi Sulawesi Tengah, Indonesia. Gunung ini berada di di tengah Tel...

Luigi AlbertiniLuigi Albertini in età matura Senatore del Regno d'ItaliaDurata mandato30 dicembre 1914 –29 dicembre 1941 LegislaturaXXIV Sito istituzionale Dati generaliProfessioneGiornalista Luigi Albertini Luigi Albertini (Ancona, 19 ottobre 1871 – Roma, 29 dicembre 1941) è stato un giornalista, editore e politico italiano. Fu direttore del Corriere della Sera dal 1900 al 1921, portandolo alla posizione di prestigio che il quotidiano mantiene ancora oggi. Oppositore del ...

 

Conspiracy theories regarding the assassination of JFK Kennedy assassination conspiracy theories redirects here. For conspiracy theories surrounding the assassination of John's brother Robert, see Robert F. Kennedy assassination conspiracy theories. This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article may present fringe theories, without giving appropriate weight to the mainstream...