[Webkit-unassigned] [Bug 29026] CRASH: fastRealloc crashes on realloc(ptr, 0)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 8 09:48:38 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=29026


Mike Belshe <mike at belshe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|WONTFIX                     |
             Status|RESOLVED                    |REOPENED




--- Comment #3 from Mike Belshe <mike at belshe.com>  2009-09-08 09:48:37 PDT ---
I'm going to reopen just for a bit so we can get further debate on this -
switching to tryFastRealloc() would work.

But semantically, I'm not sure if that is the best?

If you look at FastMalloc.h, about fastRealloc(), it says, "// These functions
call CRASH() if an allocation fails."

This wasn't an allocation failure.  realloc(), by specification, returns NULL
in two cases - either on allocation failure, or when allocating to size zero.

If we take your suggestion, the fastRealloc() is behaving slightly differently
from the realloc standard.

Two choices:
a) fastRealloc should continue to crash on this case.  If so, we should
document that it diverges from the standard, and crashes even in this case
(which is not an allocation failure).
b) fastRealloc should not crash in this case.

I did a quick search through the code, and I don't see much usage of
tryFastRealloc() at all.  This leads me to believe that for this case, maybe
fastRrealloc() should be changed?

Let me know how you guys would like to proceed.  At the very least, I'd like to
update the comments on fastRealloc() to reflect our decision on this API.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list