unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: When calling defuns is a Bad Thing.
Date: Mon, 22 Oct 2018 14:06:38 +0000	[thread overview]
Message-ID: <20181022140638.GA4585@ACM> (raw)
In-Reply-To: <jwvr2gjp48g.fsf-monnier+gmane.emacs.devel@gnu.org>

Hello, Stefan.

On Sun, Oct 21, 2018 at 14:07:18 -0400, Stefan Monnier wrote:
> > Calling defuns (as opposed to primitives) from edebug is a bad idea,
> > unless those defuns are also defined in edebug.el.

> Just as a datapoint, I remember using Edebug to debug itself, and
> it was very useful to be able to do it (although it's clearly
> problematic in the general case).

> So, I partly agree, but I also think maybe we should try and work to
> make it easier to Edebug any code, even the one used by Edebug.

I hacked up some analysis code (something which you surely have as a
nicely parameterised macro ;-) and found 50 "external" defuns called by
edebug.el, most of them, surely, in the non-engine parts.  Indeed, one
of them is sit-for, which I can vaguely remember edebugging in the past,
so yes, things aren't as bad as I initially thought.

There are, by the way, twelve "external" macros called, ranging all the
way from cl-defstruct to pcase-dolist to cl-letf*.  Most, if not all, of
these are surely "harmless", in that either they're used in non-critical
parts of edebug.el, or they don't generate calls to defuns in their
expansions.

So, I now agree with your initial assessment, there's probably nothing
much to worry about here, but I intend to explore further, and see if I
can crash/hang Emacs by using edebug.

One thing that could be done is to put a `no-edebug' property on symbols
whose function mustn't be instrumented (such as edebug-slow-after), but
that seems somewhat excessive, unless we find a real problem.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



  reply	other threads:[~2018-10-22 14:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-21 16:41 When calling defuns is a Bad Thing Alan Mackenzie
2018-10-21 18:07 ` Stefan Monnier
2018-10-22 14:06   ` Alan Mackenzie [this message]
2018-10-22 15:25     ` 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=20181022140638.GA4585@ACM \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.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).