From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id 51A9239F1493 for ; Fri, 5 Feb 2021 13:09:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 51A9239F1493 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mark@klomp.org Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id CA05A30278CD; Fri, 5 Feb 2021 14:09:20 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 87F5F4000D37; Fri, 5 Feb 2021 14:09:20 +0100 (CET) Message-ID: <3b76b14ca5608a8cb0b31b34767d322aab31e7e8.camel@klomp.org> Subject: Re: [PATCH] DWZ aborted "write_types: Assertion `ref && ref->die_dup == NULL'" From: Mark Wielaard To: "Sharma, Alok Kumar" , "dwz@sourceware.org" Cc: "George, Jini Susan" , "E, Nagajyothi" , "Achra, Nitika" Date: Fri, 05 Feb 2021 14:09:20 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: dwz@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Dwz mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 13:09:23 -0000 Hi Alok, On Fri, 2021-02-05 at 06:09 +0000, Sharma, Alok Kumar via Dwz wrote: > Would you please review the attached patch containing modification of > assert condition. > It was required to fix an abort which seem to be incorrect. >=20 > There is an assert condition as "ref && ref->die_dup =3D=3D NULL". > As per definition of "struct dw_die", the structure fields starting > from 'die_dup' are present only if 'die_toplevel' is 1. In line with > this at multiple places in code, full/paritial memory is allocated for > pointer of type dw_die. > Ex. die =3D pool_alloc (dw_die, offsetof (struct dw_die, die_dup)); > Due to this, since memory is not allocated for field die_dup onwards, > it may contain junk values. Macro 'die_safe_dupe' must be used in place > of directly accessing 'die_dup' field whenever required. >=20 > * dwz.c (write_types): Use 'die_safe_dup' to access field 'die_dup'= . I think you analysis and the code fix are correct. Thanks. This was probably missed before because -fdebug-types-section isn't the default, so we are not seeing many DWARF files with debug types. Do you have an example where this triggers? Thanks, Mark