[Ecls-list] Patch: remove sbrk() usage in handle_signal()

Geo Carncross geocar at gmail.com
Sun Oct 5 01:13:08 UTC 2008


On Sat, Oct 4, 2008 at 3:16 PM, Josh Elsasser <josh at elsasser.org> wrote:
> The new stack overflow detection code uses sbrk(), which is not
> portable.

Do you have a system that ECL runs on that doesn't have sbrk()?

>  I'm guessing that it was used to detect if the signal
> handler was executing on the alternate signal stack, if that is the
> case then sigaltstack() would be the portable way to test for that.

It isn't. The sbrk(0) is the top of the heap. The only things above it
should be mmap'd regions, and the stack. Since most unixes
automatically extend the stack, the first SIGSEGV above it is either a
very errant pointer, or the stack guard.

I believe Bohem GC requires sbrk() so I didn't think I was introducing
any new dependencies, either.




More information about the ecl-devel mailing list