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: Fri, 26 Jan 2024 15:11:36 +0200 Message-ID: <86ttn09r3r.fsf@gnu.org> References: <86wn1jtezk.fsf@gnu.org> <83jzxjcac9.fsf@gnu.org> <86h6smopo6.fsf@gnu.org> <835y92dfgd.fsf@gnu.org> <86v8h2k475.fsf@gnu.org> <83r0rqaycc.fsf@gnu.org> <86wn1h3dpz.fsf@gnu.org> <835y91brfv.fsf@gnu.org> <86fs849xb0.fsf@gnu.org> <83ild08i8j.fsf@gnu.org> <86y1lwmfcw.fsf@gnu.org> <83ild06sb5.fsf@gnu.org> <83a5yc6m2e.fsf@gnu.org> <83jzxf5giw.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34829"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63365@debbugs.gnu.org, akrl@sdf.org To: arash@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 26 14:12:15 2024 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 1rTM0E-0008tZ-KK for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Jan 2024 14:12:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rTLzz-0001Rf-JU; Fri, 26 Jan 2024 08:11:59 -0500 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 1rTLzx-0001RX-5a for bug-gnu-emacs@gnu.org; Fri, 26 Jan 2024 08:11:57 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rTLzw-0002f2-6c for bug-gnu-emacs@gnu.org; Fri, 26 Jan 2024 08:11:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rTM02-0002qB-Cx for bug-gnu-emacs@gnu.org; Fri, 26 Jan 2024 08:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Jan 2024 13:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63365 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 63365-submit@debbugs.gnu.org id=B63365.170627471610906 (code B ref 63365); Fri, 26 Jan 2024 13:12:02 +0000 Original-Received: (at 63365) by debbugs.gnu.org; 26 Jan 2024 13:11:56 +0000 Original-Received: from localhost ([127.0.0.1]:50656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rTLzw-0002pp-C1 for submit@debbugs.gnu.org; Fri, 26 Jan 2024 08:11:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rTLzt-0002pZ-L0 for 63365@debbugs.gnu.org; Fri, 26 Jan 2024 08:11:54 -0500 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 1rTLzg-0002bK-15; Fri, 26 Jan 2024 08:11:41 -0500 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=NYvpGLuVDoqPSY2qrD21ecTOMqvpkQYGAshscmuOSMs=; b=rFgAdy4ojp8p lm9z69xTNY/04X1kR5s9CUX9pDfFjpAcl/qGUAewgMznZ4pPe906LjRU/wF58sXHFvduf7E+siP/D qDJTJQlPfxLiW1Wt0DGq/5i1lqncCrgV7PUJ5EvG/2L+HLc9rB/USzTJEmS6tF1dPcBVR2vUN4a2Q cpne6EtjTJlTffUpXpsAdPnml+OHzK0RE3ieXK7zK6tAs9OP2BtyYU6+gIOX7x06Vg2Ex8jBMssIR O9W4YZWKEcJSXnTwklb9U1IBVCSOrVWLKJwC8XPEyVcZ04hRjNabtHGqMimmiSxqt/dGL5I4bMzw3 97EgMOGgLAICnBmAhaNzuQ==; In-Reply-To: <83jzxf5giw.fsf@gnu.org> (message from Eli Zaretskii on Thu, 11 May 2023 13:06:15 +0300) 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:278924 Archived-At: > Date: Thu, 11 May 2023 13:06:15 +0300 > From: Eli Zaretskii > Cc: 63365@debbugs.gnu.org, akrl@sdf.org > > > Cc: 63365@debbugs.gnu.org, akrl@sdf.org > > Date: Wed, 10 May 2023 22:08:57 +0300 > > From: Eli Zaretskii > > > > > Cc: 63365@debbugs.gnu.org, akrl@sdf.org > > > Date: Wed, 10 May 2023 19:54:06 +0300 > > > From: Eli Zaretskii > > > > > > Maybe it's a bug in your addr2line, then. It works perfectly here, > > > FWIW. > > > > > > Can you make the unstripped emacs.exe available for download > > > somewhere, along with the emacs_backtrace.txt produced by that same > > > binary? I'd like to take a look. > > > > Hmm... looking at the files you sent, I'm beginning to think something > > is wrong with generating backtraces on MS-Windows in the 64-bit > > builds. Maybe it has to do with ASLR, or maybe the code which > > produces the backtrace is wrong in 64-bit executables. > > Actually, I take this back: the addresses in emacs_backtrace.txt seem > reasonable, similar to addresses shown in GDB backtraces from a 64-bit > Windows build we have on the bug tracker. > > So the suspicion goes back to addr2line, although I see the same > problem with my version, which I built myself and which works > flawlessly with the 32-bit MinGW build of Emacs. This conclusion was incorrect. There's nothing wrong with addr2line; the reason for the problem _was_ ASLR. addr2line interprets the addresses in emacs_backtrace.txt relative to the base address of the program image as recorded in the PE header of the executable file. It cannot do anything else, since it doesn't have a live program to work with (unlike when running Emacs under GDB). But ASLR causes programs be loaded at base addresses that are randomized from run to run, and thus are usually different from what is recorded in the PE header. So for this to work on modern versions of Windows, Emacs must correct the addresses it writes to emacs_backtrace.txt, so as to make them match the situation where Emacs is loaded at the fixed base address recorded in the header. I recently upgraded my main development machine, and, as luck would have it, had crashes during the build, so I could study the problem and fix it. It should now be fixed on the master branch. I could only test the solution in a 32-bit MinGW build, so please try testing it in the 64-bit build when you have a crash on your hands. Thanks.