From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1571) id 3E5BB3858CDA; Mon, 26 Sep 2022 13:12:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E5BB3858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664197937; bh=shtSbyC57afjVfVHu663Z/0yfMCUex30//a8TGqtSWQ=; h=From:To:Subject:Date:From; b=bVkyLhyVmJnNvcz30PiHyhYBIvmunEbdW0ukVTNBHNAHeMNuLtjeBcyHnEbH3fjRZ hTWyz62YzKBWEf7tEs4Zh0MmCnOlxweKniCPVZi63keIOVhlQLLo4lO+oIOfikbZ6u NC/4XM7cDQX04QpS3c4CAPLmP25ik9k2qPq+90jE= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Thomas Neumann To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2870] fix assert in __deregister_frame_info_bases X-Act-Checkin: gcc X-Git-Author: Thomas Neumann X-Git-Refname: refs/heads/master X-Git-Oldrev: 6904ed80a26f5216aa3b9ce8377fb50307c8e886 X-Git-Newrev: 386ebf75f4c0342b1f823f4e4aba07abda3288d1 Message-Id: <20220926131217.3E5BB3858CDA@sourceware.org> Date: Mon, 26 Sep 2022 13:12:17 +0000 (GMT) List-Id: https://gcc.gnu.org/g:386ebf75f4c0342b1f823f4e4aba07abda3288d1 commit r13-2870-g386ebf75f4c0342b1f823f4e4aba07abda3288d1 Author: Thomas Neumann Date: Fri Sep 23 15:57:13 2022 +0200 fix assert in __deregister_frame_info_bases When using the atomic fast path deregistering can fail during program shutdown if the lookup structures are already destroyed. The assert in __deregister_frame_info_bases takes that into account. In the non-fast-path case however is not aware of program shutdown, which caused a compiler error on such platforms. We fix that by introducing a constant for in_shutdown in non-fast-path builds. We also drop the destructor priority, as it is not supported on all platforms and we no longer rely upon the priority anyway. libgcc/ChangeLog: * unwind-dw2-fde.c: Introduce a constant for in_shutdown for the non-fast-path case. Drop destructor priority. Diff: --- libgcc/unwind-dw2-fde.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libgcc/unwind-dw2-fde.c b/libgcc/unwind-dw2-fde.c index d237179f4ea..3c0cc654ec0 100644 --- a/libgcc/unwind-dw2-fde.c +++ b/libgcc/unwind-dw2-fde.c @@ -51,7 +51,7 @@ static struct btree registered_frames; static bool in_shutdown; static void -release_registered_frames (void) __attribute__ ((destructor (110))); +release_registered_frames (void) __attribute__ ((destructor)); static void release_registered_frames (void) { @@ -67,6 +67,8 @@ static void init_object (struct object *ob); #else +/* Without fast path frame deregistration must always succeed. */ +static const int in_shutdown = 0; /* The unseen_objects list contains objects that have been registered but not yet categorized in any way. The seen_objects list has had