From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EED6A38582A3; Sat, 9 Jul 2022 08:24:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EED6A38582A3 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/29343] New: [gdb/symtab] per_cu->length set without initial_length_size Date: Sat, 09 Jul 2022 08:24:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jul 2022 08:24:37 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29343 Bug ID: 29343 Summary: [gdb/symtab] per_cu->length set without initial_length_size Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: symtab Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- I ran into a race condition for per_cu->length, and while investigating thi= s I noticed this particular requirement about length: ... /* The start offset and length of this compilation unit.=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 NOTE: Unlike comp_unit_head.length, this length includes=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 initial_length_size.=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 If the DIE refers to a DWO file, this is always of the original die,= =20=20=20=20=20=20=20 not the DWO file. */ sect_offset sect_off {}; unsigned int length =3D 0; ... Grepping through the sources shows 3 spots were this requirement is not met: ... $ grep "cu->length =3D " gdb/dwarf2/read.c the_cu->length =3D length; this_cu->length =3D cu->header.get_length (); this_cu->length =3D cu->header.get_length (); this_cu->length =3D m_new_cu->header.get_length (); this_cu->length =3D cu_header.length + cu_header.initial_length_size; ... --=20 You are receiving this mail because: You are on the CC list for the bug.=