From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id A2D7E3857C4A for ; Fri, 26 Nov 2021 13:37:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A2D7E3857C4A Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AQDEPga031792; Fri, 26 Nov 2021 13:37:47 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3chmyykh15-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Nov 2021 13:37:47 +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 1AQDbWs9081644; Fri, 26 Nov 2021 13:37:46 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by userp3030.oracle.com with ESMTP id 3cep55834w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Nov 2021 13:37:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e3dHOH2S28L4XtUm082NpmH9+QyIY1+JxP2sDYwjONK4ahzpH2sM8NHL+7pE4iq0vJVAhkUt34JCwhb8tYWJWwotbIP3R8+eHxS8uODHMOIw2aCkZZEDSMtOIQp1zzZh3KTO41hc3QD/uC6KZRNZhWxcj6f2DWfaXq/mSuQo/2VviTH+97YVikYbAQW8wg0iQ5mG7a8++s25jPrBYUHL8Y7LXNWzvPPJHxJBeSQCoxnwV/Zpf+Wb2ToYu7rR5pgqEJklEiZrddtxMFLKAnIXm5xz8fbwNbTz+H/LQWSqQb/olA/l4mRgL0tCT5pbG1L7/F6FJuZ+Kp+vygjZQu3QkQ== 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=cljsD73kMPx/CA3Dh2grGB3sY6kUkqR0Qt14ld8EWNc=; b=EK/fi/Wq3z5162lcfOSRy3KJ/4HuQVC3pQvKMK4nMM+36bo+z3jbt9neMUphgMJDS0w9lE8oDh8cbi+HUg5cbEIb08LKlx7wG8KnYIESL2d9ExXBJgqrEn4gR8X/M5iXDnqQmup7zt9zkZfb5wkgDbalRetMlCSqS5Gsaet8D9eVAxRmQmTmThzS+dfGEQyR6K14Bn4DVe+WQ9Mb46ZDI1ku9qxbRq7NNr5XXskwe5pNngbS64fs26Upf4AVO4o9KqcJD7zugxsjSovr2A4osMQsDkQMj3krOJ4RA0YNOIAQzZSXLP80z0I8iVZOGbCdyVdisIg4/Ygz4l9PZTT+5Q== 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 BL0PR10MB2852.namprd10.prod.outlook.com (2603:10b6:208:76::22) by MN2PR10MB3854.namprd10.prod.outlook.com (2603:10b6:208:1b9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.22; Fri, 26 Nov 2021 13:37:43 +0000 Received: from BL0PR10MB2852.namprd10.prod.outlook.com ([fe80::6927:5e6b:31ff:14bd]) by BL0PR10MB2852.namprd10.prod.outlook.com ([fe80::6927:5e6b:31ff:14bd%3]) with mapi id 15.20.4734.023; Fri, 26 Nov 2021 13:37:43 +0000 From: Guillermo Martinez To: Dodji Seketeli CC: "Guillermo E. Martinez via Libabigail" Subject: Re: [PATCH v2] Add regression tests for ctf reading Thread-Topic: [PATCH v2] Add regression tests for ctf reading Thread-Index: AQHX3+i0sxPxY2A1xE+yYqgUFCa9sqwS4vZ2gAAmMgCAAqciW4AAJXcA Date: Fri, 26 Nov 2021 13:37:43 +0000 Message-ID: <2080240.pYWs873MX4@sali> References: <20211118041625.622972-1-guillermo.e.martinez@oracle.com> <4678181.mFG4eHPlM4@sali> <87r1b3rwi7.fsf@seketeli.org> In-Reply-To: <87r1b3rwi7.fsf@seketeli.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 618a8c7e-b32c-4b5a-46c2-08d9b0e1ec8e x-ms-traffictypediagnostic: MN2PR10MB3854: 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: qhgLr8AJl+gBB9iVa6VJiqmgpWDjfBOxg2J2KoSZMidq/E4ndMKFARavxZ55gJzp09/R9KnBLUAGUEWYDjfEVilozPFwvHyM1+1ma1jlhm2e/CmtM6hOx3qbrp9CUre/TYXWNDFnwB2XxPie2S1aC18luJ/orWPFvi3BaZKH9xVx7VLUIc+C4nu/LIgsUMeWA3P16YaLUzizoIUwcYjNbdZ28oSZCmz18DZvt6xC76pq6IW3dqYDHLlfvWreM5dupJMtxq8SnvrY4kR+dRiVJA8fci0kGbkF2iZtYmfVVjirbAA7LGtYnBlczdhMSNDWrUTYJEM56f9ti6iqFCKZWL8D3xMzMUOFeGGXuzg1mLRH9CX/MfmwmRRnpChUFr0bxQXJ4qOh1zdaJWCGvEI8fqyZURQ7W1mzXH2ZNkEWjRf86OKudU9b6DE2uLBT/w7FUR57ouR5cUmeeeyc+1M0L+SAs9lX5tsQiag2wHswOcQcYDxY1JuVqHACJJTYaVPt3Q8nFGwJhLHz8d0wvka7yraqFr9GyY6Vrf5nnkOjRimpY4doAInS0mBPuYfb1e4CjVosanox+dEpSvcPlg5QBROjCQYWVbxcQWZsEG05GYvFafSfOXiCDBZnVRDXZWk+TmcbJQuFqu2R4SwSJXChspXwj1xrlbI07qp1yH2jbyr6BbujZqSFIKz94ippcmaZcJxH28k07uKhP4lHx+ZNHg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL0PR10MB2852.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(7916004)(366004)(38070700005)(186003)(86362001)(66946007)(33716001)(66446008)(64756008)(66556008)(66476007)(91956017)(76116006)(2906002)(26005)(6506007)(53546011)(6512007)(9686003)(4326008)(71200400001)(6486002)(6916009)(8676002)(316002)(122000001)(83380400001)(508600001)(38100700002)(5660300002)(8936002)(66574015); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?HV6jxsLt8gkgnf7QEAEGsZ5pj/N5tA0KCfaEQAIp8s28t8Qt3rXWrB6TVj?= =?iso-8859-1?Q?hDfHkMyUX849OjxjN9Uak4IkhoimbJeREvbz3DttRSUnTZaqzSYL0M+/f9?= =?iso-8859-1?Q?yFx1761S9vIgEk3IyqS/kNXV7SPk+oRQr2u91ZNxWCtOfT9WhpReWahJd5?= =?iso-8859-1?Q?VQR69go+907FFx+fA6IgyRrWx9jlS0CILrtXzIMfRz/CUa+1sHmgjwgkr8?= =?iso-8859-1?Q?IFXeav39QMYgsYFI2L4mpE4inCI167XoeEg0V3I/DEM3hTZPROXa4TwE76?= =?iso-8859-1?Q?a3rbneilmdFi3vXdBY8123KCeYbpluvKCm5sAgG6ZbY0kLGR63Z2wH+8kw?= =?iso-8859-1?Q?/C/RrFylfVQh8CdPAkJ3C0Qzy6g1cthVu4HRhz4kWqmvrXHzL2UVaviUAN?= =?iso-8859-1?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r3C38?= =?iso-8859-1?Q?bheav/weainf6H8JFE6Fam224BK2Dm/9r4CmK/7tGJt3rOpqDO9Eu0g5MF?= =?iso-8859-1?Q?OX6Os6cXfe7dxEQfUu0OkUjERjdH47JFjmqI6MOOAaPnl10emdf7DyvTSg?= =?iso-8859-1?Q?kjxXlp30kHQqfICMjDUqnqrVnQa3jhLyjM4A5FzU8vbzx+/NeBI0627rqh?= =?iso-8859-1?Q?8Depxid5L5M+Q4JQM7AQL97N5/Q7Do6PGCJFFvbvnmCoUxpDfBvUU3A37n?= =?iso-8859-1?Q?ZX6f0tPTg5I+Lc28aJ1uW0pt6MGw+6Rmk2869AkUeQ7qNvcpNfGRJc9WWq?= =?iso-8859-1?Q?KB8VCViWaAYvebp5gsOaFyQX3lkIMcsaBSUKL8A+Kd/iAeg07PWXGFchQB?= =?iso-8859-1?Q?ZUDH7BvooT0AaZ+a/tvIs6RBsyUfPIwHPsdc8hY31anhcRQ/s/0qu6qeiI?= =?iso-8859-1?Q?v/yfcgfXg076gpyH2b5dvDjPE=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-ID: <5AC611E61395C84BB029E71682C7E556@namprd10.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL0PR10MB2852.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 618a8c7e-b32c-4b5a-46c2-08d9b0e1ec8e X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Nov 2021 13:37:43.0484 (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: 0yCPwxBzwIKXydIkoffqeo5Bx0DSt3HfSkyzV4zkNPYnwrz4mV7wnpKOT1anaZ7ZJgRuXBD1cuqrstLITWh7PbMqGqsFO/ToMOJvRIOY8lM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB3854 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-2111260079 X-Proofpoint-ORIG-GUID: RlhD-X2XFjNAoLFBTc30CI8vwlfdgrvO X-Proofpoint-GUID: RlhD-X2XFjNAoLFBTc30CI8vwlfdgrvO X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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:37:52 -0000 On Friday, November 26, 2021 5:23:28 AM CST Dodji Seketeli wrote:=0A= > Hello,=0A= > =0A= > [...]=0A= > =0A= > On Nov 24, 2021, at 8:36 AM, Dodji Seketeli wrote=0A= > =0A= > >> So where exactly is the CTF test disabled?=0A= > =0A= > Guillermo Martinez a =E9crit:=0A= > =0A= > > I remove those test entries, so the possible problem detected using ext= ernal diff=0A= > > command in CTF is, for instance, in: test-read-common/test-PR26568-1-ct= f.o.abi,=0A= > > the first time that runtestreadctf is executed an abixml file is gener= ated:=0A= > >=0A= > > ...=0A= > > =0A= > > =0A= > > =0A= > > =0A= > > =0A= > > =0A= > > =0A= > > =0A= > > =0A= > > =0A= > >=0A= > > and this is second execution:=0A= > > ...=0A= > > =0A= > > =0A= > > =0A= > > =0A= > > =0A= > > =0A= > > =0A= > > =0A= > > =0A= > > =0A= > >=0A= > > As we can see both abixml files have *same nodes information* but the = nodes=0A= > > are in a different order, so the test should be marked as passed, howev= er using=0A= > > the external diff command the test fails. so my question is should we r= ely in diff=0A= > > command to compare the corpus of the ELF input files (abixml files)?=0A= > =0A= > So, you see here, this is exactly why we use the diff tool IN ADDITION=0A= > to abidiff (which only look for ABI changes).=0A= > =0A= > Here, you see that two invocations of abidw is yielding possibly two=0A= > *DIFFERENT* abixml files. They are different because some struct type=0A= > definition come out in different order.=0A= OK, but they represent the same ABI, because the nodes order is not=0A= relevant here .. Is that correct?=0A= =0A= > Why?=0A= > =0A= > This is because we have two struct types that have the same (empty) name= =0A= > and yet they are different. The abixml writer sorts types using their=0A= > names, somehow. So some times, one type comes first; some times, it's=0A= > the other.=0A= OK.=0A= > Let's look at the issue a bit deeper.=0A= > =0A= > These are anonymous struct.=0A= > =0A= > For various reasons, we need to designate types in the Libabigail=0A= > system. So every single type needs to be given a name. Even anonymous= =0A= > types.=0A= > =0A= > Most of the time, in C, anonymous types are named using typedefs. E.g:= =0A= > =0A= > typedef struct=0A= > {=0A= > int x;=0A= > } struct_name;=0A= > =0A= > "typedef struct_name" is the 'naming typedef' of the struct type. It's= =0A= > used to name it. That's how it's designated to be later used.=0A= > =0A= > The libabigail IR has the decl_base::set_naming_typedef() function to=0A= > set naming typedefs on =0A= > =0A= > If you look at the code of the dwarf reader, in the function=0A= > build_typedef_type, near the end, you'll see that it uses the=0A= > set_naming_typedef method to set the naming typedef of the underlying=0A= > anonymous class (or struct) it sees.=0A= > =0A= > Once you've done that, the struct will be represented in the abixml file= =0A= > as having the name "struct_name". And your problem will be solved, I=0A= > think.=0A= > =0A= > There are other techniques used in the dwarf-reader to handle anonymous= =0A= > types that are not named by a typedef. But those are super rare,=0A= > especially in C. So I hope that using naming typedef should be good=0A= > enough for a start, in practise.=0A= > =0A= > It's precisely to detect cases like this that the "diff" tool is used.=0A= So, is correct mark this test as failed as the current ctf/dwarf test harne= ss does?=0A= =0A= I'll isolate the scenario using anonymous types as you explained above :-).= =0A= Thanks so much for your hints!!=0A= =0A= > I hope this helps.=0A= > =0A= > [...]=0A= > =0A= > Cheers,=0A= =0A=