Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Magic number (programming)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Debug values {{anchor|Magic debug values}} == '''Magic debug values''' are specific values written to [[Random-access memory|memory]] during [[memory allocation|allocation]] or deallocation, so that it will later be possible to tell whether or not they have become corrupted, and to make it obvious when values taken from uninitialized memory are being used. Memory is usually viewed in hexadecimal, so memorable repeating or [[hexspeak]] values are common. Numerically odd values may be preferred so that processors without byte addressing will fault when attempting to use them as pointers (which must fall at even addresses). Values should be chosen that are away from likely addresses (the program code, static data, heap data, or the stack). Similarly, they may be chosen so that they are not valid codes in the instruction set for the given architecture. Since it is very unlikely, although possible, that a 32-bit integer would take this specific value, the appearance of such a number in a [[debugger]] or [[memory dump]] most likely indicates an error such as a buffer overflow or an [[uninitialized variable]]. Famous and common examples include: <!-- Please understand the above description before adding things! This is not the place for other kinds of magic numbers like header signatures or error codes. --> {| class="wikitable" |- ! style="background:#D0E0FF"| Code ! style="background:#D0E0FF"| Description |- | <code>00008123</code> || Used in MS Visual C++. Deleted pointers are set to this value, so they throw an exception, when they are used after; it is a more recognizable alias for the zero address. It is activated with the Security Development Lifecycle (/sdl) option.<ref>{{cite web |last1=Cavit |first1=Doug |date=24 April 2012 |title=Guarding against re-use of stale object references |url=https://cloudblogs.microsoft.com/microsoftsecure/2012/04/24/guarding-against-re-use-of-stale-object-references/ |website=Microsoft Secure |access-date=26 July 2018 |archive-url=https://web.archive.org/web/20180726103946/https://cloudblogs.microsoft.com/microsoftsecure/2012/04/24/guarding-against-re-use-of-stale-object-references/ |archive-date=26 July 2018 |url-status=dead }}</ref> |- | <code>..FACADE</code> || ''"Facade"'', Used by a number of [[real-time operating system|RTOS]]es |- | <code>1BADB002</code> || ''"1 bad boot"'', [[Multiboot Specification|Multiboot]] header magic number<ref>{{cite web |url=http://ftp.lyx.org/pub/mach/mach4/multiboot/multiboot-archive |title=Comments on the 'MultiBoot Standard' proposal |first=Erich Stefan |last=Boleyn |date=4 April 1995 |website=Uruk.org |archive-url=https://web.archive.org/web/20230326024756/http://ftp.lyx.org/pub/mach/mach4/multiboot/multiboot-archive |archive-date=26 March 2023 |url-status=live }}</ref> |- | <code>8BADF00D</code> || ''"Ate bad food"'', Indicates that an [[Apple Inc.|Apple]] [[iOS]] application has been terminated because a watchdog timeout occurred.<ref name="developer.apple.com">{{Cite web |url=https://developer.apple.com/library/archive/technotes/tn2151/_index.html |title=Technical Note TN2151: Understanding and Analyzing Application Crash Reports |date=29 January 2009 |website=Apple Developer Documentation |archive-url=https://web.archive.org/web/20181213234116/https://developer.apple.com/library/archive/technotes/tn2151/_index.html |archive-date=13 December 2018 |url-status=dead }}</ref> |- | <code>A5A5A5A5</code> || Used in embedded development because the alternating bit pattern (1010 0101) creates an easily recognized pattern on [[oscilloscope]]s and [[logic analyzer]]s. |- | <code>A5</code> || Used in [[FreeBSD]]'s PHK [[malloc|malloc(3)]] for debugging when /etc/malloc.conf is symlinked to "-J" to initialize all newly allocated memory as this value is not a NULL pointer or ASCII NUL character. |- | <code>ABABABAB</code> || Used by [[Microsoft]]'s debug HeapAlloc() to mark "no man's land" [[guard byte]]s after allocated heap memory.<ref name="Win32CRTDebugHeapInternals">{{cite web |url=http://www.nobugs.org/developer/win32/debug_crt_heap.html |title=Win32 Debug CRT Heap Internals |first=Andrew |last=Birkett |work=Nobugs.org}}</ref> |- | <code>ABADBABE</code> || ''"A bad babe"'', Used by [[Apple Inc.|Apple]] as the "Boot Zero Block" magic number |- | <code>ABBABABE</code> || ''"[[ABBA]] babe"'', used by ''[[Driver: Parallel Lines]]'' memory heap. |- | <code>ABADCAFE</code> || ''"A bad cafe"'', Used to initialize all unallocated memory (Mungwall, [[AmigaOS]]) |- | <code>B16B00B5</code> || ''"Big Boobs"'', Formerly required by [[Microsoft]]'s [[Hyper-V]] hypervisor to be used by Linux guests as the upper half of their "guest id"<ref>{{Cite web |url=https://www.networkworld.com/article/2222804/microsoft-code-contains-the-phrase--big-boobs------yes--really.html |title=Microsoft code contains the phrase 'big boobs' ... Yes, really |first=Paul |last=McNamara |date=19 July 2012 |website=Network World}}</ref> |- | <code>BAADF00D</code> || ''"Bad food"'', Used by [[Microsoft]]'s debug HeapAlloc() to mark uninitialized allocated heap memory<ref name="Win32CRTDebugHeapInternals"/> |- | <code>BAAAAAAD</code> || ''"Baaaaaad"'', Indicates that the [[Apple Inc.|Apple]] [[iOS]] log is a stackshot of the entire system, not a crash report<ref name="developer.apple.com"/> |- | <code>BAD22222</code> || ''"Bad too repeatedly"'', Indicates that an [[Apple Inc.|Apple]] [[iOS]] VoIP application has been terminated because it resumed too frequently<ref name="developer.apple.com"/> |- | <code>BADBADBADBAD</code> || ''"Bad bad bad bad"'', [[Burroughs large systems]] "uninitialized" memory (48-bit words) |- | <code>BADC0FFEE0DDF00D</code> || ''"Bad coffee odd food"'', Used on [[IBM]] [[RS/6000]] 64-bit systems to indicate uninitialized CPU registers |- | <code>BADDCAFE</code> || ''"Bad cafe"'', On [[Sun Microsystems]]' [[Solaris (operating system)|Solaris]], marks uninitialized kernel memory (KMEM_UNINITIALIZED_PATTERN) |- | <code>BBADBEEF</code> || ''"Bad beef"'', Used in [[WebKit]], for particularly unrecoverable errors<ref>{{Citation |title=WebKit |date=2023-01-06 |url=https://github.com/WebKit/WebKit/blob/226b2f3cb9fa175dbf0a8025d882ac3b168b7547/Source/WTF/wtf/Assertions.cpp |publisher=The WebKit Open Source Project |access-date=2023-01-06}}</ref> |- | <code>BEBEBEBE</code> || Used by [[AddressSanitizer]] to fill allocated but not initialized memory<ref>{{cite web |url=https://github.com/google/sanitizers/wiki/AddressSanitizer#faq |title=AddressSanitizer - FAQ |website=[[GitHub]] |access-date=2022-05-18}}</ref> |- | <code>BEEFCACE</code> || ''"Beef cake"'', Used by [[Microsoft .NET]] as a magic number in resource files |- | <code>C00010FF</code> || ''"Cool off"'', Indicates [[Apple Inc.|Apple]] [[iOS]] app was killed by the operating system in response to a thermal event<ref name="developer.apple.com"/> |- | <code>CAFEBABE</code> || ''"Cafe babe"'', Used by [[Java (programming language)|Java]] for class files |- | <code>CAFED00D</code> || ''"Cafe dude"'', Used by [[Java (programming language)|Java]] for their [[pack200]] compression |- | <code>CAFEFEED</code> || ''"Cafe feed"'', Used by [[Sun Microsystems]]' [[Solaris (operating system)|Solaris]] debugging kernel to mark kmemfree() memory |- | <code>CCCCCCCC</code> || Used by [[Microsoft]]'s C++ debugging runtime library and many DOS environments to mark uninitialized [[stack-based memory allocation|stack]] memory. <code>CC</code> is the opcode of the [[INT 3]] debug breakpoint interrupt on x86 processors.<ref>{{cite web | url=https://pdos.csail.mit.edu/6.828/2008/readings/i386/INT.htm | title=INTEL 80386 PROGRAMMER'S REFERENCE MANUAL | publisher=[[MIT]]}}</ref> |- | <code>CDCDCDCD</code> || Used by [[Microsoft]]'s C/C++ debug malloc() function to mark uninitialized heap memory, usually returned from HeapAlloc()<ref name="Win32CRTDebugHeapInternals" /> |- | <code>0D15EA5E</code> || ''"Zero Disease"'', Used as a flag to indicate regular boot on the [[GameCube]] and [[Wii]] consoles |- | <code>DDDDDDDD</code> || Used by MicroQuill's SmartHeap and Microsoft's C/C++ debug free() function to mark freed heap memory<ref name="Win32CRTDebugHeapInternals" /> |- | <code>DEAD10CC</code> || ''"Dead lock"'', Indicates that an [[Apple Inc.|Apple]] [[iOS]] application has been terminated because it held on to a system resource while running in the background<ref name="developer.apple.com"/> |- | <code>DEADBABE</code> || ''"Dead babe"'', Used at the start of [[Silicon Graphics]]' [[IRIX]] arena files |- id="DEADBEEF" | <code>DEADBEEF</code> || ''"Dead beef"'', Famously used on [[IBM]] systems such as the [[RS/6000]], also used in the [[classic Mac OS]] [[operating system]]s, [[OPENSTEP Enterprise]], and the [[Commodore International|Commodore]] [[Amiga]]. On [[Sun Microsystems]]' [[Solaris (operating system)|Solaris]], marks freed kernel memory (KMEM_FREE_PATTERN) |- | <code>DEADCAFE</code> || ''"Dead cafe"'', Used by [[Microsoft .NET]] as an error number in [[Dynamic-link library|DLL]]s |- | <code>DEADC0DE</code> || ''"Dead code"'', Used as a marker in [[OpenWRT]] firmware to signify the beginning of the to-be created jffs2 file system at the end of the static firmware |- | <code>DEADFA11</code> || ''"Dead fail"'', Indicates that an [[Apple Inc.|Apple]] [[iOS]] application has been force quit by the user<ref name="developer.apple.com"/> |- | <code>DEADF00D</code> || ''"Dead food"'', Used by Mungwall on the [[Commodore International|Commodore]] [[Amiga]] to mark allocated but uninitialized memory<ref>{{cite web |url=http://cataclysm.cx/random/amiga/reference/AmigaMail_Vol2_guide/node0053.html |title=Amiga Mail Vol.2 Guide |first=Carolyn |last=Scheppner |work=Cataclysm.cx |access-date=2010-08-20 |url-status=dead |archive-url=https://web.archive.org/web/20110718163417/http://cataclysm.cx/random/amiga/reference/AmigaMail_Vol2_guide/node0053.html |archive-date=2011-07-18}}</ref> |- | <code>DEFEC8ED</code> || ''"Defecated"'', Used for [[OpenSolaris]] [[core dump]]s |- | <code>DEADDEAD</code> || ''"Dead Dead"'' indicates that the user deliberately initiated a crash dump from either the kernel debugger or the keyboard under Microsoft Windows.<ref>{{Cite web |url=https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/bug-check-0xdeaddead--manually-initiated-crash1 |title=Bug Check 0xDEADDEAD MANUALLY_INITIATED_CRASH1 |website=Microsoft Documentation|date=19 June 2023 }}</ref> |- |<code>D00D2BAD</code> |''"Dude, Too Bad",'' Used by Safari crashes on macOS Big Sur.<ref>{{Cite web|title=Safari Version 14.0.1 Unexpectedly Quits|url=https://discussions.apple.com/thread/252054569}}</ref> |- |<code>D00DF33D</code> |''"Dude feed",'' Used by the [[devicetree]] to mark the start of headers.<ref>{{Cite web|title=Device Tree Specification|url=https://www.devicetree.org/specifications/}}</ref> |- | <code>EBEBEBEB</code> || From MicroQuill's SmartHeap |- | <code>FADEDEAD</code> || ''"Fade dead"'', Comes at the end to identify every [[AppleScript]] script |- | <code>FDFDFDFD</code> || Used by [[Microsoft]]'s C/C++ debug malloc() function to mark "no man's land" [[guard byte]]s before and after allocated heap memory,<ref name="Win32CRTDebugHeapInternals" /> and some debug Secure [[C standard library|C-Runtime]] functions implemented by Microsoft (e.g. strncat_s) <ref>{{cite web |title=strncat_s, _strncat_s_l, wcsncat_s, _wcsncat_s_l, _mbsncat_s, _mbsncat_s_l |url=https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strncat-s-strncat-s-l-wcsncat-s-wcsncat-s-l-mbsncat-s-mbsncat-s-l?view=vs-2017 |website=Microsoft Documentation |access-date=16 January 2019 |language=en-us}}</ref> |- | <code>FEE1DEAD</code> || ''"Feel dead"'', Used by [[Linux]] reboot() syscall |- | <code>FEEDFACE</code> || ''"Feed face"'', Seen in PowerPC [[Mach-O]] binaries on [[Apple Inc.]]'s Mac OSX platform. On [[Sun Microsystems]]' [[Solaris (operating system)|Solaris]], marks the red zone (KMEM_REDZONE_PATTERN) Used by [[VLC player]] and some [[IP camera]]s in [[Real-time Transport Protocol|RTP]]/[[RTCP]] protocol, VLC player sends four bytes in the order of the [[endianness]] of the system. Some IP cameras expect the player to send this magic number and do not start the stream if it is not received. |- | <code>FEEEFEEE</code> || ''"Fee fee"'', Used by [[Microsoft]]'s debug HeapFree() to mark freed heap memory. Some nearby internal bookkeeping values may have the high word set to FEEE as well.<ref name="Win32CRTDebugHeapInternals" /> |} Most of these are 32 [[bit]]s long{{snd}}the [[word size]] of most 32-bit architecture computers. The prevalence of these values in Microsoft technology is no coincidence; they are discussed in detail in [[Steve Maguire]]'s book ''Writing Solid Code'' from [[Microsoft Press]]. He gives a variety of criteria for these values, such as: * They should not be useful; that is, most algorithms that operate on them should be expected to do something unusual. Numbers like zero don't fit this criterion. * They should be easily recognized by the programmer as invalid values in the debugger. * On machines that don't have [[byte alignment]], they should be [[odd number]]s, so that dereferencing them as addresses causes an exception. * They should cause an exception, or perhaps even a debugger break, if executed as code. Since they were often used to mark areas of memory that were essentially empty, some of these terms came to be used in phrases meaning "gone, aborted, flushed from memory"; e.g. "Your program is DEADBEEF".{{citation needed|date=June 2020}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)