[Webkit-unassigned] [Bug 159002] New: bmalloc::api methods should maintain crash behavior even if bmalloc is disabled internally
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jun 21 15:41:39 PDT 2016
https://bugs.webkit.org/show_bug.cgi?id=159002
Bug ID: 159002
Summary: bmalloc::api methods should maintain crash behavior
even if bmalloc is disabled internally
Classification: Unclassified
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: bmalloc
Assignee: webkit-unassigned at lists.webkit.org
Reporter: joepeck at webkit.org
CC: ggaren at apple.com
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-
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160621/89969285/attachment.html>
More information about the webkit-unassigned
mailing list