unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: larsi@gnus.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: Redisplay hook error backtraces
Date: Thu, 14 Jul 2022 19:33:09 +0000	[thread overview]
Message-ID: <YtBvdZeiitRMO3J8@ACM> (raw)
In-Reply-To: <831quntydt.fsf@gnu.org>

Hello, Eli.

On Thu, Jul 14, 2022 at 20:09:02 +0300, Eli Zaretskii wrote:
> > Date: Thu, 14 Jul 2022 16:07:33 +0000
> > Cc: larsi@gnus.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org
> > From: Alan Mackenzie <acm@muc.de>

> > > There's just one condition-case available to Lisp code, AFAICT, so why
> > > isn't it enough to distinguish condition-case from any other callers of
> > > internal_condition_case* ?

> > I think I understand what you're saying, now.  That a condition-case
> > called from Lisp will not use any of the internal_condition_case*
> > functions.  So we could just assume that if i_c_case* triggers, it must be
> > one of the hooks we're interested in that called it.

> > I don't think that's right.  It might well be that Lisp code calls a C
> > primitive function that itself uses an internal_condition_case.  In this
> > scenario, we would not want to generate a backtrace for that nested
> > internal_condition_case.

> And we won't, because redisplaying_p won't be set.

I don't understand.  If redisplay is called normally, it will go through
redisplay_internal which sets redisplaying_p to true.  And it will stay
true till the end of redisplay_internal, unless one of two special things
happen: (i) We enter the debugger; (ii) there's a recursive edit.

I don't see how the new backtrace facility can get any useful information
out of redisplaying_p; if there were a nested internal_condition_case*,
redisplaying_p would still be true, surely?

What am I missing?

> > > > I disagree.  There are seven places, for the seven different Lisp hooks
> > > > currently called from redisplay.

> > > Aren't they all go through safe_call?

> > They do, yes, but so do other things that we don't want to engage the
> > backtrace mechanism for.

> > > Which seven places are you talking about?

> > 1. handle_fontified_prop;
> > 2. set_message;
> > 3. clear_message;
> > 4. prepare_menu_bars (near the top);
> > 5. update_menu_bar (line ~54);
> > 6. run_window_scroll_functions;
> > 7. redisplay_window (line ~415).

> These either go through safe__call, or through run_hook_with_args.  I
> think the latter group should be converted to call safe__call and its
> friends.  And then you will have what I described: all those calls go
> through a single gate.

Maybe tomorrow!

-- 
Alan Mackenzie (Nuremberg, Germany).



  reply	other threads:[~2022-07-14 19:33 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-25 13:42 Why is it so difficult to get a Lisp backtrace? Alan Mackenzie
2022-06-25 15:26 ` Alan Mackenzie
2022-06-25 15:30   ` Stefan Kangas
2022-06-25 15:52     ` Alan Mackenzie
2022-06-25 16:27       ` Stefan Kangas
2022-06-25 15:35   ` Lars Ingebrigtsen
2022-06-25 15:59     ` Alan Mackenzie
2022-06-25 16:51       ` Eli Zaretskii
2022-06-25 19:45         ` Alan Mackenzie
2022-06-26  5:20           ` Eli Zaretskii
2022-06-27 19:48             ` Fontification error backtrace [Was: Why is it so difficult to get a Lisp backtrace?] Alan Mackenzie
2022-06-28 11:43               ` Lars Ingebrigtsen
2022-06-28 11:57               ` Eli Zaretskii
2022-06-28 17:28                 ` Alan Mackenzie
2022-06-28 18:17                   ` Eli Zaretskii
2022-06-28 19:31                     ` Alan Mackenzie
2022-06-29 19:00                       ` Eli Zaretskii
2022-07-12 19:48                         ` Redisplay hook error bactraces [Was: Fontification error backtrace] Alan Mackenzie
2022-07-13 12:33                           ` Eli Zaretskii
2022-07-13 18:41                             ` Redisplay hook error backtraces Alan Mackenzie
2022-07-13 19:00                               ` Eli Zaretskii
2022-07-13 20:12                                 ` Alan Mackenzie
2022-07-13 20:49                                   ` Stefan Monnier
2022-07-14  5:12                                   ` Eli Zaretskii
2022-07-14  9:01                                     ` Alan Mackenzie
2022-07-14  9:10                                       ` Eli Zaretskii
2022-07-14 13:42                                         ` Alan Mackenzie
2022-07-14 13:59                                           ` Eli Zaretskii
2022-07-14 16:07                                             ` Alan Mackenzie
2022-07-14 16:18                                               ` Stefan Monnier
2022-07-14 19:47                                                 ` Alan Mackenzie
2022-07-14 20:48                                                   ` Stefan Monnier
2022-07-15  5:50                                                   ` Eli Zaretskii
2022-07-15 18:18                                                     ` Alan Mackenzie
2022-07-16  6:03                                                       ` Eli Zaretskii
2022-07-14 17:09                                               ` Eli Zaretskii
2022-07-14 19:33                                                 ` Alan Mackenzie [this message]
2022-07-16  6:12                                                   ` Eli Zaretskii
2022-07-16 15:45                                                     ` Alan Mackenzie
2022-07-13 19:13                           ` Redisplay hook error bactraces [Was: Fontification error backtrace] Stefan Monnier
2022-07-13 19:24                             ` Eli Zaretskii
2022-07-13 19:58                             ` Alan Mackenzie
2022-07-13 20:45                               ` Stefan Monnier
2022-06-30 20:34                       ` Fontification error backtrace [Was: Why is it so difficult to get a Lisp backtrace?] Stefan Monnier
2022-07-01  5:39                         ` Eli Zaretskii
2022-07-01 15:34                           ` Juri Linkov
2022-07-01 16:04                             ` Eli Zaretskii
2022-07-01 19:14                               ` Juri Linkov
2022-07-01 19:26                           ` Stefan Monnier
2022-07-02  5:53                             ` Eli Zaretskii
2022-07-02 21:15                               ` Stefan Monnier
2022-07-02 20:27                         ` Alan Mackenzie
2022-07-02 21:12                           ` Stefan Monnier
2022-06-26  8:45 ` Why is it so difficult to get a Lisp backtrace? Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YtBvdZeiitRMO3J8@ACM \
    --to=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).