GNU bug report logs - #54996
Emacs hangs when editing Python code with debug-on-error set to t

Previous Next

Package: emacs;

Reported by: Richard Stanton <rhstanton <at> berkeley.edu>

Date: Sun, 17 Apr 2022 20:17:02 UTC

Severity: normal

Fixed in version 28.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rhstanton <at> berkeley.edu, 54996 <at> debbugs.gnu.org
Subject: Re: bug#54996: Emacs hangs when editing Python code with
 debug-on-error set to t
Date: Mon, 18 Apr 2022 13:07:24 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> In Fsignal, I guess.  But it is strange that call_debugger doesn't
> trigger: do you see a *Backtrace* buffer popping up?

Nope, Emacs just hangs without popping up anything.

Breakpoing on Fsignal is called all the time, even without
debug-on-error, so it's too noisy to use.

#0  Fsignal (error_symbol=0x106b0, data=0x555556090af3) at eval.c:1649
#1  0x00005555555dcf9a in xsignal (data=<optimized out>, error_symbol=0x106b0)
    at /home/larsi/src/emacs/trunk/src/lisp.h:4514
#2  xsignal1 (error_symbol=error_symbol <at> entry=0x106b0, arg=arg <at> entry=0x2d1c30)
    at eval.c:1811
#3  0x00005555555dc6c8 in Fdefault_value (symbol=<optimized out>)
    at data.c:1952
#4  0x0000555555788478 in Fdefault_toplevel_value (symbol=0x2d1c30)
    at eval.c:709
#5  0x00005555557ced47 in exec_byte_code
    (fun=<optimized out>, args_template=<optimized out>, nargs=<optimized out>, args=<optimized out>) at bytecode.c:809
#6  0x00005555557d154b in Fbyte_code
    (bytestr=<optimized out>, vector=0x555555d537e5, maxdepth=0x2a)
    at bytecode.c:329
#7  0x000055555578a161 in eval_sub (form=<optimized out>) at eval.c:2388
#8  0x00005555557bbb15 in readevalloop

And that's because defcustom uses errors as control flow:

(defun custom-initialize-default (symbol exp)
  "Initialize SYMBOL with EXP.
This will do nothing if symbol already has a default binding.
Otherwise, if symbol has a `saved-value' property, it will evaluate
the car of that and use it as the default binding for symbol.
Otherwise, EXP will be evaluated and used as the default binding for
symbol."
  (condition-case nil
      (default-toplevel-value symbol)   ;Test presence of default value.
    (void-variable
     ;; The var is not initialized yet.
     (set-default-toplevel-value
      symbol (eval (let ((sv (get symbol 'saved-value)))
                     (if sv (car sv) exp))
                   t)))))

Which has bitten me before when trying to do debugging...  could we
rewrite that somehow to avoid this?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 89 days ago.

Previous Next


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