From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: rhstanton@berkeley.edu, 54996@debbugs.gnu.org
Subject: bug#54996: Emacs hangs when editing Python code with debug-on-error set to t
Date: Mon, 18 Apr 2022 13:07:24 +0200 [thread overview]
Message-ID: <87y202ir9v.fsf@gnus.org> (raw)
In-Reply-To: <838rs2wvxv.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 18 Apr 2022 13:02:52 +0300")
Eli Zaretskii <eliz@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@entry=0x106b0, arg=arg@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
next prev parent reply other threads:[~2022-04-18 11:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-17 20:16 bug#54996: Emacs hangs when editing Python code with debug-on-error set to t Richard Stanton
2022-04-17 20:43 ` Lars Ingebrigtsen
2022-04-18 5:46 ` Eli Zaretskii
2022-04-18 9:45 ` Lars Ingebrigtsen
2022-04-18 10:02 ` Eli Zaretskii
2022-04-18 11:07 ` Lars Ingebrigtsen [this message]
2022-04-18 11:18 ` Lars Ingebrigtsen
2022-04-18 14:17 ` Philipp Stephani
2022-04-18 14:23 ` Lars Ingebrigtsen
2022-04-18 10:56 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y202ir9v.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=54996@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=rhstanton@berkeley.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.