【发布时间】:2014-10-11 12:00:10
【问题描述】:
在使用 Webkit 时,我遇到了一个指针设置为 0xbbadbeef 的错误。 BadBeef 在 Webkit 中是做什么用的?
【问题讨论】:
-
AIX 调试器用于将未初始化的内存设置为 0xDEADBEEF 作为标记以指示内存未被触及...可能是类似的事情
标签: pointers memory webkit magic-numbers
在使用 Webkit 时,我遇到了一个指针设置为 0xbbadbeef 的错误。 BadBeef 在 Webkit 中是做什么用的?
【问题讨论】:
标签: pointers memory webkit magic-numbers
它是 WebKit 中使用的十六进制语言,它表示已知的、不可恢复的错误,例如内存不足。
/* 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
【讨论】: