From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#50268: 28.0.50; Assertion warning during native compilation Date: Mon, 20 Sep 2021 22:12:32 +0000 Message-ID: References: <87sfyrt4df.fsf@md5i.com> <87tuj0qw2x.fsf@md5i.com> <87lf4bqbsx.fsf@md5i.com> Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11918"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Stefan Monnier , 50268@debbugs.gnu.org To: Michael Welsh Duggan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 21 00:33:31 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSRqs-0002uT-Eo for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Sep 2021 00:33:30 +0200 Original-Received: from localhost ([::1]:38538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSRqr-0006pF-AA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Sep 2021 18:33:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSRX4-0007pn-UK for bug-gnu-emacs@gnu.org; Mon, 20 Sep 2021 18:13:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60890) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSRX4-00054B-Lz for bug-gnu-emacs@gnu.org; Mon, 20 Sep 2021 18:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mSRX4-0000Gj-H4 for bug-gnu-emacs@gnu.org; Mon, 20 Sep 2021 18:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Sep 2021 22:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50268 X-GNU-PR-Package: emacs Original-Received: via spool by 50268-submit@debbugs.gnu.org id=B50268.1632175959979 (code B ref 50268); Mon, 20 Sep 2021 22:13:02 +0000 Original-Received: (at 50268) by debbugs.gnu.org; 20 Sep 2021 22:12:39 +0000 Original-Received: from localhost ([127.0.0.1]:44202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSRWg-0000Fh-Mj for submit@debbugs.gnu.org; Mon, 20 Sep 2021 18:12:38 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:50517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSRWe-0000FX-9h for 50268@debbugs.gnu.org; Mon, 20 Sep 2021 18:12:37 -0400 Original-Received: from ma.sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 18KMCWiH000309 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Mon, 20 Sep 2021 22:12:33 GMT In-Reply-To: <87lf4bqbsx.fsf@md5i.com> (Michael Welsh Duggan's message of "Sun, 05 Sep 2021 11:31:10 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:214889 Archived-At: Michael Welsh Duggan 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