diff options
| author | Paul Eggert | 2015-07-16 00:48:40 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-07-16 07:36:47 -0700 |
| commit | a5522abbca2235771384949dfa87c8efc68831b2 (patch) | |
| tree | 1e7f8ffd9a3ae3290672b8e6694696a37b0426fd /src/lisp.h | |
| parent | bd8b5ac77250d9fe0634d58a30a3bf6d2497725a (diff) | |
| download | emacs-a5522abbca2235771384949dfa87c8efc68831b2.tar.gz emacs-a5522abbca2235771384949dfa87c8efc68831b2.zip | |
Better heuristic for C stack overflow
Improve the heuristic for distinguishing stack overflows from
other SIGSEGV causes (Bug#21004). Corinna Vinschen explained that
the getrlimit method wasn't portable to Cygwin; see:
https://www.cygwin.com/ml/cygwin/2015-07/msg00092.html
Corinna suggested pthread_getattr_np but this also has problems.
Instead, replace the low-level system stuff with a simple
heuristic based on known good stack addresses.
* src/eval.c, src/lisp.h (near_C_stack_top): New function.
* src/sysdep.c: Don't include <sys/resource.h>.
(stack_direction): Remove. All uses removed.
(stack_overflow): New function.
(handle_sigsegv): Use it instead of incorrect getrlimit heuristic.
Make SEGV fatal in non-main threads.
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h index c3289c9d700..341603f311f 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -4029,6 +4029,7 @@ extern _Noreturn void verror (const char *, va_list) | |||
| 4029 | ATTRIBUTE_FORMAT_PRINTF (1, 0); | 4029 | ATTRIBUTE_FORMAT_PRINTF (1, 0); |
| 4030 | extern void un_autoload (Lisp_Object); | 4030 | extern void un_autoload (Lisp_Object); |
| 4031 | extern Lisp_Object call_debugger (Lisp_Object arg); | 4031 | extern Lisp_Object call_debugger (Lisp_Object arg); |
| 4032 | extern void *near_C_stack_top (void); | ||
| 4032 | extern void init_eval_once (void); | 4033 | extern void init_eval_once (void); |
| 4033 | extern Lisp_Object safe_call (ptrdiff_t, Lisp_Object, ...); | 4034 | extern Lisp_Object safe_call (ptrdiff_t, Lisp_Object, ...); |
| 4034 | extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object); | 4035 | extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object); |