From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 65B253858C39 for ; Fri, 26 Nov 2021 13:02:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 65B253858C39 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AQCe152021770; Fri, 26 Nov 2021 13:01:58 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3cjysng3b9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Nov 2021 13:01:57 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1AQCpXXV112607; Fri, 26 Nov 2021 13:01:55 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2173.outbound.protection.outlook.com [104.47.73.173]) by userp3030.oracle.com with ESMTP id 3cep556ssk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Nov 2021 13:01:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hmT6+xe2RBX/IHzvPz+fo6kDPQzkwNWlehPN+Pl6CqnDCz3YadCDSSJKP8GeVIEGXAe941Is93l9ykY55E3/pBQQv9p2K+Dzf+jau9154obGn7KxZUr0uDt3fEEhGbzL/sw/e2iT8iBhvwT2vjjBUbRsStVquEHuKUeTA6wOorMKYDCNHtbwZoMJXw74lA9NtKTr/P1EylZuQ4yov796IJ9mRJ/rztb1xN79XQktgUyq8DuGsmJyM11Zp5zNTwG9unR6T/Wb2/OpORE/O5LW9rGrhNnNdIbKbHOWGx8DJSJILfYvzdiViVjNx6vx0cjm+IbkIy7KLpJMzVq08UTayQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dkEFtF5cdnB2pxG+ov7ACSXzUZMfxE4Tac0aH4Qqbmo=; b=iimZt3Y6QXNuYuJQ0u6ccerqaqwN98C03FDPBuEFboVxm4a34PjCHjYWM70NuhUR6rI0Tp1lZebbeYCImGDvpeV2liNvCqlF8Oaco+pBMv9JbawtT248XcWAPfdSa1Xlu/2FjcLYW7DHoeMZOoH2uTd0poa0QwhjfLDQAtmt67Im5GfVr7/9/WII6frohIPGAnoIf6Z9/2tJ4nAmM7FFxPakHPyTHLC/2KgXDMDEJ31oLLE7E6vJlbiajGvY50HiE/e/vigHLebNABcrjYG+gIIcSxjPkvGP3Gu8LOBw/sNCAMZM6rLpxqvuy1X59YUSoK15lhZmshWw22wK6yup1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) by SJ0PR10MB4542.namprd10.prod.outlook.com (2603:10b6:a03:2da::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19; Fri, 26 Nov 2021 13:01:53 +0000 Received: from BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::48bf:86b4:32e1:6574]) by BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::48bf:86b4:32e1:6574%4]) with mapi id 15.20.4713.027; Fri, 26 Nov 2021 13:01:52 +0000 From: "Jose E. Marchesi" To: Dodji Seketeli Cc: Guillermo Martinez , "Guillermo E. Martinez via Libabigail" Subject: Re: [PATCH v2] Add regression tests for ctf reading References: <20211118041625.622972-1-guillermo.e.martinez@oracle.com> <20211122213353.2456208-1-guillermo.e.martinez@oracle.com> <87ee75tsst.fsf@seketeli.org> <4678181.mFG4eHPlM4@sali> <87r1b3rwi7.fsf@seketeli.org> Date: Fri, 26 Nov 2021 14:01:39 +0100 In-Reply-To: <87r1b3rwi7.fsf@seketeli.org> (Dodji Seketeli's message of "Fri, 26 Nov 2021 12:23:28 +0100") Message-ID: <87lf1bf4uk.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SG2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::14) To BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) MIME-Version: 1.0 Received: from termi.oracle.com (141.143.193.76) by SG2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.9 via Frontend Transport; Fri, 26 Nov 2021 13:01:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4211b229-d4ac-42bc-b88a-08d9b0dceaad X-MS-TrafficTypeDiagnostic: SJ0PR10MB4542: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F8oeC5j/Csi3kpMN8wD2yn+GVC3KCiOIVXOwUt/12INgoW/Hwe6YZp/ooPRU4Uh3C17Yz6CGhgzR202gxqXkZ486TtUP4BqJtE6MdgdVqHFNK5WkpDJXOjiuCUc0FJ4X4mSOBCg4bkjWBtNF1XuYUGGc+yJ9BhpERpa/E9N4xyLFBtrR7ZEX1jpUq4VUZTpjbva0qDWEr2HfXsZMrkKl8XxQzfWLR2eTWUqHA0XFmOUONoHzC4n5w6hBsTAcl77N+1F40kYEQwgwkheH066/x44s4ANH3GIPkbtnpicpSCmrGeOt8ofSUefO65vOFRlhctW1SkH1sUUtyVQJ1HMqwOs38653h1L8kjtMrWZcguzm39ONO1YQ8nfWbT4ZBDxutENRrs17iU3yaCjxUw9nGpt10CHmWRED9MCdgWFy3knF+P/8ck9fA9RqhQiN5vFcuSPg6Z/uKLAJHs5Nvpy0g5oa+wh7V5EaKodUGVSIGf9O1PhP475IgjpRls84hv2q95eFte3rxrxrVC4DIM8C/8nWInEdF9BJVWfYFTRerrvFFE9RacDlwRadZ2MdBk+MRoKCxtl3Vo6qo81LEKtVQkoFWeC0Uve+gR8tO1nkIYkKHIhFLbFZooCwADrB+revFZLduYBs5YuZYC9DYVV/YGyKHSXshqAUt/CkRdc9lMvivxVWVWc74v+sSDnIYjIvxIZdma1bnYUDXDdheUwxjA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB2888.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(38350700002)(38100700002)(83380400001)(2616005)(6486002)(508600001)(956004)(36756003)(26005)(4326008)(6666004)(8676002)(2906002)(8936002)(316002)(52116002)(86362001)(7696005)(5660300002)(66556008)(66946007)(66476007)(186003)(6916009)(66574015)(54906003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NTU2bGZzVmtCRmZHQ1Joc1EycG5aZlVZWUFpWE5Ec3NqUFRtcEJHdGFZL2ky?= =?utf-8?B?NGYzRG83UG5zMmV3OE84ellxRTcwTXo4aFdQOTN4bkFEd0RhanM2UkVDVHBx?= =?utf-8?B?SXh3NHl6MnRHSXl1bFRLZG91RXF6bT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?utf-8?B?UENqeHB2NXBFaWdjTy8xLzlZWG5SaEY0WFJnK0RnZUtSMHpHWXZFa2VURjRN?= =?utf-8?B?eVVGYUhSLzhOK09zVmNBbGZzYjd3c1kyVkdNMWRtMitRdjdJbFpBZ2VoNmpl?= =?utf-8?B?UG54Y1FHSDQ0VkpLUkhNQWhSSDE5amRyZ3BrR0ZRLy9mQzQyMHZUOVhBZFpB?= =?utf-8?B?czhwL2RjRVoyNzRZV1EvdEVwMCtMSzc2REduMU83cENuSUdpV2YyYmV0Ky9p?= =?utf-8?B?c2NhSlprTFh6c0dGdjFvRFYwejhucVBYNzJkVkl6aHZRMlhmSHhFYzJKZFdj?= =?utf-8?Q?hmfy3ThZolJQPwg4qw68ZKyjXK5jRRWZfFcKyOw9CY=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4211b229-d4ac-42bc-b88a-08d9b0dceaad X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2888.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2021 13:01:52.8561 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dAf4IUXX4olgkVXwqv450rdZ5WwUwb8DfeTfR68cATmIGKx2k3SL7e7DTFIxLyJwv1JTHrsbogkO9V6yQcYIpZZ8eyIL6liR4hi+GYxLOkU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4542 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10179 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111260076 X-Proofpoint-GUID: NMZcfWCZOEtpG7-oUrzsZgfAEeC_8qiw X-Proofpoint-ORIG-GUID: NMZcfWCZOEtpG7-oUrzsZgfAEeC_8qiw X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Nov 2021 13:02:05 -0000 > Hello, > > [...] > > On Nov 24, 2021, at 8:36 AM, Dodji Seketeli wrote > >>> So where exactly is the CTF test disabled? > > Guillermo Martinez a =C3=A9crit: > >> I remove those test entries, so the possible problem detected using exte= rnal diff >> command in CTF is, for instance, in: test-read-common/test-PR26568-1-ctf= .o.abi, >> the first time that runtestreadctf is executed an abixml file is genera= ted: >> >> ... >> >> >> >> >> >> >> >> >> >> >> >> and this is second execution: >> ... >> >> >> >> >> >> >> >> >> >> >> >> As we can see both abixml files have *same nodes information* but the n= odes >> are in a different order, so the test should be marked as passed, howeve= r using >> the external diff command the test fails. so my question is should we re= ly in diff >> command to compare the corpus of the ELF input files (abixml files)? > > So, you see here, this is exactly why we use the diff tool IN ADDITION > to abidiff (which only look for ABI changes). > > Here, you see that two invocations of abidw is yielding possibly two > *DIFFERENT* abixml files. They are different because some struct type > definition come out in different order. > > Why? > > This is because we have two struct types that have the same (empty) name > and yet they are different. The abixml writer sorts types using their > names, somehow. So some times, one type comes first; some times, it's > the other. > > Let's look at the issue a bit deeper. > > These are anonymous struct. > > For various reasons, we need to designate types in the Libabigail > system. So every single type needs to be given a name. Even anonymous > types. > > Most of the time, in C, anonymous types are named using typedefs. E.g: > > typedef struct > { > int x; > } struct_name; > > "typedef struct_name" is the 'naming typedef' of the struct type. It's > used to name it. That's how it's designated to be later used. > > The libabigail IR has the decl_base::set_naming_typedef() function to > set naming typedefs on=20 > > If you look at the code of the dwarf reader, in the function > build_typedef_type, near the end, you'll see that it uses the > set_naming_typedef method to set the naming typedef of the underlying > anonymous class (or struct) it sees. > > Once you've done that, the struct will be represented in the abixml file > as having the name "struct_name". And your problem will be solved, I > think. > > There are other techniques used in the dwarf-reader to handle anonymous > types that are not named by a typedef. But those are super rare, > especially in C. So I hope that using naming typedef should be good > enough for a start, in practise. Hmm, we are actually using set_naming_typedef: static typedef_decl_sptr process_ctf_typedef(read_context *ctxt, corpus_sptr corp, translation_unit_sptr tunit, ctf_dict_t *ctf_dictionary, ctf_id_t ctf_type) { typedef_decl_sptr result; ctf_id_t ctf_utype =3D ctf_type_reference(ctf_dictionary, ctf_type); if (ctf_utype =3D=3D CTF_ERR) return result; const char *typedef_name =3D ctf_type_name_raw(ctf_dictionary, ctf_type); type_base_sptr utype =3D lookup_type(ctxt, corp, tunit, ctf_dictionary, ctf_utype); if (!utype) return result; result.reset(new typedef_decl(typedef_name, utype, location(), typedef_name /* mangled_name */)); /* If this typedef "names" an anonymous type, reflect this fact in the underlying type. In C enum, struct and union types can be anonymous. */ if (is_anonymous_type(utype) && (is_enum_type(utype) || is_class_or_union_type(utype))) { decl_base_sptr decl =3D is_decl(utype); ABG_ASSERT(decl); decl->set_naming_typedef(result); } return result; }