From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: LemonBreezes Newsgroups: gmane.emacs.bugs Subject: bug#65640: 30.0.50; segfault when building emacs with native-comp Date: Fri, 01 Sep 2023 10:05:52 -0500 Message-ID: <76c3d882-fa35-46a5-8df0-505c2815d18c@app.fastmail.com> References: <871qfkqq0g.fsf@strawberrytea.xyz> <837cpbg47b.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=483fa2e36b2f47e2923628c1cb6a85dd Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14594"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.9.0-alpha0-701-g9b2f44d3ee-fm-20230823.001-g9b2f44d3 Cc: 65640@debbugs.gnu.org To: "Andrea Corallo" , "Eli Zaretskii" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 01 17:08:17 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 1qc5kt-0003a5-4t for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Sep 2023 17:08:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qc5kY-00053t-9p; Fri, 01 Sep 2023 11:07:54 -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 1qc5kW-00053P-OW for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 11:07:52 -0400 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 1qc5kW-0004kb-GF for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 11:07:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qc5kf-0002sd-LL for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 11:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: LemonBreezes Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Sep 2023 15:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65640 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 65640-submit@debbugs.gnu.org id=B65640.169358083710927 (code B ref 65640); Fri, 01 Sep 2023 15:08:01 +0000 Original-Received: (at 65640) by debbugs.gnu.org; 1 Sep 2023 15:07:17 +0000 Original-Received: from localhost ([127.0.0.1]:33653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc5jw-0002qA-I5 for submit@debbugs.gnu.org; Fri, 01 Sep 2023 11:07:17 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:51737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc5jt-0002pO-7S for 65640@debbugs.gnu.org; Fri, 01 Sep 2023 11:07:14 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id D4B2E5C00A0; Fri, 1 Sep 2023 11:06:58 -0400 (EDT) Original-Received: from imap47 ([10.202.2.97]) by compute3.internal (MEProxy); Fri, 01 Sep 2023 11:06:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= strawberrytea.xyz; h=cc:cc:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1693580818; x=1693667218; bh=vpDRfTjJsaBTwUf+bJgUamLY5mPVNkpTHpq 30L/ohV0=; b=bDN8r88PTszLSPFy3phea7Qhs4gtiKFOQSJ+dpRrbCK3FIAjcZx y9Oc3I/a48ZF91z0wFpsjT9GoXNfxeCoglh8fkyrw8NqyP9qmn+R8gHaeAyQL3ov 4DF/1bdvKrN6+lKdkSvOZhx5EaSrtSvhvUEqEZSllQM7ZOfoGEy7qz22KtxXDnMx xzpKloARMhZsm+FLEhCVaScHRETUApHm2h0JL7IjHpdlEL+uNdme1Nv+p7pFIk/t dRkZ6L/Gf5gDiEb+f2XV0NRMmieOgYx29sECg0Pd4Fxavp8fB9jQFzdzDsXK3P+q C+7+EW0JTFavHE9f3VQy1pTW4eUChV03AvQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1693580818; x=1693667218; bh=vpDRfTjJsaBTw Uf+bJgUamLY5mPVNkpTHpq30L/ohV0=; b=PvDzgpgengLVaLx6Nj9NxvyxsCNHY QYiEb7YG38UaSF2A/53e2XeF4bKDvG6Hibcb4YE8rXeIyhkXt1AVBz50l+HElYz6 Ahn6mXupS0HLaK/H/n8ApB2HdnHP7zmlt4uto8ozAgtRmlKsuibQYdRwowRzM/gf fxRfAflMZQy4VtWIyzslRoAeR4TL1BWyJhLF5CGOgnqcbAl3M/FiWXJddLg8UfZS NZqVNShQ4bb7BTXkeWne5SHsAj1MFPAu2UPbBK2ggmWianJLfbuLZjyDTm/KbrBU 6hF2HX402aHeBDNDDfbOPl0knq8C9ONU7xoZYFXnKL8LvhNt8a+Ax5TgA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudegvddgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdludejmdenucfjughrpefofgggkfgjfhffhffvvefutgesrgdtreer reertdenucfhrhhomhepnfgvmhhonheurhgvvgiivghsuceolhhoohhksehsthhrrgifsg gvrhhrhihtvggrrdighiiiqeenucggtffrrghtthgvrhhnpeffgedttdefvdekkeekgfdv tdfhuefhkeduledtleevheehfefhieeiveettddtleenucffohhmrghinheptdigtddrsh htpdgsphgrrdhsthenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehlohhokhesshhtrhgrfigsvghrrhihthgvrgdrgiihii X-ME-Proxy: Feedback-ID: id85149b6:Fastmail Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 43040A62DE1; Fri, 1 Sep 2023 11:06:57 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: 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:268884 Archived-At: --483fa2e36b2f47e2923628c1cb6a85dd Content-Type: text/plain Okay. So I noticed that even though Emacs was running, the native compiler was segfaulting in the background. So I recompiled Emacs with GCC and no optimizations nor patches and I still see that native compilation is segfaulting on org-element.el. I have attached some verbose logs: https://0x0.st/HpjT.txt I don't know how to get a backtrace. If I run Emacs with GDB, libgccjit gives me a segfault in the *Async-native-compile-log* but Emacs itself does not segfault. Sincerely, StrawberryTea On Thu, Aug 31, 2023, at 2:24 AM, Andrea Corallo wrote: > Eli Zaretskii writes: > > >> From: StrawberryTea > >> Date: Wed, 30 Aug 2023 14:38:55 -0500 > >> > >> > >> Hi. I just set up a fresh install of Gentoo with Clang as my default > >> compiler. At first, I was trying to compile Emacs with Clang and Emacs > >> was finding -lgccjit but not finding the libgccjit.h header file. So I > >> overwrote the compiler Emacs was using to GCC instead and now it > >> compiles but segfaults when native-compiling some Elisp files. > >> > >> Build log with Clang (configure error): https://bpa.st/ODFBK > >> Build log with GCC (segfault): https://0x0.st/Hpbz.txt > > > > First, you apply local patches to the Emacs tree, so you are compiling > > code that is not from our Git repository, but some variation of that. > > > > More importantly: it looks like you build Emacs with "-O3 -march=native", > > which are not the default compilation switches, and cause GCC to > > over-optimize the code. Please try again without those switches. > > > > If using the default compiler switches doesn't help, please run the > > crashing command under GDB, and when it segfaults, produce the > > C-level backtrace and post it here. > > > > Please also always post the build logs as plain text or attachments to > > your messages, instead of pointing to a URL that could some day go > > away, and thus years from now people will be unable to see the log by > > reading this discussion. > > > > Thanks. > > > > P.S. Adding Andrea. > > Agree on everything, from this far (and for whatever reason) looks like > the crash is in libgccjit. So its version might be relevant as well. > > Thanks > > Andrea > --483fa2e36b2f47e2923628c1cb6a85dd Content-Type: text/html Content-Transfer-Encoding: quoted-printable
Okay. So I noti= ced that even though Emacs was running, the native
compile= r was segfaulting in the background. So I recompiled Emacs with
GCC and no optimizations nor patches and I still see that native c= ompilation is
segfaulting on org-element.el. I have attach= ed some verbose logs:

I don't know ho= w to get a backtrace. If I run Emacs with GDB, libgccjit
g= ives me a segfault in the *Async-native-compile-log* but Emacs itself
does not segfault.

Sincerely,
StrawberryTea

On Thu, Aug 31, = 2023, at 2:24 AM, Andrea Corallo wrote:
Eli Zaretskii <eliz@gnu.org> writes:

>>= ; From: StrawberryTea <look= @strawberrytea.xyz>
>> Date: Wed, 30 Aug 2023= 14:38:55 -0500
>> 
>> = ;
>> Hi. I just set up a fresh install of Gentoo wit= h Clang as my default
>> compiler. At first, I was t= rying to compile Emacs with Clang and Emacs
>> was f= inding -lgccjit but not finding the libgccjit.h header file. So I
>> overwrote the compiler Emacs was using to GCC instead a= nd now it
>> compiles but segfaults when native-comp= iling some Elisp files.
>> 
>&= gt; Build log with Clang (configure error): https://bpa.st/ODFBK
>> Build log with= GCC (segfault): https://0x0.st= /Hpbz.txt
>
> First, you apply loc= al patches to the Emacs tree, so you are compiling
> co= de that is not from our Git repository, but some variation of that.
<= /div>
>
> More importantly: it looks like you bu= ild Emacs with "-O3 -march=3Dnative",
> which are not t= he default compilation switches, and cause GCC to
> ove= r-optimize the code.  Please try again without those switches.
<= /div>
>
> If using the default compiler switches= doesn't help, please run the
> crashing command under = GDB, and when it segfaults, produce the
> C-level backt= race and post it here.
>
> Please also= always post the build logs as plain text or attachments to
> your messages, instead of pointing to a URL that could some day g= o
> away, and thus years from now people will be unable= to see the log by
> reading this discussion.
=
>
> Thanks.
>
&g= t; P.S. Adding Andrea.

Agree on everything,= from this far (and for whatever reason) looks like
the cr= ash is in libgccjit.  So its version might be relevant as well.
=

Thanks

  And= rea


--483fa2e36b2f47e2923628c1cb6a85dd--