[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SIGSEGV on cons_free_list in alloc.c
From: |
Richard Stallman |
Subject: |
Re: SIGSEGV on cons_free_list in alloc.c |
Date: |
Fri, 25 Feb 2005 17:53:17 -0500 |
So the question is how to intercept code that places a wrong
address to cons_free_list.
That's not the only possibility. Another is that something clobbers
an address in cons_free_list.
You could try this change. It should detect such clobberage much
sooner. It might be noticeably slower; I don't know how much slower
it will be.
*** lisp.h 22 Jan 2005 07:59:59 -0500 1.521
--- lisp.h 25 Feb 2005 13:06:54 -0500
***************
*** 53,58 ****
--- 53,63 ----
#endif /* 0 */
+ #ifdef GC_CHECK_CONS_LIST
+ #define CHECK_CONS_LIST() check_cons_list()
+ #else
+ #define CHECK_CONS_LIST() 0
+ #endif
/* These are default choices for the types to use. */
#ifdef _LP64
*** eval.c 06 Feb 2005 06:22:27 -0500 1.233
--- eval.c 25 Feb 2005 13:09:13 -0500
***************
*** 2067,2072 ****
--- 2067,2074 ----
args_left = original_args;
numargs = Flength (args_left);
+ CHECK_CONS_LIST ();
+
if (XINT (numargs) < XSUBR (fun)->min_args ||
(XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args < XINT
(numargs)))
return Fsignal (Qwrong_number_of_arguments, Fcons (fun, Fcons (numargs,
Qnil)));
***************
*** 2190,2195 ****
--- 2192,2199 ----
return Fsignal (Qinvalid_function, Fcons (fun, Qnil));
}
done:
+ CHECK_CONS_LIST ();
+
lisp_eval_depth--;
if (backtrace.debug_on_exit)
val = call_debugger (Fcons (Qexit, Fcons (val, Qnil)));
***************
*** 2746,2751 ****
--- 2750,2757 ----
if (SUBRP (fun))
{
+ CHECK_CONS_LIST ();
+
if (numargs < XSUBR (fun)->min_args
|| (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args < numargs))
{
***************
*** 2844,2849 ****
--- 2850,2856 ----
return Fsignal (Qinvalid_function, Fcons (fun, Qnil));
}
done:
+ CHECK_CONS_LIST ();
lisp_eval_depth--;
if (backtrace.debug_on_exit)
val = call_debugger (Fcons (Qexit, Fcons (val, Qnil)));