[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-libsigsegv] Re: [haiku-development] libsigsegv on Haiku
From: |
Ingo Weinhold |
Subject: |
[bug-libsigsegv] Re: [haiku-development] libsigsegv on Haiku |
Date: |
Wed, 26 Jan 2011 10:16:40 +0100 |
User-agent: |
Beam 1.1.3 |
On 2011-01-26 at 03:57:51 [+0100], Eric Blake <address@hidden> wrote:
[...]
> so the stack overflow was reliably detected, but the stack pointer was
> nearly four pages away from the bounds of the vma region, which was
> beyond the 1 page threshold that handler-unix.c was looking for when
> declaring a stack overflow instead of re-raising SIGSEGV.
>
> I'm not sure if relaxing the check for whether the old stack pointer is
> with 4 pages and/or 1% of the end of the rlimit size of the stack would
> be appropriate for all platforms, but it seems like it would solve the
> problem of reliable stack overflow detection in libsigsegv for Haiku.
Although ATM we don't have any intention to change it, the number of stack
guard pages is a private constant that theoretically could be changed any
time. So, yes, using the 4 pages as a threshold would work for Haiku, but
no one guarantees that it will continue to work.
An alternative way to get the stack range for the current thread would be:
thread_info info;
get_thread_info(find_thread(NULL), &info);
The thread_info::stack_base/stack_end fields are supposed to contain the
usable stack range (at least they do under BeOS). Unfortunately currently
Haiku is buggy in this respect, as it just returns the area range. This can
and should be fixed, though.
CU, Ingo