[asterisk-dev] policy change for correct handling of fatal program conditions

Tim Panton tim at mexuar.com
Tue Jan 23 11:54:09 MST 2007


On 23 Jan 2007, at 15:33, Paul Hewlett wrote:

> On Tuesday 23 January 2007 14:15, SF Markus Elfring wrote:
>>>    Has anyone considered the fact that malloc() never actually  
>>> fails i.e.
>>> memory starvation does not cause malloc() to return error. It always
>>> returns true - when you actually access the memory one will get a  
>>> SIGBUS
>>> (I think) and the program will die.
>>>
>>>   This behaviour (called overcommit) is to make the UNIX fork/ 
>>> exec model
>>> efficient. For this reason one should use calloc() because at  
>>> least then
>>> the failure will occur close to the allocation call in the code.
>>
>> Do you refer to the Linux and FreeBSD implementation?
> Hi Marcus
>
> Yes - although other UNIX's have had this feature in the past.

Gosh, really ? MacOSX doesn't, solaris (hence system V) doesn't
and OpenBSD doesn't. Linux seems to be the only one so far.....

I sort of knew about the overcommit, but I never realized what a  
disaster
it would be for a large long lived program.

Tim Panton

www.mexuar.net
www.westhawk.co.uk/





More information about the asterisk-dev mailing list