WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
159002
bmalloc::api methods should maintain crash behavior even if bmalloc is disabled internally
https://bugs.webkit.org/show_bug.cgi?id=159002
Summary
bmalloc::api methods should maintain crash behavior even if bmalloc is disabl...
Joseph Pecoraro
Reported
2016-06-21 15:41:39 PDT
Summary: bmalloc::api methods should maintain crash behavior even if bmalloc is disabled internally Notes: bmalloc.h describes a number of methods as crashing on failure: // Crashes on failure. inline void* malloc(size_t size) // Crashes on failure. inline void* memalign(size_t alignment, size_t size) // Crashes on failure. inline void* realloc(void* object, size_t newSize) However, bmalloc may be disabled internally for a number of reasons, such as running with GuardMalloc: bool Environment::computeIsBmallocEnabled() { if (isMallocEnvironmentVariableSet()) return false; if (isLibgmallocEnabled()) return false; if (isSanitizerEnabled()) return false; return true; } In those cases, it look like the bmalloc::api methods may return nullptr, instead of crashing. Perhaps the fall back to system malloc behaviors should BMALLOC_ASSERT and crash if null to maintain the expected bmalloc behavior. For example: bmalloc/Allocator.cpp 86-void* Allocator::reallocate(void* object, size_t newSize) 87-{ 88: if (!m_isBmallocEnabled) 89- return realloc(object, newSize); 90- -- 172-void* Allocator::allocateSlowCase(size_t size) 173-{ 174: if (!m_isBmallocEnabled) 175- return malloc(size); 176-
Attachments
Add attachment
proposed patch, testcase, etc.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug