While working with Webkit I encountered an error with a pointer set to 0xbbadbeef. What is BadBeef used for in Webkit?
Asked
Active
Viewed 2,307 times
4
-
AIX debuggers used to set uninitialized memory to 0xDEADBEEF as a marker to indicate the memory hadn't been touched ... May be a similar thing – Dave G Aug 18 '14 at 14:22
1 Answers
7
It is a hexspeak used in WebKit and, it indicates a known, unrecoverable error such as out of memory.
As you can see from the link https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/wtf/Assertions.h&l=180
/* CRASH() - Raises a fatal error resulting in program termination and triggering either the debugger or the crash reporter.
Use CRASH() in response to known, unrecoverable errors like out-of-memory.
Macro is enabled in both debug and release mode.
To test for unknown errors and verify assumptions, use ASSERT instead, to avoid impacting performance in release builds.
Signals are ignored by the crash reporter on OS X so we must do better.
*/
#ifndef CRASH
#if COMPILER(MSVC)
#define CRASH() (__debugbreak(), IMMEDIATE_CRASH())
#else
#define CRASH() \
(WTFReportBacktrace(), (*(int*)0xfbadbeef = 0), IMMEDIATE_CRASH())
#endif
#endif

mamba4ever
- 2,662
- 4
- 28
- 46
-
1Thanks for the answer it seems to be valid, but I've not worked with webkit for so long, that I don't remember what I needed it for :) – Krzak Feb 02 '16 at 12:59
-
1