[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Thu, 11 Sep 2014 19:49:19 +0400
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0
On 09/11/2014 07:08 PM, Eli Zaretskii wrote:
Apropos stack overflow protection: why not use libsigsegv if it is
available? It is capable of doing what we want (AFAICT), and supports
more platforms, including MS-Windows.
1. Stefan's mood gets worse after each new library dependency.
2. Basically libsigsegv uses the following heuristics to distinguish between
stack overflow and other kinds of SIGSEGVs:
a) If the fault address is near the stack pointer, it's a stack overflow.
b) If the fault address is near and beyond the bottom of the stack's virtual
memory area, it's a stack overflow.
c) If the stack pointer is near the bottom of the stack's virtual memory
it's a stack overflow.
Currently we have only b), and this is the only thing which can be
staying in POSIX interfaces and without architecture-dependent tricks. a) may
be implemented in a small forest of #ifdefs, and it doesn't worth using an
extra library. c) is the most controversial - for example, on GNU/Linux it
by opening and reading /proc/self/maps. Do you really want to open and read
on SIGSEGV? I do not.