From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ADFE1385803E; Wed, 13 Jul 2022 07:41:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADFE1385803E From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/29343] [gdb/symtab] per_cu->length set without initial_length_size Date: Wed, 13 Jul 2022 07:41:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: Message-ID: In-Reply-To: References: 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: Wed, 13 Jul 2022 07:41:17 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29343 --- Comment #4 from Tom de Vries --- (In reply to Tom de Vries from comment #2) > ... > @@ -23377,8 +23377,6 @@ dwarf2_per_cu_data::get_header () const > const gdb_byte *info_ptr > =3D this->section->buffer + to_underlying (this->sect_off); >=20=20 > - memset (&m_header, 0, sizeof (m_header)); > - > read_comp_unit_head (&m_header, info_ptr, this->section, > rcuh_kind::COMPILE); >=20=20 > ... Hmm, so struct comp_unit_head is a POD, that we init using memset, sometime= s. Sometimes we just initialize a bit, like this: ... /* Initialize it due to a false compiler warning. */ header.signature =3D -1; header.type_cu_offset_in_tu =3D (cu_offset) -1; ... And sometime not at all (before the reading is done). To make sure things are initialized consistently, we'd have to start using constructors, which I suppose means we no longer can use the memset. So I guess this requires a larger rewrite. --=20 You are receiving this mail because: You are on the CC list for the bug.=