bug-make
[Top][All Lists]
Advanced

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

Re: [bug #18396] stack size setrlimit call interacts badly with Solaris/


From: Jon Grant
Subject: Re: [bug #18396] stack size setrlimit call interacts badly with Solaris/x86 kernel bug
Date: Wed, 29 Nov 2006 13:22:34 +0000
User-agent: Thunderbird 1.5.0.8 (X11/20061117)

Hi,

Paul D. Smith elucidated on 29/11/06 02:27:
[...]
> Finally, there is no way to detect an out of stack error and exit gracefully
> with a warning as you suggest: the behavior of alloca() is undefined if you
> run out of stack space (it doesn't just return NULL as malloc() etc. do).

Is it undefined in actuality though? Has anyone checked if NULL does get
returned from any implementations? (I'm surprised alloca()
implementations didn't end up getting NULL returned in implementations
over the years. The GLIBC Manual indicates a fatal signal is generated
from its implementation:

http://www.gnu.org/software/libc/manual/html_node/Disadvantages-of-Alloca.html

My view would be that on modern computers switching to allocate from the
heap wouldn't make a big difference if it were changed. Modern heaps
have pools for small allocations to stop them fragmenting larger
allocations anyway. Someone would need to do a compressive test to know
for sure, these things often have knock on effects.. I've seen massive
slowdowns when someone switched malloc() to calloc() on MS-Windows!

Jon




reply via email to

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