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

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Sat Oct 4 19:50:27 UTC 2008


On Sat, Oct 4, 2008 at 9:47 PM, Josh Elsasser <josh at elsasser.org> wrote:
>> Hmmm, I am not sure sigaltstack() does what you are expecting. The
>> SIGSEGV signal handler will _always_ execute in the alternative stack
>> and hence your test will always be true.
>
> Hm, what is it that (sbrk(0) < info->si_addr) is testing for then?

si_addr gives the address where the SIGSEGV happened. If this address
is above the data segment then we can conjecture that  it belongs to
the stack. sigaltstack() on the other hand will always return true
because we have instructed the system to execute SIGSEGV on an
alternative stack. I will try to find some other heuristic, though.

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28009 (Spain)
http://juanjose.garciaripoll.googlepages.com


More information about the ecl-devel mailing list