From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26887 invoked by alias); 7 Mar 2019 07:36:12 -0000 Mailing-List: contact dwz-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: dwz-owner@sourceware.org Received: (qmail 26025 invoked by uid 89); 7 Mar 2019 07:36:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1518 X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: mx1.suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Date: Tue, 01 Jan 2019 00:00:00 -0000 From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com Subject: [PATCH] [multi-file] Handle DW_FORM_ref_addr reference that points to containing unit Message-ID: <20190307073649.GA23184@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-q1/txt/msg00086.txt.bz2 [ Submitted earlier off-list ] Hi, For test-cases with DW_FORM_ref_addr attributes that point to within the CU containing the attribute, we run into the following assert in multifile mode: ... dwz: dwz.c:1984: checksum_die: Assertion ` ((!op_multifile && !rd_multifile && !fi_multifile) || cu != die_cu (ref)) && (!op_multifile || cu->cu_chunk == die_cu (ref)->cu_chunk) ' failed. ... This conservative fix detects the situation, and instead of asserting stops further processing of the DIE. OK for trunk? Thanks, - Tom [multi-file] Handle DW_FORM_ref_addr reference that points to containing unit 2019-02-05 Tom de Vries PR dwz/24170 * dwz.c (checksum_die): Handle DW_FORM_ref_addr references that points to containing unit conservatively. --- dwz.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dwz.c b/dwz.c index 4ef8657..0415630 100644 --- a/dwz.c +++ b/dwz.c @@ -1979,10 +1979,13 @@ checksum_die (DSO *dso, dw_cu_ref cu, dw_die_ref top_die, dw_die_ref die) } if (unlikely (op_multifile) && ref->die_collapsed_child) ref = ref->die_parent; - assert (((!op_multifile && !rd_multifile && !fi_multifile) - || cu != die_cu (ref)) - && (!op_multifile - || cu->cu_chunk == die_cu (ref)->cu_chunk)); + if (cu == die_cu (ref)) + { + die->die_ck_state = CK_BAD; + return 0; + } + assert (!op_multifile + || cu->cu_chunk == die_cu (ref)->cu_chunk); handled = true; break; }