unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Michael Welsh Duggan <mwd@md5i.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, 50268@debbugs.gnu.org
Subject: bug#50268: 28.0.50; Assertion warning during native compilation
Date: Mon, 20 Sep 2021 22:12:32 +0000	[thread overview]
Message-ID: <xjfh7eesxpr.fsf@ma.sdf.org> (raw)
In-Reply-To: <87lf4bqbsx.fsf@md5i.com> (Michael Welsh Duggan's message of "Sun, 05 Sep 2021 11:31:10 -0400")

Michael Welsh Duggan <mwd@md5i.com> writes:

> I was able to determine that there was a bug in the pacproxy.el code
> that I included in the bug report.  Fixing that bug caused native
> compilation to work.  The assertion and backtrace were not particularly
> useful in determining the bug in the code, though.  The bug was in the
> `pacproxy--retrieve-wpad' function when I let-bound the following
> illegal lambda:
>
>   (lambda (&rest) "DIRECT")
>
> The fix was to change this to:
>
>   (lambda (&rest _) "DIRECT")
>
> Is there another part of the compiler that could have caught this and
> returned a useful diagnostic?

Hi Michael & all,

I had a quick look and these are my findings:

(byte-compile '(lambda (&rest _) "DIRECT"))
=>
#[128 "\300\207" ["DIRECT"] 2 "DIRECT

(fn &rest _)"]

Here we have as encoded signature 128 (one rest arg) and the frame size
is 2 (one for the rest arg and one for the immediate). Fine...

(byte-compile '(lambda () "DIRECT"))
=>
#[0 "\300\207" ["DIRECT"] 1 "DIRECT"] 

Here we have as encoded signature 0 (no args) and the frame size is 1
(will be used by the immediate).  Fine as well.

(byte-compile '(lambda (&rest) "DIRECT"))
=>
#[128 "\300\207" ["DIRECT"] 1 "DIRECT

(fn &rest)"]

This is the problematic case that was signaled as reproducer.  Here we
have as encoded signature 128 (one rest arg) but the frame size (1) is
not accounting for this.

I think this output is a incoherent and I guess the byte compiler should
probably just raise an error and refuse to compile if the lambda list is
invalid.  Am I wrong?

Regards

  Andrea





  reply	other threads:[~2021-09-20 22:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 14:05 bug#50268: 28.0.50; Assertion warning during native compilation Michael Welsh Duggan
2021-09-04 14:00 ` Michael Welsh Duggan
2021-09-05 15:31   ` Michael Welsh Duggan
2021-09-20 22:12     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-09-21  7:50       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-21 12:17         ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-21 15:56           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  -- strict thread matches above, loose matches on Subject: below --
2021-09-21 11:15 bug#50720: unnamed &rest broken Mattias Engdegård
2021-09-21 16:11 ` bug#50720: bug#50268: 28.0.50; Assertion warning during native compilation Lars Ingebrigtsen
2021-09-21 16:22   ` Mattias Engdegård
2021-09-21 17:09     ` Noam Postavsky
2021-09-21 17:53       ` Eli Zaretskii
2021-09-21 19:32         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-22  5:43           ` Eli Zaretskii
2021-09-23  1:46             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-23  6:38               ` Eli Zaretskii
2021-09-23 11:09               ` Mattias Engdegård
2021-09-23 21:03                 ` Lars Ingebrigtsen
2021-09-24  6:07                   ` Eli Zaretskii
2021-09-25  0:51                     ` Lars Ingebrigtsen
2021-09-25 18:37                     ` Mattias Engdegård
2021-09-21 16:26   ` Eli Zaretskii

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=xjfh7eesxpr.fsf@ma.sdf.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=50268@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=mwd@md5i.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).