From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 94B143864805; Fri, 8 Jul 2022 09:01:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94B143864805 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/29336] New: [gdb, debug-types, debug-names] Bad CU index complaint not triggered Date: Fri, 08 Jul 2022 09:01:13 +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: Fri, 08 Jul 2022 09:01:13 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29336 Bug ID: 29336 Summary: [gdb, debug-types, debug-names] Bad CU index complaint not triggered 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: --- While working on PR29334, I noticed this code right above the DW_IDX_type_u= nit handling code: ... case DW_IDX_compile_unit: /* Don't crash on bad data. */ if (ull >=3D per_bfd->all_comp_units.size ()) { complaint (_(".debug_names entry has bad CU index %s" " [in module %s]"), pulongest (ull), objfile_name (objfile)); continue; } per_cu =3D per_bfd->get_cu (ull); break; ... So, if I have 5 CUs and 5 TUs, and a ull CU index of 7, we should complain. But we don't because we compare with "per_bfd->all_comp_units.size ()" inst= ead of with "per_bfd->all_comp_units.size () - per_bfd->tu_stats.nr_tus". --=20 You are receiving this mail because: You are on the CC list for the bug.=