From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 954E63854179; Wed, 17 May 2023 15:10:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 954E63854179 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684336251; bh=+rax2UIjWaflWPPmXW/M8b/X4CP7W4dYnOe1ep9KFzo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xEcVM1rThFrR1MapwwZtmk8q8gRd/pwHdGab0gOi8hKK1ryGtYevCu2NIalxPMzrM N89cQYiD4WgMAL4Q75zBkwkt93lpGhG4yENVOa6QjvfjeD/0bMjGzulknnWVYAUeWv mFsSm4nfstRWXauI22G5EpaXx8b+vRBpmKNpE+8w= From: "tuliom at ascii dot art.br" 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 15:10:51 +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: tuliom at ascii dot art.br 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 #6 from Tulio Magno Quites Machado Filho --- Let me elaborate my previous comment... When initializing the object at 0x100414c8, one of its members points to an address in the stack (0x7fffffffe8f8). All these functions return and when __run_exit_handlers() is called, the address 0x7fffffffe8f8 is used to save the TOC pointer (r2) before calling = the destructors of the library. The destructors manipulate the object at 0x100414c8, zeroing all its member= s, including the address where the TOC pointer was saved.=