[Ecls-list] Patch: remove sbrk() usage in handle_signal()
Josh Elsasser
josh at elsasser.org
Sat Oct 4 20:05:56 UTC 2008
On Sat, Oct 04, 2008 at 09:50:27PM +0200, Juan Jose Garcia-Ripoll wrote:
> 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.
Ah, I see. That's something that's tricky to get right without making
unportable assumptions about address space layout.
More information about the ecl-devel
mailing list