bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18473: 24.4.50; SEGFAULT when vconcatting more than 2048 vectors


From: Dmitry Antipov
Subject: bug#18473: 24.4.50; SEGFAULT when vconcatting more than 2048 vectors
Date: Mon, 15 Sep 2014 19:04:37 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1

On 09/15/2014 05:09 PM, Stefan Monnier wrote:

I'm not thrilled at the idea of having to call backtrace_top every time,
instead of just using "specpdl_ptr - 1".  I'd much rather compute
specpdl_ptr - 1 before calling USE_SAFE_ALLOCA, for example.

Hm...this simple fix:

=== modified file 'src/eval.c'
--- src/eval.c  2014-09-02 06:29:01 +0000
+++ src/eval.c  2014-09-15 14:57:18 +0000
@@ -2136,6 +2136,7 @@
          /* Pass a vector of evaluated arguments.  */
          Lisp_Object *vals;
          ptrdiff_t argnum = 0;
+         union specbinding *pdl = specpdl_ptr - 1;
          USE_SAFE_ALLOCA;

          SAFE_ALLOCA_LISP (vals, XINT (numargs));
@@ -2151,8 +2152,8 @@
              gcpro3.nvars = argnum;
            }

-         set_backtrace_args (specpdl_ptr - 1, vals);
-         set_backtrace_nargs (specpdl_ptr - 1, XINT (numargs));
+         set_backtrace_args (pdl, vals);
+         set_backtrace_nargs (pdl, XINT (numargs));

          val = (XSUBR (fun)->function.aMANY) (XINT (numargs), vals);
          UNGCPRO;

causes bootstrap crash (with emacs-24).  Hard to explain why, huh?

BTW, don't we have the same problem for the subsequent call to
backtrace_debug_on_exit (and this one is worse because it is shared
among all the different kinds of calls, so we *really* don't want to
slow it down).

IIUC this applies only to apply_lambda, where we call to backtrace_debug_on_exit
between SAFE_ALLOCA_LISP and SAFE_FREE.

Dmitry





reply via email to

[Prev in Thread] Current Thread [Next in Thread]