From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63365: 30.0.50; GCC 13.1 breaks building Emacs with native-compilation Date: Mon, 08 May 2023 18:13:06 +0300 Message-ID: <835y92dfgd.fsf@gnu.org> References: <86wn1jtezk.fsf@gnu.org> <83jzxjcac9.fsf@gnu.org> <86h6smopo6.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31425"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63365@debbugs.gnu.org, akrl@sdf.org To: Arash Esbati Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 08 17:13:20 2023 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 1pw2YA-0007x9-Vy for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 May 2023 17:13:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pw2Xv-00040q-EX; Mon, 08 May 2023 11:13:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pw2Xu-00040U-Eo for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 11:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pw2Xu-0000eR-63 for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 11:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pw2Xt-0002nP-JN for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 11:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 May 2023 15:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63365 X-GNU-PR-Package: emacs Original-Received: via spool by 63365-submit@debbugs.gnu.org id=B63365.168355873610681 (code B ref 63365); Mon, 08 May 2023 15:13:01 +0000 Original-Received: (at 63365) by debbugs.gnu.org; 8 May 2023 15:12:16 +0000 Original-Received: from localhost ([127.0.0.1]:41330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pw2X9-0002mB-4l for submit@debbugs.gnu.org; Mon, 08 May 2023 11:12:16 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pw2X5-0002lp-Ni for 63365@debbugs.gnu.org; Mon, 08 May 2023 11:12:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pw2X0-0000Ne-A8; Mon, 08 May 2023 11:12:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=VdLUkhGXzY/JbtdxkLLGmeEvrtNzEU1RkTOLQxLGh4g=; b=SOREJ5+v5T8N 1SwsGgh9ClmT4TvEAUH2zoi+hZvwqNCaP1ATGGg2XOlK+/2d/hvB5LZCCpOYEw2ch4TG6XKcKPjNc gFCMkgwsapuD3TsyuY/KUl1C4JM7an0PEx4AG0HAVUFB1i0vRhIDXOTwYixc6to5Bs0FqB9Uwhk7a Ymgu44T1lOMu95DaiN2sJqym1XBuvyxKe0jzVCRoYX1mGo3Gd7+xZ9Ev9tVNUMbgJ91ft3ZdcIhu2 q1IVg3CUozETR53LmHUZsJ6axH/M0NkrxJ4opH4mpuocWDF8d/tpmhB3jSUrLtYdVq8BAv6XX/fv+ 2kzs27O8dhDSV6FBJ9Dx3g==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pw2Wz-0002Gl-MC; Mon, 08 May 2023 11:12:05 -0400 In-Reply-To: <86h6smopo6.fsf@gnu.org> (message from Arash Esbati on Mon, 08 May 2023 16:36:57 +0200) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:261333 Archived-At: > From: Arash Esbati > Cc: Andrea Corallo , 63365@debbugs.gnu.org > Date: Mon, 08 May 2023 16:36:57 +0200 > > Eli Zaretskii writes: > > > These addresses are not useful anywhere but on your system. So either > > run this command under GDB and post a human-readable source-level > > backtrace, > > Thank. I tried that, i.e., > > $ ./autogen.sh > $ ./configure --with-native-compilation > $ gdb > $ (gdb) make > > But backtrace in gdb returns nothing (nothing on stack IIRC). Do I have > to do something else? Yes, of course. The GDB command "make" doesn't run anything under the debugger, it is just a conveniency for rebuilding a program without exiting GDB. What you need is to run Emacs under GDB while it (Emacs) executes the command which crashes. To find out what is that crashing command, you should say: $ make V=1 (note: "make", not "make -jN"!). Then wait for the crash. The (longish) command shown by Make immediately before the crash is the command that you want; copy it into the clipboard, and then do $ cd /path/to/emacs/src $ gdb ./emacs.exe ... (gdb) cd ../lisp (gdb) run and wait for the crash. Then: (gdb) thread 1 (gdb) bt Note: the command you copy into the clipboard may need massaging before you can paste it to the GDB prompt: remove any stray newlines and backslashes that escape newlines etc. Use some editor for that: either (an older) Emacs or even Notepad. > > or at least convert the above list of addresses to a list of file > > names, function names, and line numbers as explained in the node > > "Crashing" of the Emacs user manual. > > The recipe from the manual[1] doesn't work since: > > $ sed -n 's/.*\[\(.*\)]$/\1/p' lisp/emacs_backtrace.txt > > prints nothing on addresses like: > > 00007ff67feca12e > 00007ff67fd98be1 > 00007ff67fdb9601 > > Am I missing something? The recipe goes like this: sed -n 's/.*\[\(.*\)]$/\1/p' BACKTRACE | addr2line -C -f -i -p -e BINDIR/EMACS-BINARY (It is broken in the manual into two lines, because the line is long, but it is a single long command that runs Sed and pipes its output into addr2line, a program that comes with GNU Binutils.) > Another observation after reading etc/DEBUG: The build is successful if > I follow the advice there and do: > > $ ./configure --with-native-compilation CFLAGS='-O0 -g3' > > Does this make sense? It probably means this is a GCC bug that rears its ugly head when you compile with optimizations. Can you show a full C compilation command of one of the C source files? Like this: $ cd /path/to/emacs/src $ make data.o -W data.c V=1 I'd like to see all of the compiler's command-line options your build uses.