unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: The poor quality of Emacs's backtraces
Date: Fri, 14 Jul 2023 13:07:00 +0000	[thread overview]
Message-ID: <ZLFIdLH_BzVNerGK@ACM> (raw)
In-Reply-To: <6CB5E709-8F5A-4015-9F2C-337A87916C66@gmail.com>

Hello, Mattias.

On Fri, Jul 14, 2023 at 14:35:32 +0200, Mattias Engdegård wrote:
> 14 juli 2023 kl. 12.48 skrev Alan Mackenzie <acm@muc.de>:

[ .... ]

> The fault is perhaps closer to (my?) home: the bytecode interpreter
> doesn't add a stack frame for many built-in ops. For example, (cdr 3)
> will signal a `wrong-type-argument` error but `cdr` isn't in the
> backtrace.

We can't afford to add stack frames for things like cdr.  It would make
Emacs _far_ too slow.

> That is something we could and should fix. At least for some ops it
> should be pretty easy, and even a partial remedy would be helpful.
> Alan, thank you for bringing this to my attention!

My idea for fixing this problem would be to add an extra parameter to
the CHECK_LIST (C) macro, the (symbol of) the primitive which is using
cdr.  This would be output in the backtrace error message.

There are only 1,728 occurrences of CHECK_* in the Emacs C sources.
Much of the amendment could be automated.

> > My enhancement is to store the @dfn{defining symbol} of anonymous
> > functions inside the function, whether an interpreted function, or
> > either type of compiled function.  This symbol is the defun/defmacro
> > etc. within which the lambda is defined.

> Well, no, this isn't necessarily an improvement. If anything our
> function objects are too fat; making them more so isn't what we need.

Why?  Yesterday evening, the identity of {comp-spill-lap-function} was
very helpful in locating the buggy source.

Do you have any alternative mechanism in mind for identifying anonymous
functions in backtraces?  After all, there is nothing particularly wrong
with the fatness of our function objects, provided it is not taken to
extremes - RAM is cheap and plentiful.

-- 
Alan Mackenzie (Nuremberg, Germany).



  reply	other threads:[~2023-07-14 13:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13 13:35 The poor quality of Emacs's backtraces Alan Mackenzie
2023-07-13 14:17 ` Christopher Dimech
2023-07-13 14:57 ` Mattias Engdegård
2023-07-14  8:00   ` Ihor Radchenko
2023-07-14  9:08     ` Mattias Engdegård
2023-07-14  9:18       ` Ihor Radchenko
2023-07-14 10:58         ` Alan Mackenzie
2023-07-14 10:56     ` Eli Zaretskii
2023-07-14 10:48   ` Alan Mackenzie
2023-07-14 12:35     ` Mattias Engdegård
2023-07-14 13:07       ` Alan Mackenzie [this message]
2023-07-14 18:06         ` Mattias Engdegård
2023-07-14 20:51           ` Alan Mackenzie
2023-07-17 15:52             ` Mattias Engdegård
2023-07-17 19:02               ` Alan Mackenzie
2023-07-17 19:50                 ` Ihor Radchenko
2023-07-18 11:19                   ` Alan Mackenzie
2023-07-18 11:54                     ` Ihor Radchenko
2023-07-18 13:57                       ` Alan Mackenzie
2023-07-19  8:05                         ` Ihor Radchenko
2023-07-19 10:33                 ` Mattias Engdegård
2023-07-19 15:45                   ` Alan Mackenzie
2023-07-14  1:10 ` Michael Heerdegen

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=ZLFIdLH_BzVNerGK@ACM \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=mattias.engdegard@gmail.com \
    /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).