From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 93A4B3858D20; Mon, 11 Mar 2024 11:51:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 93A4B3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710157918; bh=yU5Pa/qfd9ga7ON45fnWlUazKF7dyEqxeivNbmbFj3k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QP69atgAztMDLf9pmoT9/Vs5Libi6rwpIcatNEMLfSqg1tF4SfPV6nyf9gImayaKU u7zQZQhkOl9dP5UpzHkQxP7mHxvT4CITbhQANQg8KAeXfVN8LTPGzlYZm7m+fxaNLl HQeOBLEkIu/mGPFsV/W4cTaqWtR3PnBBBFHxWUkM= From: "dimitar.yordanov at sap dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgcc/111731] [13/14 regression] gcc_assert is hit at libgcc/unwind-dw2-fde.c#L291 Date: Mon, 11 Mar 2024 11:51:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgcc X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: dimitar.yordanov at sap dot com 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: 13.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D111731 Dimitar Yordanov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dimitar.yordanov at sap do= t com --- Comment #3 from Dimitar Yordanov --- Hi, what I can further add as a detail to the code below is that in the error c= ase "begin" is after "range[0]" as calculated by get_pc_range ----------------- void __register_frame_info_bases (const void *begin, struct object *ob, void *tbase, void *dbase) { ..... // Register the object itself to know the base pointer on deregistration. btree_insert (®istered_frames, (uintptr_type) begin, 1, ob); // Register the frame in the b-tree uintptr_type range[2]; get_pc_range (ob, range); btree_insert (®istered_frames, range[0], range[1] - range[0], ob); ----------------- and pc_begin comes from the following with "((encoding & 0x70) =3D=3D DW_EH_PE_pcrel" being true ----------------- static const unsigned char * read_encoded_value_with_base (unsigned char encoding, _Unwind_Ptr base, const unsigned char *p, _Unwind_Ptr *val) { .... case DW_EH_PE_sdata8: result =3D u->s8; p +=3D 8; .... result +=3D ((encoding & 0x70) =3D=3D DW_EH_PE_pcrel ? (_Unwind_Internal_Ptr) u : base); ----------------- E.g. u->s8 has a value of 0xffffffffffffe6f8 u 0x7fa7fc22f908 and with that result 0x7fa7fc22e000 which is lower as the begin 0x7fa7fc22f160=