GNU bug report logs - #40088
27.0.90; Symbol’s value as variable is void: debugger-outer-match-data

Previous Next

Package: emacs;

Reported by: Joost Kremers <joostkremers <at> fastmail.fm>

Date: Mon, 16 Mar 2020 11:42:01 UTC

Severity: normal

Tags: fixed, patch

Found in version 27.0.90

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #47 received at 40088 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Joost Kremers <joostkremers <at> fastmail.fm>, 40088 <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#40088: 27.0.90; Symbol’s value as
 variable is void: debugger-outer-match-data
Date: Wed, 18 Mar 2020 20:04:56 -0400
Noam Postavsky <npostavs <at> gmail.com> writes:

>>> *** Eval error ***  Symbol’s value as variable is void:
>>> debugger-outer-match-data

A simpler reproducer (although it only reproduces once per-session) is

    (make-local-variable 'xx)
    (let ((xx 1))
      (backtrace--locals 1))

In Emacs 26, this gives

Debugger entered--Lisp error: (void-variable xx)
  backtrace--locals(1)
  (let ((xx 1)) (backtrace--locals 1))
  ...
  eval-defun(nil)
  ...

The error shouldn't happen, but it's not as severe as in Emacs 27.  I
think because in v27, the debugger display code got more fancy, and
recursively triggers the problem.

Since the void-variable is getting triggered from
backtrace_eval_unrewind, I tried the patch below, which almost seems to
fix the problem, but after continuing from the debugger there's a
segfault in GC, so it's definitely not the Right Thing.  I think this is
a bit over my head.  Ccing Stefan, any ideas?

diff --git i/src/data.c w/src/data.c
index b153068846..5ce5e360ab 100644
--- i/src/data.c
+++ w/src/data.c
@@ -1573,7 +1573,7 @@ notify_variable_watchers (Lisp_Object symbol,
 /* Return the default value of SYMBOL, but don't check for voidness.
    Return Qunbound if it is void.  */
 
-static Lisp_Object
+Lisp_Object
 default_value (Lisp_Object symbol)
 {
   struct Lisp_Symbol *sym;
diff --git i/src/eval.c w/src/eval.c
index 4559a0e1f6..78a787c4ff 100644
--- i/src/eval.c
+++ w/src/eval.c
@@ -3816,7 +3816,7 @@ backtrace_eval_unrewind (int distance)
 	  {
 	    Lisp_Object sym = specpdl_symbol (tmp);
 	    Lisp_Object old_value = specpdl_old_value (tmp);
-	    set_specpdl_old_value (tmp, Fdefault_value (sym));
+	    set_specpdl_old_value (tmp, default_value (sym));
 	    Fset_default (sym, old_value);
 	  }
 	  break;
@@ -3832,7 +3832,7 @@ backtrace_eval_unrewind (int distance)
 	    if (!NILP (Flocal_variable_p (symbol, where)))
 	      {
 		set_specpdl_old_value
-		  (tmp, Fbuffer_local_value (symbol, where));
+		  (tmp, buffer_local_value (symbol, where));
                 set_internal (symbol, old_value, where, SET_INTERNAL_UNBIND);
 	      }
 	  }







This bug report was last modified 5 years and 54 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.