From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 03D4C3858C2F; Wed, 17 May 2023 11:25:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03D4C3858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684322721; bh=10KF/HjKddkXOSI/ngrtv1InGyCawGo520dZbXNE9vE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=b8nxmoDgF6lLcG8alFao/JbPXgVMfTAYushgQvJ/73wDRa1ZO5w8GEoSEHwnYCNjU ZJIj4AZJtwbewz1QBG873d+Xzht9W+RvC/QnWi6q7/es5u7T2qjSH32Yyz3NhBzor4 /nZ4nW7c3wLghAe9ErAEuhV/Nb9DIwjXCAQe5vSE= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/109889] [13/14 Regression] Segfault in __run_exit_handlers since r13-5309-gc3c6c307792026 Date: Wed, 17 May 2023 11:25:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109889 --- Comment #2 from Jakub Jelinek --- r2 is the toc pointer, so having it 0 is weird. Looking at glibc-2.36-10.fc37 (not sure if you are using a different one), I see 000000000005b560 <__run_exit_handlers>: 5b560: 21 00 4c 3c addis r2,r12,33 5b564: a0 b9 42 38 addi r2,r2,-18016 ... 5b5a8: 18 00 41 f8 std r2,24(r1) so wonder what x/1gx $r1+24 is. Most likely some call from that function didn't restore r2 properly? Though, I believe in PowerPC ELFv2 it is the caller's responsibility to res= tore it and that is why it has the nops after bl (in case the call is guaranteed to= be into code with the same TOC) and ld r2,24(r1) otherwise.=