Re: sbrk(2) broken

From: Peter Jeremy <peterjeremy_at_optushome.com.au>
Date: Mon, 7 Jan 2008 20:58:53 +1100
On Mon, Jan 07, 2008 at 09:08:35AM +0000, Poul-Henning Kamp wrote:
>In message <20080104134829.GA57756_at_deviant.kiev.zoral.com.ua>, Kostik Belousov 
>writes:
>>By making the default action for SIGDANGER to be SIG_IGN, this problem
>>would be mostly solved. Only processes that actually care about SIGDANGER
>>and installing the handler for it would require some non-trivial and
>>resource-hungry operation.
>
>This is a non-starter, if SIGDANGER is to have any effect, all
>processes that use malloc(3) should react to it.

This depends on what SIGDANGER is supposed to indicate.  IMO, a single
signal is inadequate - you need a "free memory is less than desirable,
please reduce memory use if possible" and one (or maybe several levels
of) "memory is really short, if you're not important, please die".

The former could reasonably default to SIG_IGN - processes that are
in a position to release memory on demand could provide a handler to
do so.  (This could potentially include malloc returning space on
its freelist to the kernel).

The latter should default to "terminate process" and a process that
considers itself "important" enough can trap it.

-- 
Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.

Received on Mon Jan 07 2008 - 08:58:58 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:25 UTC