chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH] Fix #892 by causing panic instead of crash


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] Fix #892 by causing panic instead of crash/segfault upon heap exhaustion
Date: Fri, 26 Jul 2013 22:27:32 +0200
User-agent: Mutt/1.4.2.3i

On Fri, Jul 26, 2013 at 09:48:22PM +0200, Peter Bex wrote:
> Hi all,
> 
> After some digging, it looks like the code in C_rereclaim2 which simply
> returns when the heap can't be resized is really really wrong.
> 
> I'm unsure what the "proper" fix is, but panicking seems like a good
> thing to do in the face of unreclaimable memory!  See ticket #892 for
> details.
> 
> Attached is a simple patch which inserts said panic(), and fixes a
> minor typo in another error (it also adds the word "new" to distinguish
> it from the other "out of memory" error on line 3328)

I remembered that normally when going out of memory, we get a "heap full
while resizing" panic.  Attached is an even simpler patch which removes
the (seemingly bogus?) check whether the new size equals the old size,
and will simply carry on reclaiming, thereby triggering the familiar
error message.  This should simplify matters a bit.

Cheers,
Peter
-- 
http://www.more-magic.net

Attachment: 0001-Panic-when-maximum-heap-size-exhausted-instead-of-cr.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]