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#48342: native-comp emacs gets into an infinite loop at startup if no .el files are available Date: Tue, 11 May 2021 08:37:01 +0000 Message-ID: References: <878s4l1zlt.fsf@secretsauce.net> 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="10369"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 48342@debbugs.gnu.org To: Dima Kogan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 11 11:24:22 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 1lgOcn-0002Wo-B3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 May 2021 11:24:21 +0200 Original-Received: from localhost ([::1]:57610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgOcm-0005VV-7l for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 May 2021 05:24:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgNtz-0006zJ-UV for bug-gnu-emacs@gnu.org; Tue, 11 May 2021 04:38:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgNtx-0006Az-VK for bug-gnu-emacs@gnu.org; Tue, 11 May 2021 04:38:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lgNtx-00021H-SC for bug-gnu-emacs@gnu.org; Tue, 11 May 2021 04:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 May 2021 08:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48342 X-GNU-PR-Package: emacs Original-Received: via spool by 48342-submit@debbugs.gnu.org id=B48342.16207222267675 (code B ref 48342); Tue, 11 May 2021 08:38:01 +0000 Original-Received: (at 48342) by debbugs.gnu.org; 11 May 2021 08:37:06 +0000 Original-Received: from localhost ([127.0.0.1]:34869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgNt4-0001zj-Gv for submit@debbugs.gnu.org; Tue, 11 May 2021 04:37:06 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:51659) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgNt2-0001zY-OL for 48342@debbugs.gnu.org; Tue, 11 May 2021 04:37:05 -0400 Original-Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 14B8b1TB017371 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Tue, 11 May 2021 08:37:02 GMT In-Reply-To: <878s4l1zlt.fsf@secretsauce.net> (Dima Kogan's message of "Tue, 11 May 2021 00:47:10 -0700") 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:206209 Archived-At: Dima Kogan writes: > Hi. I maintain Debian packages of bleeding-edge emacs builds: > > http://emacs.secretsauce.net/ > > Recently I enabled the native-comp flags for these packages. The results > mostly work, but a user sent me a bug report whose cause I just tracked > down. Some of this is probably my fault, as the packager, but there's an > emacs bug here too. > > To tickle the bug the user needs to install the emacs-snapshot package, > but NOT the emacs-snapshot-el package. This results in the .elc files > being shipped, but NOT the .el files. This is a valid way to do it > without the native-comp patches, and the Debian emacs packages have > allowed this since forever. > > If you install emacs like this, this happens: > > $ emacs-snapshot -Q -batch -f batch-native-compile empty.el > > Fatal error 11: Segmentation fault > > The C backtrace is 6033 frames long, which can't be good. xbacktrace > says this: > > (gdb) xbacktrace > "display-warning" (0xffebcfd8) > "display-warning" (0xffebd5d8) > .... lots more "display-warning" > "locate-file" (0xffffe498) > "command-line" (0xffffe5a0) > "normal-top-level" (0xffffe640) > > And the warning itself is: > > "Cannot look-up eln file as no source file was found for /usr/share/emacs/28.0.50/lisp/emacs-lisp/warnings.elc" > > So something somewhere wanted to throw a warning, and this warning tried > to find its own sources, couldn't do it, and threw another warning. And > so on. > > So first off, it'd be great if emacs could handle this without such a > recursive failure mode. It took me a long time to figure out what's > happening, and a plain-text error message on the console would have been > nice. Hi Dima, could you share the Lisp backtrace? If you have loaded the .gdbinit shipped with the repot this will be at the bottom of the gdb backtrace. > And second: how should this be packaged? Is shipping the .el files a > hard requirement now? Yes if you want the native compiler to be able to compile files, otherwise you should either native compile all lisp files Ahead of Time or set `comp-deferred-compilation' to nil in early init so that Emacs will not try to native compile bytecode being loaded. Thanks Andrea