From patchwork Thu Sep 7 13:34:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75431 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AB9D93858D20 for ; Thu, 7 Sep 2023 13:34:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB9D93858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694093695; bh=D/9UEBZpIysd4TKXPB49d4S26nSAdU5Qz5BrK/3URFc=; h=To:Subject:References:CC:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=cKjxU4gdRbewvIY9efqON3l7otatoJgImBvYZ5qiCr3yDIplRGtFLV9cP0yuCFsbc Kj6D5kgYwTEYalwlwKlb7HzH/177QznJ7S3I1pl7ld5tHzgc2qwertm0BCYmLNjeHv 4V0feL36S1PQxL8U50PUS8fFBLdoX29SAoOCQp0c= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 5C9BD3858D20 for ; Thu, 7 Sep 2023 13:34:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C9BD3858D20 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-470-GmlFWHwDPDKeQOvPbsplBQ-1; Thu, 07 Sep 2023 09:34:46 -0400 X-MC-Unique: GmlFWHwDPDKeQOvPbsplBQ-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-76ef8b91a84so73302385a.0 for ; Thu, 07 Sep 2023 06:34:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694093685; x=1694698485; h=mime-version:user-agent:message-id:in-reply-to:date:cc:references :organization:subject:to:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=D/9UEBZpIysd4TKXPB49d4S26nSAdU5Qz5BrK/3URFc=; b=LA6aKPcVOw91H6rAAg5MHdcMWc9XwdBUCvgUFHhEGb/abtQ05uq40Ekk+4U4NdqglM 4MSo/FrrpsuOfOkI7L5qoQx1PMFu9bRbHVvkRowbnqm8Y5UfjcYfDvoz0tp1UebjfMzH A44ASVbblJgfchSRuVPo1RbQ98eS4PnEwGqvkeXvDdfQkaSCI0MJWBBmMys5SK4c1ocr q4Gl+TeTHFew0BicO+OmOvN05+M07lM0LcaF5adHqvGNVT+JpFdjciTFErvgEq1u96sR fH2L+aYJED22u/2k/n5Ipj6YPRuvmhYPrGm5cAdq1OsMuV9aMR06P/9z5/zmdtp+EvAj IDhg== X-Gm-Message-State: AOJu0Yx7frOmiRt7Q4POhNMJKJdpBy9Uer47BK+PWQITZ9EnqCZjr5L+ ryfdTVN+XW2w5ssaYY8CZE7uL1Iz+/55psP848k7Iqfqxa/iJigkJeqeUIMTb+RqUoTCUHlVUy+ wFkMuPDatvvjoWSm+2JZSRo0qCpOM X-Received: by 2002:a05:620a:29c3:b0:76c:e83d:2fb9 with SMTP id s3-20020a05620a29c300b0076ce83d2fb9mr3986977qkp.12.1694093685726; Thu, 07 Sep 2023 06:34:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFShelwRcTV3gc9irQV1BI0qJ9vL/ghemhBAG5mu0Kf1Y6W+v4kgbQZwQDeH9Nrc72Nz9khTQ== X-Received: by 2002:a05:620a:29c3:b0:76c:e83d:2fb9 with SMTP id s3-20020a05620a29c300b0076ce83d2fb9mr3986964qkp.12.1694093685532; Thu, 07 Sep 2023 06:34:45 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id n13-20020a0ce48d000000b00647290bd591sm6373503qvl.121.2023.09.07.06.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:34:45 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 818D0B4FD2; Thu, 7 Sep 2023 15:34:42 +0200 (CEST) To: libabigail@sourceware.org Subject: [PATCH 01/16] reader: fix indentation Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> CC: dodji@redhat.com X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 15:34:42 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <87edjagl8t.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H3, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, * src/abg-reader.cc (build_function_type): Fix indentation. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-reader.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/abg-reader.cc b/src/abg-reader.cc index 8e9c5b3a..520d158a 100644 --- a/src/abg-reader.cc +++ b/src/abg-reader.cc @@ -4214,16 +4214,16 @@ build_function_type(reader& rdr, { method_class_type = is_class_or_union_type(rdr.build_or_get_type_decl(method_class_id, - /*add_decl_to_scope=*/true)); + /*add_decl_to_scope=*/true)); ABG_ASSERT(method_class_type); } - function_type_sptr fn_type(is_method_t - ? new method_type(method_class_type, - /*is_const=*/false, - size, align) - : new function_type(return_type, - parms, size, align)); + function_type_sptr fn_type(is_method_t + ? new method_type(method_class_type, + /*is_const=*/false, + size, align) + : new function_type(return_type, + parms, size, align)); rdr.get_translation_unit()->bind_function_type_life_time(fn_type); rdr.key_type_decl(fn_type, id); From patchwork Thu Sep 7 13:35:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75432 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B77E03858C39 for ; Thu, 7 Sep 2023 13:35:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B77E03858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694093740; bh=G15N2Sr6x8GNUSpNFemEZ/DO1QpNpJGof/munCWDPCc=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=aLGCKDr5SozqdFqveBNJNAjN8Lk1BtSd243VNC7BOSMqt3Ag8f6jufSjS+3kHV9v9 IhmcPpdf1K693hw8C5ZGF7OeIy2UP7arAIF0O71t0ynCuhW+jug1X4YwCpjUfGpLdv IbTPQciMFutvO0847PF1nxdjmSUdBeyh5DFnRno4= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 2D4623858D1E for ; Thu, 7 Sep 2023 13:35:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2D4623858D1E Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-304-rkBoT-VjOceqMuqUG32PrA-1; Thu, 07 Sep 2023 09:35:33 -0400 X-MC-Unique: rkBoT-VjOceqMuqUG32PrA-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-76e015eb1c9so98415185a.3 for ; Thu, 07 Sep 2023 06:35:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694093733; x=1694698533; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G15N2Sr6x8GNUSpNFemEZ/DO1QpNpJGof/munCWDPCc=; b=WxisZv4kbDxtBUy5jiTpMxhNoUz0kK1KgmI6NiUXYsBw9zFLks2rWVe1qYJdhtn3ir XzdRJ5r9Ng2T/j26DncCipJlxz1xFr35tN5yOnibcwqLmV2zovaAYyXWMF1zPmuuqMuT qYGM1XdAF2I2dPzPEQSfKqC958jIRUix3f2jjJ6/aYkQEjSKVlmXdpCpEvRfdQ25fabH Pb5Qj7v/nH0qbNFYE9Fh8jdLgQKY57sDMUT1Df3ritcUOYWmWp+Au/Bs/zlC6tkY2SEW i5At8hqJXrSGfcEiFgHL2ZrPPcsYKLZY/P5FeO4bhj1/JWfU+ZgHwIdTgYYYOSvz5uSA Dbbw== X-Gm-Message-State: AOJu0Yzqe3nm8wbukODiVYAUtJVkv98mphN5uJFfqtNDr2KQN2O/1BDD d1OWq1AvirP1mMsI41debO9X52z2GV+/Yak95iWOucl4jO25cETBO6Ovhk8NVRSM84i5gViaic1 S87WPYYNkGxwx7ZwF8DSB X-Received: by 2002:a05:622a:48:b0:410:89e7:ef0b with SMTP id y8-20020a05622a004800b0041089e7ef0bmr24604601qtw.14.1694093733434; Thu, 07 Sep 2023 06:35:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgnZXpePtuIh/rQ1pXmaZ3P1E+ZUvsQUZlMabaEnvkAG5nlTjKoIivCjdJRABXY0NLNdvW8A== X-Received: by 2002:a05:622a:48:b0:410:89e7:ef0b with SMTP id y8-20020a05622a004800b0041089e7ef0bmr24604592qtw.14.1694093733250; Thu, 07 Sep 2023 06:35:33 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id o6-20020ac841c6000000b004052f71f79bsm6191349qtm.74.2023.09.07.06.35.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:35:32 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 6DF5EB4FD2; Thu, 7 Sep 2023 15:35:30 +0200 (CEST) To: Dodji Seketeli Cc: libabigail@sourceware.org Subject: [PATCH 02/16] tools-utils: Fix indentation Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 15:35:30 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <87a5tygl7h.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H3, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, * src/abg-tools-utils.cc (string_suffix): Fix indentation. Signed-off-by: Dodji Seketeli --- src/abg-tools-utils.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc index 5287c99e..2ea6f8b4 100644 --- a/src/abg-tools-utils.cc +++ b/src/abg-tools-utils.cc @@ -1067,9 +1067,9 @@ split_string(const string& input_string, /// @return true iff the function could find a prefix for the suffix /// @p suffix in the input string @p input_string. bool -string_suffix(const string& input_string, - const string& prefix, - string& suffix) +string_suffix(const string& input_string, + const string& prefix, + string& suffix) { // Some basic sanity check before we start hostilities. if (prefix.length() >= input_string.length()) From patchwork Thu Sep 7 13:38:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75433 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AA2F8385841D for ; Thu, 7 Sep 2023 13:38:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA2F8385841D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694093908; bh=H3SqgErs8XXxyslC9uCmdkg4iHa8uzRJAbAP4NodK0w=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=IksE4H5Sw1hkn0M312an1f25JgQqL5YhBMj7xioAX9EgNBVnrtDgc2AFt2IVdM+Pd yzYGXogscS/fjXXS8i72tMIq35zLKrsKqHyph7bMMwq2gQMjMz5ouyjcf42EQ+xRUn +UiZh8XqKpHMWkuRDhixEDHsR3fHyEkwyQACIZ0s= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 0A3B73858D1E for ; Thu, 7 Sep 2023 13:38:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A3B73858D1E Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-651-rHezVlSSPp299DYObq4_oA-1; Thu, 07 Sep 2023 09:38:20 -0400 X-MC-Unique: rHezVlSSPp299DYObq4_oA-1 Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-3a78c2cdd77so1020581b6e.1 for ; Thu, 07 Sep 2023 06:38:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694093899; x=1694698699; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H3SqgErs8XXxyslC9uCmdkg4iHa8uzRJAbAP4NodK0w=; b=WEVdPQ+Ap8CJPoDkbn5hSRvOn/ZsHL7Q6LKbtJp1F4qkLBOWYKcbc/HyUuJ1ZvQgNA YppaTMRJNBC5agkhoj4EyI5HatvgzAkcP+ywd4trb+/H3xj9+FuRPn/2ABD+UonBuAQa ovuBibLgDTzqVPAowHuGSE+KBUvwmAa9NhmaCQVmUoqzdojNj9AABUVaSqIeU28ZuoY6 N1+btqIYnaaCre9heJqj54O75FtBBprz0M9BsD5/adOOczhG3cPzqaH20Qxmud2F0nF5 XOZfWSkn/BAiOvJ66H0BSyOL2jkNZYO3dOOHhM7YPm0Ls+GKu+7dtjQuNlOjVOw4E2ed rWXQ== X-Gm-Message-State: AOJu0YwuJPkzXsu8Hx5FP6YlZeKCEpINClrrfcWkSej6rDGXNa4YdLdg Kzoc4izbKleLFl2Dk7/WftWJ8vQfaBk8e+q5Fx3BACov+vk3C+IolNMglRBrH0sQl35K7d53h4/ zXMfeFfByWULoJHmfZkVY X-Received: by 2002:aca:1c0c:0:b0:3a3:f92c:3f38 with SMTP id c12-20020aca1c0c000000b003a3f92c3f38mr20293602oic.6.1694093899451; Thu, 07 Sep 2023 06:38:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IECbjTh7qXHuIyPb3vB+Q8nd/Y34gRcqyhu4G/uJz4/Khj89Y1jN8+w76nqSsF130L87DuNPQ== X-Received: by 2002:aca:1c0c:0:b0:3a3:f92c:3f38 with SMTP id c12-20020aca1c0c000000b003a3f92c3f38mr20293590oic.6.1694093899118; Thu, 07 Sep 2023 06:38:19 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id p8-20020a05620a132800b00767177a5bebsm5741652qkj.56.2023.09.07.06.38.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:38:18 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id B3AC3B4FD2; Thu, 7 Sep 2023 15:38:16 +0200 (CEST) To: Dodji Seketeli Cc: libabigail@sourceware.org Subject: [PATCH 03/16] dwarf-reader,ir: Make logging a property of the middle end Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 15:38:16 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <874jk6gl2v.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.1 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_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_WEB, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, Add a "do-log" property to the abigail::ir::environment::priv. That way, we can log finer grain time stamps during type canonicalization. This is useful for debugging. * src/abg-dwarf-reader.cc (reader::read_debug_info_into_corpus): Set the do_log property on the environment from the do_log property of the reader. * src/abg-ir-priv.h (environment::priv::do_log_): New data member. (environment::priv::priv): Initialize it. (environment::priv::do_log): Define new accessor method. (canonicalize_types): Add logging. * src/abg-ir.cc (canonicalize): Add logging to time the canonicalization of each type. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-dwarf-reader.cc | 2 ++ src/abg-ir-priv.h | 21 ++++++++++++++++++--- src/abg-ir.cc | 16 ++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index c20cf16b..180c1ade 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -2154,6 +2154,8 @@ public: env().set_self_comparison_debug_input(corpus()); #endif + env().priv_->do_log(do_log()); + // Walk all the DIEs of the debug info to build a DIE -> parent map // useful for get_die_parent() to work. { diff --git a/src/abg-ir-priv.h b/src/abg-ir-priv.h index fe5a36cf..d0a0c48f 100644 --- a/src/abg-ir-priv.h +++ b/src/abg-ir-priv.h @@ -494,6 +494,7 @@ struct environment::priv bool decl_only_class_equals_definition_; bool use_enum_binary_only_equality_; bool allow_type_comparison_results_caching_; + bool do_log_; optional analyze_exported_interfaces_only_; #ifdef WITH_DEBUG_SELF_COMPARISON bool self_comparison_debug_on_; @@ -520,7 +521,8 @@ struct environment::priv do_on_the_fly_canonicalization_(true), decl_only_class_equals_definition_(false), use_enum_binary_only_equality_(true), - allow_type_comparison_results_caching_(false) + allow_type_comparison_results_caching_(false), + do_log_(false) #ifdef WITH_DEBUG_SELF_COMPARISON , self_comparison_debug_on_(false) @@ -553,6 +555,14 @@ struct environment::priv allow_type_comparison_results_caching() const {return allow_type_comparison_results_caching_;} + void + do_log(bool f) + {do_log_ = f;} + + bool + do_log() const + {return do_log_;} + /// Cache the result of comparing two sub-types. /// /// @param first the first sub-type that has been compared. Its @@ -1321,8 +1331,13 @@ canonicalize_types(const input_iterator& begin, return; // First, let's compute the canonical type of this type. - for (auto t = begin; t != end; ++t) - canonicalize(deref(t)); + for (auto t = begin, i = 0; t != end; ++t, ++i) + { + if (deref(t)->get_environment().priv_->do_log()) + std::cerr << "#" << std::dec << i << " "; + + canonicalize(deref(t)); + } #ifdef WITH_DEBUG_CT_PROPAGATION // Then now, make sure that all types -- which propagated canonical diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 999fabcb..b33d6d68 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -15039,7 +15039,23 @@ canonicalize(type_base_sptr t) if (t->get_canonical_type()) return t->get_canonical_type(); + if (t->get_environment().priv_->do_log()) + std::cerr << "Canonicalization of type '" + << t->get_pretty_representation(true, true) + << "/@#" << std::hex << t.get() << ": "; + + tools_utils::timer tmr; + + if (t->get_environment().priv_->do_log()) + tmr.start(); type_base_sptr canonical = type_base::get_canonical_type_for(t); + + if (t->get_environment().priv_->do_log()) + tmr.stop(); + + if (t->get_environment().priv_->do_log()) + std::cerr << tmr << "\n"; + maybe_adjust_canonical_type(canonical, t); t->priv_->canonical_type = canonical; From patchwork Thu Sep 7 13:39:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75438 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A9E783882671 for ; Thu, 7 Sep 2023 13:39:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A9E783882671 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694093969; bh=/PreSq+0ZUXVu/Nm0qZe8Rs6vYaSPPoBmKJHUVC/mww=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=sORW+U6UAd3e6XGnziKN+CXamquWzhgYi5U7qqbZA0kfo+S1DmE4gEkU6pdYPSciH NgiGhL/T30bzZ26fpHnaK9op0HhfMr3Qkks2S9C77/r0W03CeOyceRVich677REsWk KbLNoHpFwytOM+ux4/RzzjY/AwAs43o+/KKekQfY= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 105B43882163 for ; Thu, 7 Sep 2023 13:39:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 105B43882163 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-10-DiLv3T4YObStroS5CXU_Fg-1; Thu, 07 Sep 2023 09:39:05 -0400 X-MC-Unique: DiLv3T4YObStroS5CXU_Fg-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-76d9d16f4a1so71652585a.1 for ; Thu, 07 Sep 2023 06:39:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694093945; x=1694698745; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/PreSq+0ZUXVu/Nm0qZe8Rs6vYaSPPoBmKJHUVC/mww=; b=dHjgYMTEOCRM91mg5CUEkeyeKCYE/+1iONBqbD8I/Gaj/q6poC2633JWUomXU9sv4T oUXfw6xW5oknwzXIlhcdCQvCyWJIlfVQinsFH2cIwVHhmrJ+opMaRoYQnpLesGkgyhBw MYb04eJcb2vvswXy7DNTCsw7L6gg4v83fJjS00lBnTMtA2cOkidT79wZaelPKhHuQ15J eG2PTnf/JrzLv1PhjkELnHAbj+gp2yZ8m76DLbvf39cbaMW5hqVyp6cDwWfhTB3YMafT huoiZiGp5W6kbWWG6cQ8LtSOaN/oToQZ+9HGxnVrCov5KFU3vUGL8u3Ox3icD947Sqb0 J8kg== X-Gm-Message-State: AOJu0YzM2xDn+Rc27LWBOxqphC4sULSCB6Qr6mhaUghC6tlqojn59bFU gze/dCU4yDf0lomiUBk2SP3w1x89zr6nWGdeCjNlEpCSGmkHQAx7bv8sI+eLmbRKNs+NgcHICqR urJTRIWubv0KlDzwt6DD2 X-Received: by 2002:a05:620a:2908:b0:770:60e6:eb5b with SMTP id m8-20020a05620a290800b0077060e6eb5bmr3417396qkp.37.1694093945156; Thu, 07 Sep 2023 06:39:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEYIXBdjRPW0ejJnfDmyLSI5k9uyaGwz40QY8XW9ygv/aSa85jRSUpqbEzwZG0DdkZzQWqz7Q== X-Received: by 2002:a05:620a:2908:b0:770:60e6:eb5b with SMTP id m8-20020a05620a290800b0077060e6eb5bmr3417384qkp.37.1694093944921; Thu, 07 Sep 2023 06:39:04 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id a20-20020a05620a103400b0076cc4610d0asm5787236qkk.85.2023.09.07.06.39.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:39:04 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id D3EC0B4FD2; Thu, 7 Sep 2023 15:39:02 +0200 (CEST) To: Dodji Seketeli Cc: libabigail@sourceware.org Subject: [PATCH 04/16] dwarf-reader: Fix some logging Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 15:39:02 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <87zg1yf6h5.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H3, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, * src/abg-dwarf-reader.cc (reader::{read_debug_info_into_corpus, canonicalize_types_scheduled}): Add missing new lines and spaces. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-dwarf-reader.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index 180c1ade..6e472d3a 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -2184,7 +2184,7 @@ public: tools_utils::timer t; if (do_log()) { - cerr << "building the libabigail internal representation ..."; + cerr << "building the libabigail internal representation ...\n"; t.start(); } // And now walk all the DIEs again to build the libabigail IR. @@ -2216,8 +2216,9 @@ public: if (do_log()) { t.stop(); - cerr << " DONE@" << corpus()->get_path() - << ":" + cerr << "building the libabigail internal representation " + << "DONE for corpus << corpus()->get_path()" + << " in :" << t << "\n"; @@ -2308,9 +2309,9 @@ public: if (do_log()) { t.stop(); - cerr << "late type canonicalizing DONE@" + cerr << "late type canonicalizing DONE for " << corpus()->get_path() - << ":" + << " in :" << t << "\n"; } @@ -4595,10 +4596,10 @@ public: tools_utils::timer cn_timer; if (do_log()) { - cerr << "going to canonicalize types"; + cerr << "DWARF Reader is going to canonicalize types"; corpus_sptr c = corpus(); if (c) - cerr << " of corpus " << corpus()->get_path(); + cerr << " of corpus " << corpus()->get_path() << "\n"; cn_timer.start(); } From patchwork Thu Sep 7 13:39:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75445 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B244A3945C1C for ; Thu, 7 Sep 2023 13:40:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B244A3945C1C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694094025; bh=mAvuLUZKUk8j0pfTtNjdewOuGs2wLZm2G3hRVzptD+g=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=kKRL9EKBvO/mHDysMiPLIlszNmpzj6kYUQJJB04WqulNlokecvA7s+qJKv7SHLmpV t5jWrsxPuKz72w2ALrEj6P72Ggi9yXS7m1a4rC9fxrBaslDzoTw2SKMxE0q1dzvWjy Om0soZaRi+1LgxoL0rfkM3QZKFcEIDAlQ2KtsXS0= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 B820C38A8164 for ; Thu, 7 Sep 2023 13:39:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B820C38A8164 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-284-cP3b7CwENCepfpRz4ubEWA-1; Thu, 07 Sep 2023 09:39:46 -0400 X-MC-Unique: cP3b7CwENCepfpRz4ubEWA-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-649832c0cf3so10691826d6.0 for ; Thu, 07 Sep 2023 06:39:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694093985; x=1694698785; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mAvuLUZKUk8j0pfTtNjdewOuGs2wLZm2G3hRVzptD+g=; b=BQrnIcsZXAXLkpuZ7/4YM19cNchmOgDZuUV9Dg2Y2ESg9kNaY2ED5+CIYJuEIkSjW3 OLClClF8Bz09xPyDdS12Or4sJUn4rWuiy3Sv4p8uYvj2IIVsTDpm8ljHI9kSoPRTvXHu cnsSSnq4nPo4cqd3mJKNKDl677+V9YackXgFZfrGZXLp5n4PuZ8xsT7K3CIfYl8t9Amu XCHlx+HSpE+yaurhzlcd2j/24NiwRVJ0ExRVAX03PGk8lAVqfFEp8TXeiyyaPqgk4ZPk sMVc7SZkMhtQntOZp2P2Foge0R+csfpAzJO5NSJ7Qtdvot8jzfwKp4++Fn3hXQIsbvTy zz+g== X-Gm-Message-State: AOJu0YxhgTrhhE09m2gb8FhBgfiQjS+bTUTdviOrKKb23B9FiLbT8FZA ATCC2xvTcZgC4BoczkpMkI8q/k8KgY8K3614fVrcQIn8yl1bSbwTu0zSjgdjAyRbDt98FrJso5v L1fNJYdGII9CUnfJFEZOBm1ZIL0fj X-Received: by 2002:a0c:f508:0:b0:64f:420d:18ab with SMTP id j8-20020a0cf508000000b0064f420d18abmr16789293qvm.28.1694093985559; Thu, 07 Sep 2023 06:39:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+gcmveodqN6wHwxmoe9EmrBLVMID1yf95KsXP9EqTfC6EsuqlKYV18nIYog/NX5XJucB6AQ== X-Received: by 2002:a0c:f508:0:b0:64f:420d:18ab with SMTP id j8-20020a0cf508000000b0064f420d18abmr16789281qvm.28.1694093985329; Thu, 07 Sep 2023 06:39:45 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id u16-20020a0cf1d0000000b0063d281e22f1sm6353739qvl.17.2023.09.07.06.39.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:39:44 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 6685FB4FD2; Thu, 7 Sep 2023 15:39:43 +0200 (CEST) To: Dodji Seketeli Cc: libabigail@sourceware.org Subject: [PATCH 05/16] abipkgdiff: Initialize libxml2 to use it in a multi-thread context Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 15:39:43 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <87v8cmf6g0.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H3, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, While running some test, I stumbled upon a transient deadlock happening when using libxml2's text reader to create a reader from a buffer. After reading the documentation at https://gitlab.gnome.org/GNOME/libxml2/-/wikis/Thread-safety, I realized that users of the library need to initialize libxml2 before using it in a multi-thread setting. So this patch is providing the abigail::tools_utils::initialize() function to be called prior to using the library. This is going to be the place where to perform this kind of one-time initialization. * include/abg-tools-utils.h (initialize): Declare ... * src/abg-tools-utils.cc (initialize): ... new function. * tools/abipkgdiff.cc (main): Invoke the new abigail::tools_utils::initialize() here. Signed-off-by: Dodji Seketeli Applied to master. --- include/abg-tools-utils.h | 1 + src/abg-tools-utils.cc | 17 ++++++++++++++++- tools/abipkgdiff.cc | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/include/abg-tools-utils.h b/include/abg-tools-utils.h index 7f931c5d..ef748871 100644 --- a/include/abg-tools-utils.h +++ b/include/abg-tools-utils.h @@ -30,6 +30,7 @@ using std::string; using std::set; using std::shared_ptr; +void initialize(); const char* get_system_libdir(); const char* get_anonymous_struct_internal_name_prefix(); const char* get_anonymous_union_internal_name_prefix(); diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc index 2ea6f8b4..62a0ebb1 100644 --- a/src/abg-tools-utils.cc +++ b/src/abg-tools-utils.cc @@ -33,7 +33,8 @@ #include #include #include - +#include +#include #include #include #include @@ -76,6 +77,20 @@ using namespace abigail::ini; namespace tools_utils { +/// This function needs to be called before any libabigail function. +/// +/// Users of libabigail must call it prior to using any of the +/// functions of the library. +/// +/// It intends to initialize the underlying libraries that might need +/// initialization, especially, libxml2, in multi-threaded environments. +void +initialize() +{ + LIBXML_TEST_VERSION; + xmlInitParser(); +} + /// Get the value of $libdir variable of the autotools build /// system. This is where shared libraries are usually installed. /// diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc index 69661c5b..5ab5c22c 100644 --- a/tools/abipkgdiff.cc +++ b/tools/abipkgdiff.cc @@ -3887,6 +3887,8 @@ main(int argc, char* argv[]) | abigail::tools_utils::ABIDIFF_ERROR); } + abigail::tools_utils::initialize(); + if (opts.self_check) return compare_to_self(first_package, opts); From patchwork Thu Sep 7 13:40:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75447 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F3EEF3893653 for ; Thu, 7 Sep 2023 13:40:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F3EEF3893653 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694094032; bh=0Is6ihi1y4xvAVc3QekW5C8ogZfkm4aieT2iTYhbKk0=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=G7DuhYuJL80wLFAQbXpl0q9X6rB2LyWxo/+Kmj5tyLrhqOm8kbh+le552iCUyly0T 5YSRCm4067yLTys6d7XvTKdSNioRjQH1YP7L3ij6aYhacbgyMoAmTTRuzMLL37dZ87 A2pcfSdhe9iAXfJ3WCLAQtFzsa4PYxcJKc/0R/qw= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 797513945C1C for ; Thu, 7 Sep 2023 13:40:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 797513945C1C Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-38-gKTK3QsFOQOlZ6J4lsBFPg-1; Thu, 07 Sep 2023 09:40:24 -0400 X-MC-Unique: gKTK3QsFOQOlZ6J4lsBFPg-1 Received: by mail-ot1-f71.google.com with SMTP id 46e09a7af769-6b9d8b76be5so1073342a34.1 for ; Thu, 07 Sep 2023 06:40:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694094024; x=1694698824; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0Is6ihi1y4xvAVc3QekW5C8ogZfkm4aieT2iTYhbKk0=; b=EwxiXptDEDDgK9IqYRa7lJiTrB2/O48YPit2sIeCoI7L1dlVrp3DEfIlLUC1dEYP65 fuE1YMdrLy2KSyyZwh3n4x4fe7kmiqsg/bZ0KXM0gQOPacCha3gmU2d2Affya5sklzVT KfVw9Edp9xusdERu9yDlJ3x02p8nEDg6s+UDkFqJ38HF7az04pF34RYrYcZ0VEnSSYa3 BSNTOS3+FSijhrv3kdlrnEbiCi7c6pMzFribp8LtqvSmKI+jZYGkDUDRLLj3G2bQK49l RS3sG5wjkbJtgqchJdIMWz0NhqQeUcQblHRn4zO/pKqngzMGTy4q+nd6IveQesrSQ1PK CW1Q== X-Gm-Message-State: AOJu0Yypv8ldFhDPH0JGOg3gbYl0bnqDmh35JzICvQLcfa4+qJ3zdgku XH+7nLncPTFsAUVIyOSKZj8+7FqW96e1JhMzeKEiLxm3UBxN+t1mrByPXMNvWbamB8maLBmwU33 R4+hP5m3ItZnjcxoBvF1z X-Received: by 2002:a05:6830:1e10:b0:6bc:f5b7:77e0 with SMTP id s16-20020a0568301e1000b006bcf5b777e0mr19668731otr.31.1694094024180; Thu, 07 Sep 2023 06:40:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF54tzn0ouBzp6DcPcWhVDE78RnoRjNygXz6R1V8Do4ifySnbDOZ1IEVyQTlgkXjWS6lrreYg== X-Received: by 2002:a05:6830:1e10:b0:6bc:f5b7:77e0 with SMTP id s16-20020a0568301e1000b006bcf5b777e0mr19668724otr.31.1694094023953; Thu, 07 Sep 2023 06:40:23 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id j15-20020a0cc34f000000b00655935bca82sm2182856qvi.134.2023.09.07.06.40.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:40:23 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 1877EB4FD2; Thu, 7 Sep 2023 15:40:22 +0200 (CEST) To: Dodji Seketeli Cc: libabigail@sourceware.org Subject: [PATCH 06/16] tools-utils: Avoid endless loop Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 15:40:22 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <87r0naf6ex.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H3, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Heloo, * src/abg-tools-utils.cc (is_dir): Avoid endless loop. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-tools-utils.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc index 62a0ebb1..e7155846 100644 --- a/src/abg-tools-utils.cc +++ b/src/abg-tools-utils.cc @@ -567,10 +567,18 @@ is_dir(const string& path) if (S_ISDIR(st.st_mode)) return true; - string symlink_target_path; - if (maybe_get_symlink_target_file_path(path, symlink_target_path)) - return is_dir(symlink_target_path); + if (S_ISLNK(st.st_mode)) + { + string symlink_target_path; + if (maybe_get_symlink_target_file_path(path, symlink_target_path)) + { + if (!get_stat(path, &st)) + return false; + if (S_ISDIR(st.st_mode)) + return true; + } + } return false; } From patchwork Thu Sep 7 13:41:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75450 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C2CD8393BA7D for ; Thu, 7 Sep 2023 13:41:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2CD8393BA7D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694094076; bh=iKTPU30GEAOLnntjj8KpqSRBxbJd3br2KLjPH8XHgNA=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=g8YfiqBZoDNvQNyJaiBpL8GNaZFFvw6xoCyYCGPSuGkodeOBYCgEXYr6BWp6v6mVL QXoSa1YAkn65zqO8kwwtvQ8zvnbsEPRpJLAD/82rn6pgudlYkvpmuaaqR4c9NLT0ra vf+I55Cwr7wFAm6j2bFwlFrrdAUNfTdL1BHy+evc= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 4279A3882077 for ; Thu, 7 Sep 2023 13:41:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4279A3882077 Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-230-HEgNMELDNPWIkRcAM7BknQ-1; Thu, 07 Sep 2023 09:41:06 -0400 X-MC-Unique: HEgNMELDNPWIkRcAM7BknQ-1 Received: by mail-ot1-f69.google.com with SMTP id 46e09a7af769-6bb31a92b44so1073968a34.0 for ; Thu, 07 Sep 2023 06:41:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694094066; x=1694698866; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iKTPU30GEAOLnntjj8KpqSRBxbJd3br2KLjPH8XHgNA=; b=BGF7/DWoX8x6yTDFH17ZGZXr2ZCnGOKafHGUl8be+4HJFSrhFAxnwTElgZtQHPO0lv 77tQ1WEKp9sRcvrT8Q+y5/X6IB3prrHgoanSoNp1MNziPB2N+AFAJELeOlDUZLfp6Od1 n9ftMpJn8JPZ8MJAIp3lVTTXH4PiQh4xfoutUOBkj0why9i3YmGvEbjSYReF3rd2iNDP cs3Q0sucoz+IkNMZK3BM/vw3Bq42Vi/BVNcq6Yo84WvlKioqQ9y5ysHgEIq7hgOJ3MMY 7U+XtSxllgM/N5lU5Urkf9O3S8Zx75xdj9YHsWrbMHMB5XWtKvp8AC3QhdLW88UL6rNV f3cQ== X-Gm-Message-State: AOJu0Ywecz4oJTIPoXzxx4pESYiCOD5qPZtECW3D2ZwCBsXYnvG+DfH+ ZGdUNvPyDEs7gqyCmAdJp04tDCcr8zzPh0+qCGV64zgBkux0Bkcksjoo+z9zARQ9luacTEXEGf+ TgHgnYW3fErX8jit68RbpeL9srFmx X-Received: by 2002:a9d:7d94:0:b0:6b9:68fb:5b73 with SMTP id j20-20020a9d7d94000000b006b968fb5b73mr19456805otn.1.1694094065905; Thu, 07 Sep 2023 06:41:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXvwrCcsiLaeL+vwxJ1h1vkD3hz6FMX+nGeVVqX7f0pQMg7fCe1MNx4uh4VU+zdA8lKWJmtw== X-Received: by 2002:a9d:7d94:0:b0:6b9:68fb:5b73 with SMTP id j20-20020a9d7d94000000b006b968fb5b73mr19456796otn.1.1694094065652; Thu, 07 Sep 2023 06:41:05 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id e23-20020a0caa57000000b0064f4e0b2089sm6426380qvb.33.2023.09.07.06.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:41:05 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id A06CEB4FD2; Thu, 7 Sep 2023 15:41:03 +0200 (CEST) To: Dodji Seketeli Cc: libabigail@sourceware.org Subject: [PATCH 07/16] {dwarf,elf}reader: Don't consider no symbol table as an error Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 15:41:03 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <87msxyf6ds.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H3, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, Some binaries don't have any symbol table. Libabigail's ELF and DWARF readers error out on those binaries, making fedabipkgdiff emitting an error when performing the self-comparison of the package containing those binaries. This patch handles a binary having no symbol table almost as a binary that has an empty symbol table, making abipkgdiff and fedabipkgdiff not error out on those binaries anymore. This makes the command below succeed: $ fedabipkgdiff --self-compare -a --from fc34 glibc * src/abg-dwarf-reader.cc (reader::read_corpus): Return an empty corpus if no symbol was found. Do not crash when no symbol table is found. * src/abg-elf-reader.cc (reader::read_corpus): Consider a corpus with no symbol table as being OK. * src/abg-reader.cc (build_elf_symbol_from_reference): Do not crash when no symbol table is present. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-dwarf-reader.cc | 11 ++++++----- src/abg-elf-reader.cc | 8 ++++---- src/abg-reader.cc | 13 ++++++++----- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index 6e472d3a..2416c7f3 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -2072,12 +2072,12 @@ public: // Load the generic ELF parts of the corpus. elf::reader::read_corpus(status); - if ((status & STATUS_NO_SYMBOLS_FOUND) - || !(status & STATUS_OK)) - // Either we couldn't find ELF symbols or something went badly - // wrong. There is nothing we can do with this ELF file. Bail - // out. + if (!(status & STATUS_OK)) + { + // Something went badly wrong. There is nothing we can do + // with this ELF file. Bail out. return corpus_sptr(); + } // If we couldn't find debug info from the elf path, then say it. if (dwarf_debug_info() == nullptr) @@ -2143,6 +2143,7 @@ public: // Get out now if no debug info is found or if the symbol table is // empty. if (!dwarf_debug_info() + || !corpus()->get_symtab() || !corpus()->get_symtab()->has_symbols()) return corpus(); diff --git a/src/abg-elf-reader.cc b/src/abg-elf-reader.cc index 7884c672..f4dae766 100644 --- a/src/abg-elf-reader.cc +++ b/src/abg-elf-reader.cc @@ -978,12 +978,12 @@ reader::read_corpus(status& status) // See if we could find symbol tables. if (!symtab()) { - status |= STATUS_NO_SYMBOLS_FOUND; + status |= STATUS_NO_SYMBOLS_FOUND | STATUS_OK; // We found no ELF symbol, so we can't handle the binary. Note // that we could have found a symbol table with no defined & - // exported ELF symbols in it. That case is handled as an empty - // corpus, which is different from this case. - return corpus_sptr(); + // exported ELF symbols in it. Both cases are handled as an + // empty corpus. + return corpus(); } // Set symbols information to the corpus. diff --git a/src/abg-reader.cc b/src/abg-reader.cc index 520d158a..2b902096 100644 --- a/src/abg-reader.cc +++ b/src/abg-reader.cc @@ -3272,12 +3272,15 @@ build_elf_symbol_from_reference(reader& rdr, const xmlNodePtr node) if (name.empty()) return nil; - const elf_symbols& symbols = - rdr.corpus()->get_symtab()->lookup_symbol(name); + if (rdr.corpus()->get_symtab()) + { + const elf_symbols& symbols = + rdr.corpus()->get_symtab()->lookup_symbol(name); - for (const auto& symbol : symbols) - if (symbol->get_id_string() == sym_id) - return symbol; + for (const auto& symbol : symbols) + if (symbol->get_id_string() == sym_id) + return symbol; + } } return nil; From patchwork Thu Sep 7 13:41:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75452 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CD6DE3856DF8 for ; Thu, 7 Sep 2023 13:41:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD6DE3856DF8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694094117; bh=q6qUM05LNEsNdkagSnA20GNGP5uz9e4Tx4LrfxRN9R8=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=oK9FbAq8nFQfhq+QTXiYDfkxpR9GunY6I9dOUVBBRaurvIyHRPbhGac4WpLXk9AlZ c3osXDDc+u6UYG+67Ke4BMp6ljHteiav8kDu5+9hIMw+i+VfLl8XApkviiOshiW1rh XqDa8tDXYmSH5I1qZUMHUdxWBuhoqj4DkPzZmddk= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 1F8883858D1E for ; Thu, 7 Sep 2023 13:41:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F8883858D1E Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-412-mxEltowqNNK_hJ0W35t2-w-1; Thu, 07 Sep 2023 09:41:49 -0400 X-MC-Unique: mxEltowqNNK_hJ0W35t2-w-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-649fac91500so17351166d6.1 for ; Thu, 07 Sep 2023 06:41:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694094109; x=1694698909; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q6qUM05LNEsNdkagSnA20GNGP5uz9e4Tx4LrfxRN9R8=; b=YsFaR4PyBKdNpzKrFjUYhMAXWDVebOEvTDosMMX4uwxQtieQeAgrykiuFHPbo7Qai7 mhbc10tGisiVirK1GH8FVtzLWNmCZFHDcAek430Voh305adV4TbT5w+OnCWT/Oen3WSX dWGBF1ZEm8Gh10e6D/iorJFMNkP5Xa+CwrLsqwirWbhfOo01YxPsITI3TEhbPBcRm1fw 53wETh7DFyxPgjKGc7JhjGodXfBHlOTCSfrYniRRkUnNhnBU5XDV7M8JGtk6QuX5lbvg Bq8yH7n+boA1CoJrsrCUu9D4/ODD+kf4QkhYua64VRqtaRXd+nSYyortDvPU4fhOdeSd hIkA== X-Gm-Message-State: AOJu0YwhxXqgOHeZcEFmypwDS/JH2tubS0ZDslMCcBlJP9MpwQcx3FvM Xr14IwdafRM8AOjXYW3LdLmz84omep9qILGGluXPrQBAAZIdVCc/8GeAlBuEyzaqYbwARTDj+aA lvEWNTT3FPqJbTs2YlKO8AQmPWxAm X-Received: by 2002:a0c:f24e:0:b0:64f:3c70:349a with SMTP id z14-20020a0cf24e000000b0064f3c70349amr3703332qvl.19.1694094108714; Thu, 07 Sep 2023 06:41:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTaTJcY3cmRPkpfmld2sRQ0aqxjraC8h96J/FhMKOcg3jO8D5xmH6MDjdUgmyKi+bDdbv9AA== X-Received: by 2002:a0c:f24e:0:b0:64f:3c70:349a with SMTP id z14-20020a0cf24e000000b0064f3c70349amr3703309qvl.19.1694094108450; Thu, 07 Sep 2023 06:41:48 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id t25-20020a0cb719000000b0064f7150fadcsm6435480qvd.4.2023.09.07.06.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:41:48 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 716E3B4FD2; Thu, 7 Sep 2023 15:41:46 +0200 (CEST) To: Dodji Seketeli Cc: libabigail@sourceware.org Subject: [PATCH 08/16] abipkgdiff: Avoid comparing binaries that are outside of the package Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 15:41:46 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <87il8mf6cl.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H3, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, Some symlinks in some RPMs resolve to binaries outside of the package. In those cases, avoid considering them. * src/abg-tools-utils.cc (maybe_get_symlink_target_file_path): Do not require that the file path points to a symlink. A file path can point to a file that is not a symlink and yet the whole path can be in parent directory that is a symlink. In this case, realpath will correctly resolve to the correct target file. * tools/abipkgdiff.cc (maybe_update_package_content): A path to a binary that is not inside the RPM (because a symlink resolved to a file outside of the RPM) should not be added to the set of binaries to be analyzed. * tests/data/test-diff-pkg/symlink-dir-test1-report1.txt: Add new test file. * tests/data/test-diff-pkg-ctf/symlink-dir-test1-report1.txt: Likewise. * tests/data/Makefile.am: Add new test file to source distribution. * tests/test-diff-pkg.cc (in_out_specs): for the data/test-diff-pkg/symlink-dir-test1/dir{1,2}/symlinks test, the root dir of the package is data/test-diff-pkg/symlink-dir-test1/dir{1,2}. Use that to test that the symlinks are properly handled. Also, use the data/test-diff-pkg/symlink-dir-test1/dir{1,2}/symlinks as a root of an alternative package for which the symlinks resolve outside the package, under data/test-diff-pkg/symlink-dir-test1/dir{1,2}/targets. In this later case, the symlinked files should be ignored in the comparison. Likewise for data/test-diff-pkg-ctf/symlink-dir-test1/dir1/symlinks. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-tools-utils.cc | 3 -- tests/data/Makefile.am | 2 ++ .../symlink-dir-test1-report1.txt | 0 .../symlink-dir-test1-report1.txt | 0 tests/test-diff-pkg.cc | 32 ++++++++++++++++--- tools/abipkgdiff.cc | 25 ++++++++++++--- 6 files changed, 50 insertions(+), 12 deletions(-) create mode 100644 tests/data/test-diff-pkg-ctf/symlink-dir-test1-report1.txt create mode 100644 tests/data/test-diff-pkg/symlink-dir-test1-report1.txt diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc index e7155846..08d50347 100644 --- a/src/abg-tools-utils.cc +++ b/src/abg-tools-utils.cc @@ -723,9 +723,6 @@ maybe_get_symlink_target_file_path(const string& file_path, if (!get_stat(file_path, &st)) return false; - if (!S_ISLNK(st.st_mode)) - return false; - char *link_target_path = realpath(file_path.c_str(), NULL); if (!link_target_path) return false; diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 03361fab..b3434da5 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -2055,6 +2055,7 @@ test-diff-pkg/dirpkg-3-report-1.txt \ test-diff-pkg/dirpkg-3-report-2.txt \ test-diff-pkg/dirpkg-3.suppr \ test-diff-pkg/symlink-dir-test1-report0.txt \ +test-diff-pkg/symlink-dir-test1-report1.txt \ test-diff-pkg/symlink-dir-test1/dir1/symlinks/foo.o \ test-diff-pkg/symlink-dir-test1/dir1/symlinks/libfoo.so \ test-diff-pkg/symlink-dir-test1/dir1/targets/foo.c \ @@ -2300,6 +2301,7 @@ test-diff-pkg-ctf/cracklib-2.9.6-15-ol8u0.x86_64.rpm \ test-diff-pkg-ctf/isl-debuginfo-0.16.1-6.x86_64.rpm \ test-diff-pkg-ctf/tarpkg-1-dir1.tar.gz \ test-diff-pkg-ctf/symlink-dir-test1-report0.txt \ +test-diff-pkg-ctf/symlink-dir-test1-report1.txt \ \ test-fedabipkgdiff/dbus-glib-0.104-3.fc23.x86_64.rpm \ test-fedabipkgdiff/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm \ diff --git a/tests/data/test-diff-pkg-ctf/symlink-dir-test1-report1.txt b/tests/data/test-diff-pkg-ctf/symlink-dir-test1-report1.txt new file mode 100644 index 00000000..e69de29b diff --git a/tests/data/test-diff-pkg/symlink-dir-test1-report1.txt b/tests/data/test-diff-pkg/symlink-dir-test1-report1.txt new file mode 100644 index 00000000..e69de29b diff --git a/tests/test-diff-pkg.cc b/tests/test-diff-pkg.cc index 99dc381d..fbfa50d3 100644 --- a/tests/test-diff-pkg.cc +++ b/tests/test-diff-pkg.cc @@ -149,6 +149,18 @@ static InOutSpec in_out_specs[] = "data/test-diff-pkg/dirpkg-3-report-2.txt", "output/test-diff-pkg/dirpkg-3-report-2.txt" }, + { + "data/test-diff-pkg/symlink-dir-test1/dir1", + "data/test-diff-pkg/symlink-dir-test1/dir2", + "--no-default-suppression ", + "", + "", + "", + "", + "", + "data/test-diff-pkg/symlink-dir-test1-report0.txt", + "output/test-diff-pkg/symlink-dir-test1-report0.txt" + }, { "data/test-diff-pkg/symlink-dir-test1/dir1/symlinks", "data/test-diff-pkg/symlink-dir-test1/dir2/symlinks", @@ -158,8 +170,8 @@ static InOutSpec in_out_specs[] = "", "", "", - "data/test-diff-pkg/symlink-dir-test1-report0.txt ", - "output/test-diff-pkg/symlink-dir-test1-report0.txt " + "data/test-diff-pkg/symlink-dir-test1-report1.txt", + "output/test-diff-pkg/symlink-dir-test1-report1.txt" }, #if WITH_TAR { @@ -864,6 +876,18 @@ static InOutSpec in_out_specs[] = "data/test-diff-pkg-ctf/dirpkg-3-report-2.txt", "output/test-diff-pkg-ctf/dirpkg-3-report-2.txt" }, + { + "data/test-diff-pkg-ctf/symlink-dir-test1/dir1", + "data/test-diff-pkg-ctf/symlink-dir-test1/dir2", + "--ctf --no-default-suppression ", + "", + "", + "", + "", + "", + "data/test-diff-pkg-ctf/symlink-dir-test1-report0.txt", + "output/test-diff-pkg-ctf/symlink-dir-test1-report0.txt" + }, { "data/test-diff-pkg-ctf/symlink-dir-test1/dir1/symlinks", "data/test-diff-pkg-ctf/symlink-dir-test1/dir2/symlinks", @@ -873,8 +897,8 @@ static InOutSpec in_out_specs[] = "", "", "", - "data/test-diff-pkg-ctf/symlink-dir-test1-report0.txt ", - "output/test-diff-pkg-ctf/symlink-dir-test1-report0.txt " + "data/test-diff-pkg-ctf/symlink-dir-test1-report1.txt", + "output/test-diff-pkg-ctf/symlink-dir-test1-report1.txt" }, #if WITH_TAR { diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc index 5ab5c22c..3a601075 100644 --- a/tools/abipkgdiff.cc +++ b/tools/abipkgdiff.cc @@ -2323,14 +2323,20 @@ typedef shared_ptr self_compare_task_sptr; /// function only looks for a file name which name is the same as the /// value of this parameter. /// +/// @param parent_dir_name the name of the directory that the file +/// name denoted by @p entry should belong to. If it doesn't (because +/// it's a symlink that resolves to a file outside of that directory) +/// then the vector of paths of is not updated. +/// /// @param paths out parameter. This is the set of meaningful paths /// of the current directory tree being analyzed. These paths are /// those that are going to be involved in ABI comparison. static void -maybe_update_package_content(const FTSENT *entry, - options &opts, - const string& file_name_to_look_for, - unordered_set& paths) +maybe_update_package_content(const FTSENT* entry, + options& opts, + const string& file_name_to_look_for, + const string& parent_dir_name, + unordered_set& paths) { if (entry == NULL || (entry->fts_info != FTS_F && entry->fts_info != FTS_SL) @@ -2340,6 +2346,15 @@ maybe_update_package_content(const FTSENT *entry, string path = entry->fts_path; maybe_get_symlink_target_file_path(path, path); + string parent_dir = parent_dir_name; + maybe_get_symlink_target_file_path(parent_dir, parent_dir); + + if (!parent_dir_name.empty()) + { + string s; + if (!string_suffix(path, parent_dir, s)) + return; + } if (!file_name_to_look_for.empty()) { @@ -2391,7 +2406,7 @@ get_interesting_files_under_dir(const string dir, FTSENT *entry; unordered_set files; while ((entry = fts_read(file_hierarchy))) - maybe_update_package_content(entry, opts, file_name_to_look_for, files); + maybe_update_package_content(entry, opts, file_name_to_look_for, dir, files); for (unordered_set::const_iterator i = files.begin(); i != files.end(); From patchwork Thu Sep 7 13:42:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75453 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E96F5385483B for ; Thu, 7 Sep 2023 13:42:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E96F5385483B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694094156; bh=uqctNE8qu+kFLu7uX9mURjx8gFpdESWpdRk/eJEf2Lc=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=Lh7s/L1uGPEESbZMTYquFUWtPC7KwCfr7C0RdYM15UyI1/leWvKHTJDSWcj7pM0PC EmK4TOsDGv5BPCtufzQy/ZMZZWU8zPNTPwhzzVRm7zhuWenlvTWZ0GNxL5g3IGHxLl hILtzsNtVdOQL0aqK+mvvlxDWNiYqcsKfpWTAI8o= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 ACA6E385701C for ; Thu, 7 Sep 2023 13:42:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ACA6E385701C Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-522-9T390q2DO_C9w2qJfVy9iw-1; Thu, 07 Sep 2023 09:42:28 -0400 X-MC-Unique: 9T390q2DO_C9w2qJfVy9iw-1 Received: by mail-ot1-f70.google.com with SMTP id 46e09a7af769-6bdb30c45f6so934005a34.2 for ; Thu, 07 Sep 2023 06:42:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694094148; x=1694698948; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uqctNE8qu+kFLu7uX9mURjx8gFpdESWpdRk/eJEf2Lc=; b=lieD0momQ9DLgy7ZrWWEPHlfbbJen9o1OMkJC0vX2hk7bvcN4H2rtsYbjx4Kj6o0vt eWTejkGNHCHfYEZ5QSUp1KjDRUQi9s0t+GDb2MUP5BGzWlcWJQ9W3q77URpZmcDCYSLA hCYhOHEGuAFS6Qz9bH9AwedbFclCZs6EBh7emihs8YC0v/cIknBjXLDNgmZXjcY/GilZ jvOToMfVHgnkVL2HvEZZhG9m4J2QqmnA8waPdOBQSETKyd4YHw0HBQp92RLpLjYF++Tp BSd6OJnGmemTGdsTjW9qaqxC6VhfsenIPiB5VEE2x/jEep+fKGGSBPaRt3pB8kK015ou 5ygg== X-Gm-Message-State: AOJu0Yz1/1tnwW17sRgzLzAS/9iXDEJ7uxBYylUXX3QiJNEKcyLiY9+n KtO+wYg1p8jOWfu8irYaruKVyS3u2jrOWs4mgYy0QfsL3snPEgjZYNyI6xZ4hsC9ehtJGRFKZ1w tyiFt8rW8rxW3lkc+yrmZQsth3yLJ X-Received: by 2002:a05:6830:457:b0:6bc:952a:1032 with SMTP id d23-20020a056830045700b006bc952a1032mr20545926otc.14.1694094147995; Thu, 07 Sep 2023 06:42:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPX9sfnr+u81GJostGQyOq5RkOAnOBVuCC4vQ/e9YKJ2n3WcXhXI46MUuLu2DJ622s/36VqQ== X-Received: by 2002:a05:6830:457:b0:6bc:952a:1032 with SMTP id d23-20020a056830045700b006bc952a1032mr20545915otc.14.1694094147788; Thu, 07 Sep 2023 06:42:27 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id a27-20020a0ca99b000000b0064f50e2c551sm6418190qvb.1.2023.09.07.06.42.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 06:42:27 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id DF37AB4FD2; Thu, 7 Sep 2023 15:42:25 +0200 (CEST) To: Dodji Seketeli Cc: libabigail@sourceware.org Subject: [PATCH 09/16] ir: Add missing ABG_RETURN in the comparison engine Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 15:42:25 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <87edjaf6bi.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H3, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, During structural type comparison, we want to be able to break on the first occurrence of two sub-types comparing different. This is done by setting a breakpoint into the notify_equality_failed function that is called by the ABG_RETURN macro in the comparison functions. The problem is that I stumbled upon some code paths that are missing the ABG_RETURN macro. Fixed thus. This will help in debugging sessions. * src/abg-ir.cc (equals): In the overload for function_type, class_decl and union_decl, add a missing ABG_RETURN. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-ir.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/abg-ir.cc b/src/abg-ir.cc index b33d6d68..cb230082 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -20257,8 +20257,8 @@ equals(const function_type& l, const function_type& r, change_kind* k) // comparing them all over again. bool cached_result = false; if (l.get_environment().priv_->is_type_comparison_cached(l, r, - cached_result)) - return cached_result; + cached_result)) + ABG_RETURN(cached_result); } mark_types_as_being_compared(l, r); @@ -24251,7 +24251,7 @@ equals(const class_decl& l, const class_decl& r, change_kind* k) // over again. bool result = false; if (l.get_environment().priv_->is_type_comparison_cached(l, r, result)) - return result; + ABG_RETURN(result); } // if one of the classes is declaration-only then we take a fast @@ -25438,7 +25438,7 @@ equals(const union_decl& l, const union_decl& r, change_kind* k) // over again. bool result = false; if (l.get_environment().priv_->is_type_comparison_cached(l, r, result)) - return result; + ABG_RETURN(result); } bool result = equals(static_cast(l), From patchwork Thu Sep 7 14:02:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75454 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 31E073858D37 for ; Thu, 7 Sep 2023 14:02:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 31E073858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694095378; bh=uVc9SvzOFeBrtxCcuvGlUtDUwIS7vYZMT7wRTzggqsg=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=mitS9Q5bBq/S8L4ZHTM57BAaURcLlje2viaoV97u/7nBdpwUVybeBwLYktD8HaX4h eJaNZX5GfrKsaVh9zP/aWjtKXlbD+mQVev2u/Wz6hiXNApYP7pOhApOCCOUaz5RJ0s XkRbYhfzlUlixWAu+CjNDzKTvjU5ykyzWSmzx7Sk= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 6E2A63858D1E for ; Thu, 7 Sep 2023 14:02:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6E2A63858D1E Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-206-9Q1Ac9KePbqqWO9gw1jYWw-1; Thu, 07 Sep 2023 10:02:49 -0400 X-MC-Unique: 9Q1Ac9KePbqqWO9gw1jYWw-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-40ff67467c9so12008271cf.2 for ; Thu, 07 Sep 2023 07:02:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694095368; x=1694700168; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uVc9SvzOFeBrtxCcuvGlUtDUwIS7vYZMT7wRTzggqsg=; b=mF9RKey03lyYfGK1bGmnqrHn3MKUPt4ZuAyYyvyDek90ZTGBMaTxI1XYCileoOxXyG HQAOiocLtQY+Cyk+2QdgyhjN68iVSR2QV8/3maIaOFLvQBHKpcMo+ewHP3MnSONh7Hz4 bCaatIp49eF7Z9IcMZN1JFlVXm/EbS/6VUzlMTPUcyuOU81uzo1G9IJ0FgeHEg5t/q83 KM7HED0yzrCoYR4lSysq2PKwU5aZiYwRSy+JoHB8FHGXU9VIP2O/nwUxVJTgsxkaTqe+ +NRYlPKpVJx7r9whcR89FlJL35kkUylYK2h9zjEU8NVxmS7DdwGDZfqORWgvjTzWwVdL tM2Q== X-Gm-Message-State: AOJu0YwpsCB5O6/Gjj3v9TtQiQyeKrcvRKzF8UKgL5jdcbLmgtd2R4xC 9O1Wp/yYe/EsKnwT1NOYn6uG0M2XRl9y9he3BMjXGho945xjcpfW6OmtUJJOx1N3gwzVkfuUnRD KOsEMkmuKP1V2oPkg3G848TX8Gjay X-Received: by 2002:a05:622a:1346:b0:412:2513:fb6 with SMTP id w6-20020a05622a134600b0041225130fb6mr24712597qtk.5.1694095368326; Thu, 07 Sep 2023 07:02:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZQFG/PE2RJClkm+qfDc31UIm+3JhpUfRhA2RFNliI8ZYbyj5p9OmcverT+SYuOggDcvJbqw== X-Received: by 2002:a05:622a:1346:b0:412:2513:fb6 with SMTP id w6-20020a05622a134600b0041225130fb6mr24712537qtk.5.1694095367628; Thu, 07 Sep 2023 07:02:47 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id b3-20020ac844c3000000b00410929fe3b9sm6208421qto.58.2023.09.07.07.02.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 07:02:46 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id B2C35B4FD2; Thu, 7 Sep 2023 16:02:44 +0200 (CEST) To: Dodji Seketeli Cc: libabigail@sourceware.org Subject: [PATCH 10/16] ir: Add fn types to type lookup maps Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 16:02:44 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <87a5tyf5dn.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H3, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, This is a fix to an inconsistency I stumbled upon while looking at something else. So, function types were not being added to the type lookup maps. Fixed this. * src/abg-ir.cc (maybe_update_types_lookup_map): Handle function types. (translation_unit::bind_function_type_life_time): Update types lookup map. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-ir.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/abg-ir.cc b/src/abg-ir.cc index cb230082..93d79b33 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -1479,6 +1479,8 @@ translation_unit::bind_function_type_life_time(function_type_sptr ftype) const ABG_ASSERT(existing_tu == this); else ftype->set_translation_unit(const_cast(this)); + + maybe_update_types_lookup_map(ftype); } /// This implements the ir_traversable_base::traverse virtual @@ -14198,6 +14200,8 @@ maybe_update_types_lookup_map(const decl_base_sptr& decl) maybe_update_types_lookup_map(array_type); else if (array_type_def::subrange_sptr subrange_type = is_subrange_type(decl)) maybe_update_types_lookup_map(subrange_type); + else if (function_type_sptr fn_type = is_function_type(decl)) + maybe_update_types_lookup_map(fn_type); else ABG_ASSERT_NOT_REACHED; } @@ -14218,6 +14222,8 @@ maybe_update_types_lookup_map(const type_base_sptr& type) { if (decl_base_sptr decl = get_type_declaration(type)) maybe_update_types_lookup_map(decl); + else if (function_type_sptr fn_type = is_function_type(type)) + maybe_update_types_lookup_map(fn_type); else ABG_ASSERT_NOT_REACHED; } From patchwork Thu Sep 7 14:03:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75455 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EF0BD3858C2D for ; Thu, 7 Sep 2023 14:04:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF0BD3858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694095446; bh=644UvUoAqtehP3B1oINUbXxpeP5DDj7kfC6GMIVKzm0=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=s/loxdzDFXJWVjFkPhe+3QJXd8P/V3zoPCwqaMlFrRpOBdUzv2L70gW/HRLd/66Xb MGRPV3InwqipL0eGP+yiOOO2uoq/aWeceGUwBgdZAw2bkE6vsexkM9oLqcLBdR9izy bULBIB1A/LFcaEjat9oBDN5u6JEI3Vfrqo2dbKfw= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 63B433858D1E for ; Thu, 7 Sep 2023 14:03:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 63B433858D1E Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-45-Ab-5M4JPNlOpdO8DCiPaKQ-1; Thu, 07 Sep 2023 10:03:57 -0400 X-MC-Unique: Ab-5M4JPNlOpdO8DCiPaKQ-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-649b66c99b7so11482846d6.2 for ; Thu, 07 Sep 2023 07:03:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694095436; x=1694700236; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=644UvUoAqtehP3B1oINUbXxpeP5DDj7kfC6GMIVKzm0=; b=Z57aAvi5NFiqLt1HeQkOmD8mT+TzWudjXkU5OlYRFdMUQe1ixJLDKv86orKciou5Xm o4f+j3Zhwk1q3L81wvhF3ri5IbjGNJnj0KSpdxzjjmeduaKgcyWD4dZCP/JoOG9idbKQ myG4FHtFdQ9DyKw0F2tdTGUAU+6S/GXWtmW7R/aJnYVIhN2/rX9O+RTE21+2vkjfFctI TkQBZVsO3kuq5jgC4F4We0h8VIHWYmiML2gdd6ZrExQDF15boyHp5J1jaUZA185DKh+2 HvEZosdypCKczWDj0waHhY6CmuJRRAMJKdplO6Py5JqJzJTC+EoZ6p5LFlOuD+EoWOQC 50vg== X-Gm-Message-State: AOJu0Yx/MSRhchnMRr368PVHLAdtXX6X1ty+tfcBsvuTYJhk7AcJViWD FLdluPwMkX7bIaDjDrUkJ8sc4x/uDOUUmdky763MeYd1KG2j+T+XusfamYbkN/YrnYc2WDLzszg mNcASPE/3sA6lpZlvnHdQyZXY9FGR X-Received: by 2002:a05:622a:196:b0:413:5f84:4246 with SMTP id s22-20020a05622a019600b004135f844246mr23735482qtw.10.1694095436439; Thu, 07 Sep 2023 07:03:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF+rjcbWYNvnecVp3NY7NLOjOlLUZK1HAsRkQPXQDbqo/+gvwkBChnKpT+NvcRnQlh8r/NXBw== X-Received: by 2002:a05:622a:196:b0:413:5f84:4246 with SMTP id s22-20020a05622a019600b004135f844246mr23735417qtw.10.1694095435595; Thu, 07 Sep 2023 07:03:55 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id fp17-20020a05622a509100b0041087c90049sm6203246qtb.52.2023.09.07.07.03.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 07:03:54 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 43A92B4FD2; Thu, 7 Sep 2023 16:03:53 +0200 (CEST) To: Dodji Seketeli Cc: libabigail@sourceware.org Subject: [PATCH 11/16] ir: Fix forgetting canonicalizing some function types Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 16:03:53 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <875y4mf5bq.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H4, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, It appears some function types are not canonicalized. Fixed thus. * src/abg-ir.cc (maybe_adjust_canonical_type): Once a missing member function has been copied from it's destination to the freshly canonicalized type, make sure the type of the member function is canonicalized as well. (copy_member_function): Bind the lifetime of the new function type to the lifetime of the current translation unit. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-ir.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 93d79b33..2bbb1a49 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -15006,7 +15006,11 @@ maybe_adjust_canonical_type(const type_base_sptr& canonical, // class doesn't have that member function. Let's // copy that member function to the canonical class // then. - copy_member_function (canonical_class, *i); + { + method_decl_sptr method = + copy_member_function (canonical_class, *i); + canonicalize(method->get_type()); + } } } } @@ -22873,7 +22877,7 @@ copy_member_function(const class_or_union_sptr& t, const method_decl* method) old_type->get_is_const(), old_type->get_size_in_bits(), old_type->get_alignment_in_bits())); - keep_type_alive(new_type); + t->get_translation_unit()->bind_function_type_life_time(new_type); method_decl_sptr new_method(new method_decl(method->get_name(), From patchwork Thu Sep 7 14:05:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75456 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D2BEF3858C2B for ; Thu, 7 Sep 2023 14:05:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2BEF3858C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694095532; bh=3uFJtZ5dl3r3CVXoy6syES+qcsStZE2umbEdwfV5zkg=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=vpescVbRFmVw09jKo28FzlnlOUvP2i7/LUr2lT7xCPApt8zFiN/6oja/5nqBF6zEX vVzXl+tDrKtjT88oZLLHOfVWYQC6EVQTD9ZVEMZ3FLUtZnJeSOD06faQToBSfl6pNT zXPXyDtDf+6bomOaZqR+Xr4TiFNy/Zg8RA2lhRlQ= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id CAB873858D1E for ; Thu, 7 Sep 2023 14:05:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CAB873858D1E Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-261-mNuMh6esOA2bHgQHq1gBXg-1; Thu, 07 Sep 2023 10:05:15 -0400 X-MC-Unique: mNuMh6esOA2bHgQHq1gBXg-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-41272f89564so11463891cf.3 for ; Thu, 07 Sep 2023 07:05:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694095512; x=1694700312; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3uFJtZ5dl3r3CVXoy6syES+qcsStZE2umbEdwfV5zkg=; b=ZyS/S/+gq3nVK+LIDdF6+Y199M96VlSBebYcnPdBgI+XtzfHDITZIF1lpbhMo0P/Kv OViVxH1ODlUkaO2PWhy3kaiyT0W5hNQFSkvWSTxHr7qtlzbfJQ5KWwi5FzgV4okJAwoR Xs/hXjwJ3XvtTt9Y2sYWbrwRQFCo3BEJScdu7iODaPKn2ycSa++cDroJZGWh26KMLP5w OLHhtoOEsHM9drbVaRGKhpEajiG4UKND6OoTgsjR2zRhsVcuxKR4oSNbh3aS2b1CDVKU WxbQMQF9CndgOQzKOrFcrMC1SFU1UgIO0IpsX5H483CPIkbe+BPC1wlCjyD2sKWJvGK+ O1DA== X-Gm-Message-State: AOJu0YxFjTURlUf5t8AybrmfM0aQC5n+10EV1sPHe3j6ebjFWbyodcDM nDCnEetJl/1IUPkpL6O23aqwC35MhVkPZTUJMNGiwY5oH1nI/0EgrnFh/hSPm5SeE9cvCa7nYNW IfPZDAJdnS26SIu/yubCdmJBknIxE X-Received: by 2002:ac8:7f45:0:b0:411:fca1:76d with SMTP id g5-20020ac87f45000000b00411fca1076dmr21067135qtk.50.1694095510425; Thu, 07 Sep 2023 07:05:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFnFP17Gg/yn/qwxnCdwfdGyjHRxyKl1Z2iZDxurO1ZKxUCtA45Riir+2RlAUT0F++6sFNcPQ== X-Received: by 2002:ac8:7f45:0:b0:411:fca1:76d with SMTP id g5-20020ac87f45000000b00411fca1076dmr21067056qtk.50.1694095509432; Thu, 07 Sep 2023 07:05:09 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id ay22-20020a05622a229600b003eabcc29132sm6169285qtb.29.2023.09.07.07.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 07:05:08 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 5D74EB4FD2; Thu, 7 Sep 2023 16:05:06 +0200 (CEST) To: Dodji Seketeli Cc: libabigail@sourceware.org Subject: [PATCH 12/16] ir: Avoid forgetting potential seemingly duplicated member functions Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 16:05:06 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <871qfaf59p.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H4, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, In some rare cases expressed in DWARF from C++, a member function can belong to both a declaration-only class (having no data member) in one translation unit, and to a fully defined class in another translation unit. In those cases, the two classes are represented and considered different. But then, consider a destructor which mangled name is "D1". D1 is represented in both the decl-only class and the fully-defined class. In the former case, its "this pointer" points to a decl-only class, while in the later case its "this pointer" points a fully-defined class. So, D1 coming from the former case will compare different from the D1 coming from the later case, because of the spurious difference "decl-only class" versus "fully-defined class". This is in the context of a self-comparison. One way to fix this self-comparison subtle change is to give the former D1 and the later D1 two different "function ID"s. Today, the function ID is just the mangled name, D1. This patch is defining a more involved ID which makes the difference between a member function on a decl-only class and a member function on a fully-defined class. Note that the only member functions that matter are virtual member functions because they are the only member functions that are considered when comparing two classes. This fixes the self-comparison error found on the binary gcc-gnat-12.3.1-1.fc37.x86_64/usr/libexec/gcc/x86_64-redhat-linux/12/gnat1 while running the self-comparison command below: $ fedabipkgdiff --self-compare -a --from fc37 gcc-gnat * src/abg-ir.cc (is_declaration_only_class_or_union_type): Add an overload for type_base_sptr. (function_decl::get_id): Virtual member functions that are defined on decl-only classes have a special ID to avoid confusing them with their counterparts defined on defined classes. * src/abg-reader.cc (build_function_decl) (build_function_decl_if_not_suppressed): Add a new add_to_exported_decls parameter to avoid adding the function to the set of exported decls to early. For the function to be properly added to the set of exported decls, all its attributes must be set, including virtualness. In some case, those attributes are not yet known by the end of the call to build_function_decl. The caller must then set those properties and then add the function to the set of exported decls. (build_{class,union}_decl): Build the function first, then add its missing properties and *then* add it to the set of exported decls. (handle_function_decl): Adjust. * tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi: Adjust. Signed-off-by: Dodji Seketeli --- src/abg-ir.cc | 31 +++++++ src/abg-reader.cc | 42 +++++++--- .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 82 +++++++++---------- 3 files changed, 102 insertions(+), 53 deletions(-) diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 2bbb1a49..a1033c75 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -10564,6 +10564,21 @@ is_declaration_only_class_or_union_type(const type_base *t, return false; } + +/// Test wheter a type is a declaration-only class. +/// +/// @param t the type to considier. +/// +/// @param look_through_decl_only if true, then look through the +/// decl-only class to see if it actually has a class definition in +/// the same ABI corpus. +/// +/// @return true iff @p t is a declaration-only class. +bool +is_declaration_only_class_or_union_type(const type_base_sptr& t, + bool look_through_decl_only) +{return is_declaration_only_class_or_union_type(t.get(), look_through_decl_only);} + /// Test wheter a type is a declaration-only class. /// /// @param t the type to considier. @@ -21366,6 +21381,19 @@ function_decl::get_id() const const environment& env = get_type()->get_environment(); if (elf_symbol_sptr s = get_symbol()) { + string virtual_member_suffix; + if (is_member_function(this)) + { + method_decl* m = is_method_decl(this); + ABG_ASSERT(m); + if (get_member_function_is_virtual(m)) + { + if (is_declaration_only_class_or_union_type + (m->get_type()->get_class_type(), + /*look_through_decl_only=*/true)) + virtual_member_suffix += "/o"; + } + } if (s->has_aliases()) // The symbol has several aliases, so let's use a scheme // that allows all aliased functions to have different @@ -21374,6 +21402,9 @@ function_decl::get_id() const else // Let's use the full symbol name with its version as ID. priv_->id_ = env.intern(s->get_id_string()); + + if (!virtual_member_suffix.empty()) + priv_->id_ = env.intern(priv_->id_ + virtual_member_suffix); } else if (!get_linkage_name().empty()) priv_->id_= env.intern(get_linkage_name()); diff --git a/src/abg-reader.cc b/src/abg-reader.cc index 2b902096..993b6266 100644 --- a/src/abg-reader.cc +++ b/src/abg-reader.cc @@ -1397,11 +1397,11 @@ build_function_parameter (reader&, const xmlNodePtr); static function_decl_sptr build_function_decl(reader&, const xmlNodePtr, - class_or_union_sptr, bool); + class_or_union_sptr, bool, bool); static function_decl_sptr build_function_decl_if_not_suppressed(reader&, const xmlNodePtr, - class_or_union_sptr, bool); + class_or_union_sptr, bool, bool); static bool function_is_suppressed(const reader& rdr, @@ -3440,16 +3440,21 @@ build_function_parameter(reader& rdr, const xmlNodePtr node) /// shared_ptr that is returned is then really a /// shared_ptr. /// -/// @param add_to_current_scope if set to yes, the resulting of +/// @param add_to_current_scope if set to yes, the result of /// this function is added to its current scope. /// +/// @param add_to_exported_decls if set to yes, the resulting of this +/// function is added to the set of decls exported by the current +/// corpus being built. +/// /// @return a pointer to a newly created function_decl upon successful /// completion, a null pointer otherwise. static function_decl_sptr -build_function_decl(reader& rdr, +build_function_decl(reader& rdr, const xmlNodePtr node, class_or_union_sptr as_method_decl, - bool add_to_current_scope) + bool add_to_current_scope, + bool add_to_exported_decls) { function_decl_sptr nil; @@ -3555,7 +3560,8 @@ build_function_decl(reader& rdr, rdr.maybe_canonicalize_type(fn_type, !add_to_current_scope); - rdr.maybe_add_fn_to_exported_decls(fn_decl.get()); + if (add_to_exported_decls) + rdr.maybe_add_fn_to_exported_decls(fn_decl.get()); return fn_decl; } @@ -3578,6 +3584,10 @@ build_function_decl(reader& rdr, /// @param add_to_current_scope if set to yes, the resulting of /// this function is added to its current scope. /// +/// @param add_to_exported_decls if set to yes, the resulting of this +/// function is added to the set of decls exported by the current +/// corpus being built. +/// /// @return a pointer to a newly created function_decl upon successful /// completion. If the function was suppressed by a suppression /// specification then returns nil. @@ -3585,7 +3595,8 @@ static function_decl_sptr build_function_decl_if_not_suppressed(reader& rdr, const xmlNodePtr node, class_or_union_sptr as_method_decl, - bool add_to_current_scope) + bool add_to_current_scope, + bool add_to_exported_decls) { function_decl_sptr fn; @@ -3596,7 +3607,8 @@ build_function_decl_if_not_suppressed(reader& rdr, ; else fn = build_function_decl(rdr, node, as_method_decl, - add_to_current_scope); + add_to_current_scope, + add_to_exported_decls); return fn; } @@ -5148,7 +5160,8 @@ build_class_decl(reader& rdr, { if (function_decl_sptr f = build_function_decl_if_not_suppressed(rdr, p, decl, - /*add_to_cur_sc=*/true)) + /*add_to_cur_sc=*/true, + /*add_to_exported_decls=*/false)) { method_decl_sptr m = is_method_decl(f); ABG_ASSERT(m); @@ -5161,6 +5174,7 @@ build_class_decl(reader& rdr, set_member_function_is_dtor(m, is_dtor); set_member_function_is_const(m, is_const); rdr.map_xml_node_to_decl(p, m); + rdr.maybe_add_fn_to_exported_decls(f.get()); break; } } @@ -5505,7 +5519,8 @@ build_union_decl(reader& rdr, { if (function_decl_sptr f = build_function_decl_if_not_suppressed(rdr, p, decl, - /*add_to_cur_sc=*/true)) + /*add_to_cur_sc=*/true, + /*add_to_exported_decls=*/false)) { method_decl_sptr m = is_method_decl(f); ABG_ASSERT(m); @@ -5514,6 +5529,7 @@ build_union_decl(reader& rdr, set_member_function_is_ctor(m, is_ctor); set_member_function_is_dtor(m, is_dtor); set_member_function_is_const(m, is_const); + rdr.maybe_add_fn_to_exported_decls(f.get()); break; } } @@ -5626,7 +5642,8 @@ build_function_tdecl(reader& rdr, } else if (function_decl_sptr f = build_function_decl_if_not_suppressed(rdr, n, class_decl_sptr(), - /*add_to_current_scope=*/true)) + /*add_to_current_scope=*/true, + /*add_to_exported_decls=*/true)) fn_tmpl_decl->set_pattern(f); } @@ -6204,7 +6221,8 @@ handle_function_decl(reader& rdr, bool add_to_current_scope) { return build_function_decl_if_not_suppressed(rdr, node, class_decl_sptr(), - add_to_current_scope); + add_to_current_scope, + /*add_to_exported_decls=*/true); } /// Parse a 'class-decl' xml element. diff --git a/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi b/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi index 9ff6c6e4..3dfc812a 100644 --- a/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi +++ b/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi @@ -27187,7 +27187,7 @@ - + @@ -27210,7 +27210,7 @@ - + @@ -27223,7 +27223,7 @@ - + @@ -27235,7 +27235,7 @@ - + @@ -27245,7 +27245,7 @@ - + @@ -33661,7 +33661,7 @@ - + @@ -33684,7 +33684,7 @@ - + @@ -33697,7 +33697,7 @@ - + @@ -33709,7 +33709,7 @@ - + @@ -33719,7 +33719,7 @@ - + @@ -38839,7 +38839,7 @@ - + @@ -38847,7 +38847,7 @@ - + @@ -38856,7 +38856,7 @@ - + @@ -38865,7 +38865,7 @@ - + @@ -38874,14 +38874,14 @@ - + - + @@ -38889,14 +38889,14 @@ - + - + @@ -38904,14 +38904,14 @@ - + - + @@ -38920,7 +38920,7 @@ - + @@ -38928,7 +38928,7 @@ - + @@ -40375,14 +40375,14 @@ - + - + @@ -40390,14 +40390,14 @@ - + - + @@ -40520,7 +40520,7 @@ - + @@ -40528,7 +40528,7 @@ - + @@ -40537,7 +40537,7 @@ - + @@ -40546,7 +40546,7 @@ - + @@ -40555,14 +40555,14 @@ - + - + @@ -40570,14 +40570,14 @@ - + - + @@ -40585,14 +40585,14 @@ - + - + @@ -40601,7 +40601,7 @@ - + @@ -40609,7 +40609,7 @@ - + @@ -47214,7 +47214,7 @@ - + @@ -50629,7 +50629,7 @@ - + @@ -59336,7 +59336,7 @@ - + From patchwork Thu Sep 7 14:09:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75460 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 455D7385828E for ; Thu, 7 Sep 2023 14:09:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 455D7385828E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694095759; bh=SIIR+vXP8GJb2gC13PFXBISFWVnP5EAiqN5HSkLyKDs=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=Fo39tkWkgyOfGKX796rgZ+TOPlIq9s2IGlL8BogjmPKm7uhx1bU0iGCCv3LLAaAKC v5frjXV485BypccB7cY7mlkzSflNRkQ6WP+Q39/cVgRKhBK2RraY7CueakYJbiHUF2 rumVs7rFUHZNhAxWACyHnf77QKJ24nabRI2NVEzU= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id D7C9D3858D1E for ; Thu, 7 Sep 2023 14:09:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D7C9D3858D1E Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-19-V0sjblDYOCGcsQD76i9-Hg-1; Thu, 07 Sep 2023 10:09:11 -0400 X-MC-Unique: V0sjblDYOCGcsQD76i9-Hg-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-76f0b7e3879so111819385a.0 for ; Thu, 07 Sep 2023 07:09:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694095750; x=1694700550; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SIIR+vXP8GJb2gC13PFXBISFWVnP5EAiqN5HSkLyKDs=; b=ElYZZ9ne9uQjsj3dwVsOMdWjqXCR4Q+K7/6+DzWSAL4ZUIcsLPkzr5Rss0dBhHcInd +yPDlP5Bv17legApNV5PlbZsbzDnv0/D9eK0VfdaC0x+FbgWAz7Hkrq7jOv/mACaeezZ M1dTu6Xw/spnCT6xaZDvxS2zfBaLlLaqlrJzozmwUGiyBqvbxDhcAUyQqz39v8+2Fai0 X36zoeBZio1zOhCQdBGL65z9nu/OTGtKindyhhV/cV9r+KK0IEeUBtwoNuoA51ioalLe jqhwXx+ne5XZZaik5daA5D+aBjOxX/9qZ9Y2Yq0B1/VMpbLNrk/5yIKmunFXD2jPH4yB x7ew== X-Gm-Message-State: AOJu0YyQQkVtnPrntZTXvF4LnMSYsqvS3y3D5YsCrIYHaqN+B2oRAIdm BDxQ+rIciZ2NuPEhETtyftB06ChU3+4EuzB4PEZ0YTVgjs53iNOOtpcOZ75Is6JPwF455b7Mg9I SDYgEox7K4A4Rx2n4jI7kbk1/mynD X-Received: by 2002:a05:620a:468b:b0:762:4e2:847b with SMTP id bq11-20020a05620a468b00b0076204e2847bmr22804961qkb.54.1694095750199; Thu, 07 Sep 2023 07:09:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMDnYR5Ly0lYOeJTlO4MbxG+mW5uat9KqLN4lWhnDFxfVJD4qs5LtcDrjEzsCyDrGboFN7sA== X-Received: by 2002:a05:620a:468b:b0:762:4e2:847b with SMTP id bq11-20020a05620a468b00b0076204e2847bmr22804941qkb.54.1694095749967; Thu, 07 Sep 2023 07:09:09 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id m15-20020ae9e00f000000b0076f124abe4dsm5802637qkk.77.2023.09.07.07.09.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 07:09:09 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id CC0A5B4FD2; Thu, 7 Sep 2023 16:09:07 +0200 (CEST) To: Dodji Seketeli Cc: libabigail@sourceware.org Subject: [PATCH 15/16] ir: Fix qualification as non-confirmed propagated canonical types Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 16:09:07 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <87o7iedqik.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H4, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, While looking at something else, there are some types considered having "non-confirmed propagated canonical type", even though those types are not even canonical-type-propagated. This patch fixes that. That doesn't have any visible impact, but it's definitely more correct. * src/abg-ir.cc (return_comparison_result): A type that doesn't have propagated canonical type can't be considered having "non-confirmed propagated canonical type". Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-ir.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/abg-ir.cc b/src/abg-ir.cc index f318a027..e7a2d6a8 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -1041,7 +1041,10 @@ return_comparison_result(T& l, T& r, bool value, // eventually fails. env.priv_->add_to_types_with_non_confirmed_propagated_ct(is_type(&r)); } - else if (value == true && env.priv_->right_type_comp_operands_.empty()) + else if (value == true + && env.priv_->right_type_comp_operands_.empty() + && is_type(&r)->priv_->canonical_type_propagated() + && !is_type(&r)->priv_->propagated_canonical_type_confirmed()) { // The type provided in the 'r' argument is the type that is // being canonicalized; 'r' is not a mere subtype being @@ -1052,7 +1055,9 @@ return_comparison_result(T& l, T& r, bool value, // "canonical type propagation" optimization. env.priv_->confirm_ct_propagation(&r); } - else if (value == true) + else if (value == true + && is_type(&r)->priv_->canonical_type_propagated() + && !is_type(&r)->priv_->propagated_canonical_type_confirmed()) // In any other case, we are not sure if propagated types // should be confirmed yet. So let's mark them as such. env.priv_->add_to_types_with_non_confirmed_propagated_ct(is_type(&r));