From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 3815D3858D1E for ; Mon, 13 Mar 2023 17:04:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3815D3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678727055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=cpVVb45tXrQjnehkqXkwkgaOUJyVjfcu+XsKhh1IF04=; b=ZjyRzwf5JyixCBbHkgP9zu9T2uCHQVkcqNnqt4mrc46WCgNDQSMDL0C2/IPtdsKxyz5e3d r9q6LK7GAC5UfVWZDibZ/ZbzsiV4QtyLDPbjNvWL8BarGKBC43XqwW6zwG2Y31KiDBnqsF zdvAIl9YUVwY1d0hdx+MAxStovRAtv8= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-642-vXkGzoppOdGwhLM3YQBhwA-1; Mon, 13 Mar 2023 13:04:14 -0400 X-MC-Unique: vXkGzoppOdGwhLM3YQBhwA-1 Received: by mail-qt1-f199.google.com with SMTP id c11-20020ac85a8b000000b003bfdd43ac76so7148145qtc.5 for ; Mon, 13 Mar 2023 10:04:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678727054; h=mime-version:user-agent:message-id:date:organization:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cpVVb45tXrQjnehkqXkwkgaOUJyVjfcu+XsKhh1IF04=; b=2VUBvqMjPhAHSqIIt8ilBE8/9lxygfEbUcnrucyALR09I65lFrdEMrCyODexBkO2PO 1cx/z3yuZRjtZIRcj9Vh2knxift/9dyiDMDaIS3c+HbPooRE3ITMznWoivO5uTevy2lk g94SjpSV1Uj8STZ2ZCDcn45qCxX//YywoUjHkbHCG6RJylby4xsouvYLjbJkxxzTU8/E f84LsAy8E6ZPNjLXHJTk1Vl80jbuPt6OxkpLK8XbMdAL+gsCYCe1prlV6snrGzGx/SKO 437Q6GmrH8SM1p024F67Kb1WA2VnIHlUxcRWoki8ZNEdOK/AmWHBnkTwt8Y6F/2P1HC0 FcrA== X-Gm-Message-State: AO0yUKUcO5lRQ+dX2eS1Um70hOc9ShmBJ+mkKpj2xmE4WG3n/U80xxLB imRGApTBxsb8fE3upWSRk5AmYFDTvY1wH0MTBfkHKo73Y92AgzROt5xXCq8Kh/+ntued9jU75z3 bjIBrRN2CQfggrclOVRqtyybP+UHJNNKrAOZen8wpHpNJ8Lsam+92PTym1WVQ+j0EhThXhsOVSJ jD X-Received: by 2002:a05:6214:27ef:b0:5a6:9028:7b89 with SMTP id jt15-20020a05621427ef00b005a690287b89mr5603483qvb.35.1678727053844; Mon, 13 Mar 2023 10:04:13 -0700 (PDT) X-Google-Smtp-Source: AK7set9OpA/axghCyCwLZQtNmfT8sGuFud1AhjvwVLa3xRlrRJNu3/XcsTkQraebOoWF/rJyaZiQwA== X-Received: by 2002:a05:6214:27ef:b0:5a6:9028:7b89 with SMTP id jt15-20020a05621427ef00b005a690287b89mr5603444qvb.35.1678727053368; Mon, 13 Mar 2023 10:04:13 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id x22-20020a05620a0b5600b006ff8a122a1asm52638qkg.78.2023.03.13.10.04.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 10:04:13 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id F353D581C79; Mon, 13 Mar 2023 18:04:10 +0100 (CET) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH, applied] Bug 29977 - dwarf-reader: Fix canonical DIE propagation canceling Organization: Red Hat / France X-Operating-System: Fedora 38 X-URL: http://www.redhat.com Date: Mon, 13 Mar 2023 18:04:10 +0100 Message-ID: <87h6uooa5x.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello, When canceling canonical DIE propagation, we wrongly assume that the pair of DIEs being compared yield a COMPARE_RESULT_UNKNOWN result. The reality is that it can also yield a COMPARE_RESULT_DIFFERENT result, especially when we are looking at the first sub-type that compares different and that triggered the canonical DIE propagation canceling to begin with. This can be reproduced by the command: $ fedabipkgdiff --self-compare -a --from fc37 xorg-x11-server-Xvfb Fixed thus. * src/abg-dwarf-reader.cc (offset_pairs_stack_type::cancel_canonical_propagated_type): The result of comparing the canonical-propagated types being canceled is either COMPARISON_RESULT_UNKNOWN or COMPARISON_RESULT_DIFFERENT. Also, do not forget to update the cached value for the comparison of the depend types too. Signed-off-by: Dodji Seketeli --- src/abg-dwarf-reader.cc | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index 4fdd4390..113dbdcb 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -5702,12 +5702,23 @@ struct offset_pairs_stack_type } // Update the cached result. We know the comparison result // must now be different. - auto comp_result_it = rdr_.die_comparison_results_.find(p); + auto comp_result_it = rdr_.die_comparison_results_.find(dependant_type); if (comp_result_it != rdr_.die_comparison_results_.end()) - { - ABG_ASSERT(comp_result_it->second == COMPARISON_RESULT_UNKNOWN); - comp_result_it->second= COMPARISON_RESULT_DIFFERENT; - } + comp_result_it->second= COMPARISON_RESULT_DIFFERENT; + } + + // Update the cached result of the root type to cancel too. + auto comp_result_it = rdr_.die_comparison_results_.find(p); + if (comp_result_it != rdr_.die_comparison_results_.end()) + { + // At this point, the result of p is either + // COMPARISON_RESULT_UNKNOWN (if we cache comparison + // results of that kind) or COMPARISON_RESULT_DIFFERENT. + // Make sure it's the cached result is now + // COMPARISON_RESULT_DIFFERENT. + if (comp_result_it->second == COMPARISON_RESULT_UNKNOWN) + comp_result_it->second= COMPARISON_RESULT_DIFFERENT; + ABG_ASSERT(comp_result_it->second == COMPARISON_RESULT_DIFFERENT); } if (rdr_.propagated_types_.find(p) != rdr_.propagated_types_.end()) -- 2.39.2 -- Dodji