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 D984938618B0 for ; Tue, 26 Sep 2023 14:52:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D984938618B0 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38QEhtks024662; Tue, 26 Sep 2023 14:52:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : references : date : in-reply-to : message-id : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=4/2chkmpFvx3bN4LknjMFgRK8PtSzjsFGDMEOUe9arU=; b=TxvQT1qSETFvK9oqohrEFhcCUY6KHCLqtvg06WWN73wDBgJWvSOTqNYq3NAFzHMpLbVu 24O7HdSzpii668+kFtDPlYve53Wsulq7sVo4F6gyGqLAASY8rfJZCubUrJ2A9aIyE6hK ODHC1sJ5YIbYd1a2r4t29Z77519aPU2zLu1qN1nyef9VEI5QHjEdAjida50Ns4jqPgf2 YOpsNfP8zh67W+1CA0RQ9CWn0DQySKOF4Tn3xQq5J4ZFxXD3KiTsU6TUowRsZjMiXEHY YBJKfs0FhDJeYxYH+q5ZNYrLTndwmt94Cw+U+WTzFed6fO642XhokON8uF4MyWLBg8pV CA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9qmues9v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Sep 2023 14:52:05 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38QEUhWx017951; Tue, 26 Sep 2023 14:51:59 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pfc8syd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Sep 2023 14:51:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RHZ1lDPjbUVmrf2ynSat4jq7hdWj2Kwu1/c+fBqkRaw5BnEK1IuPcJqwJaZF0HVxjwuMgQfHVTcSd1lg2ck/NjYOlJBbGDdZlLiPxSUKtRsTu8yGpwS2wr3a/75Q63KuIc7WdJIOwqHAn+TtthAAD0cqjeF8TyrnhPc7eJNXc/zKWMIYRbcHkjjw2PJagV5sRROn2hsHBRf5ejfqbe5ORKqBvD+fSk/hb12PBQvZ07INejXLiPvP9M0cmDmWV06ZQbAKNja4nv9jBbavlSJrLxvX4PZhvnG6qxKYcapTChXuOKpEHq0ND2I0eRR1tIjkl2AVfgdGqxkFaix/danQHA== 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=4/2chkmpFvx3bN4LknjMFgRK8PtSzjsFGDMEOUe9arU=; b=N61eP6kuSqetBK2vgLU4xg38op7pQTEEJ57coZeYlsPah5f99nTyMBbe9qcPqa0ICyHDrHWkM6qhO8q+64h9o6OulVhafFArJ508Arpq62vXdvES1Z9pHvW+pF6vKXxUTwQcaNj3mUG1K5SrlnYafBTh+tOeBFJ7JtHZBfFPzteVh7etYEC/lFPC/SKA95B3RgdYW4oOfFMznoUShnEoGY3M4BNxCzN9eWqVPn007hZLadSlAtCEsV1Qq1WbL9bII3jhpvJYYR1Y5snogMa5vCQXmRWlPEPzI3dG/TpHfWC/hFPfh3TPynXIWfw/tMPPlBCjyhp7RppMl93F/4bGuw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4/2chkmpFvx3bN4LknjMFgRK8PtSzjsFGDMEOUe9arU=; b=boPpo7M3qwPUCf/W2JZBpo5AKvFnPg53lX8U5apLESRo5ybawQV2XdXUWzctwXib82nfmQmh/Y4x6jAKEZ29fYaFaDQme1E1sYSNPu3zO5VruULv2GIOMKsieAXadxgqgTGpkbYq0LaMlA0w5LEZ6ZhDPARDQxxe47Kd7l6l4fo= Received: from DS0PR10MB6798.namprd10.prod.outlook.com (2603:10b6:8:13c::20) by PH0PR10MB7097.namprd10.prod.outlook.com (2603:10b6:510:28f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.32; Tue, 26 Sep 2023 14:51:57 +0000 Received: from DS0PR10MB6798.namprd10.prod.outlook.com ([fe80::63e3:4634:f484:efc6]) by DS0PR10MB6798.namprd10.prod.outlook.com ([fe80::63e3:4634:f484:efc6%3]) with mapi id 15.20.6792.026; Tue, 26 Sep 2023 14:51:57 +0000 From: Nick Alcock To: Torbjorn SVENSSON Cc: , , Yvan ROUX Subject: Re: [PATCH v3] libctf: ctf_member_next needs to return (ssize_t)-1 on error References: <878r9ba2sf.fsf@esperi.org.uk> <20230913095727.1420654-1-torbjorn.svensson@foss.st.com> <87a5tp2a3n.fsf@esperi.org.uk> <657dadf8-4b7b-67e6-9de2-9a1cdb79f081@foss.st.com> Emacs: impress your (remaining) friends and neighbors. Date: Tue, 26 Sep 2023 15:51:48 +0100 In-Reply-To: <657dadf8-4b7b-67e6-9de2-9a1cdb79f081@foss.st.com> (Torbjorn SVENSSON's message of "Wed, 13 Sep 2023 22:20:44 +0200") Message-ID: <87wmwdt2bf.fsf@esperi.org.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: LO2P265CA0040.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:61::28) To DS0PR10MB6798.namprd10.prod.outlook.com (2603:10b6:8:13c::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB6798:EE_|PH0PR10MB7097:EE_ X-MS-Office365-Filtering-Correlation-Id: 74491aa0-babb-4ad7-e471-08dbbea02199 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cu1k+4XGNPmrhmD+MdCsXZbInoBXad1lTNcw4v3yEGpQglJReceQ9Xy3PBpDEiw/X3Fy97iuvNdQElRmuOVn45YEN2vUJIkJqP1Kwz9WG8YmbSsP/K6qyVTqNBDeYu1W4w8tTHUTSuRPA0LYLcIn2Q14/ucT/+/ob73nCPgH3JzUor6sGhtDtw6WiNuFePTt+q2cD20KvN2tT6eKz6gZ4cyj+SblJlOVEGU439ZNZ/vLhhl/Rzmu/kJk+x/Lx3PtvvIlNpmU0ak+AlluT37NFm8d1+Dk+C3r/mVh4VA7cViGYa7Xf5U2lOMYOsSwujLogMbn3OIq5xFWzET0HtlQzRI1sHHMYhLi1YYLF1PK3L45Gjvuzb7Uola47sfQqyyhBunw7p4jftj5qhG+LP6DYNs3fDPXI8jG+E3n5tfiRqahNGpavcxRnNpN1A4Qxe48q3Wd++XdOjBJXBNiWIhL3ugskg/wGdyrUUJa0vBEVlx3GDPT/p7cSkSIAgcLLsGowdiTf9REVHUFnjtb08+N0ERFKZ7SM72Ln5hi0ZvMHTD+2ZMaI57MnpbcNnCH3lxK X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR10MB6798.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(346002)(396003)(39860400002)(376002)(136003)(230922051799003)(451199024)(186009)(1800799009)(66946007)(53546011)(2906002)(6916009)(316002)(41300700001)(8936002)(4326008)(8676002)(5660300002)(36756003)(44832011)(66476007)(66556008)(54906003)(86362001)(6666004)(6486002)(6506007)(6512007)(9686003)(66574015)(38100700002)(83380400001)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UEFLMHFvbVVZTmFNYkFob2V4ME9aakxlOEMzUVl4bHhCQU5OYlhJWEZXekph?= =?utf-8?B?SVMwWCtsd3ExcExRWGVtRXRia0NvaGJaWVRwZnBNTTZlT2g5TWhGWmJJcUhN?= =?utf-8?B?WTV1ak9UY0hnYWlaeGtlV3pSaG5WZlovQlhqbDJKM3U5MDVNd0haa3VVWVMz?= =?utf-8?B?Qm9ETXFZc2c2U21aNk15elh2MGZibXJtS0EwRGVvb09mVnFIYnpXZUJpVGFq?= =?utf-8?B?SkRQeFQ2VVJYWFcvdlB2VW84YXhkQTJ5eGxWaU5wSTR6L2ZPUVpxWWx3WkJ2?= =?utf-8?B?ZmhJcE5RRTBFTnArNkhTT2pRY0RpaXhXNFE4bElMa3Z2aTIrNzlwcHdDdXNG?= =?utf-8?B?elNXOFJUdW5kcDc3M2FCREpCY3ducGE5R1pCMm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B?MVE9PQ==?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: rsdQ5+SkoNHlKXlYXDzI98Ij6gmiZQiU5BtUJ6KA3L7nkfhZBeB4qlKJnNgaOw25FRO3X4xDgswOwR6ObqoKwTevTX0xyIUp0fQinB7TPmUPeWZTM5touB1sMlMDEKbhi6FPISyqJo/FRklmsPKrHHuq+H2yUsDOmv8BxNpZ5ukKFmM0rd9065JFJJQTTSlgEnlU3N7R3MSnnP1MdBZdt9tHF2Kf8jLYuFsaA9mgOAMVnTi0vRtrlVaM1Zahg+QJBhT+BEe2PntcQ/6qp+JuVy8/QteA+MAYlVcmG5WW+6lqU6b0iS0Mci1H+vBYnaFLPG4H67Gw20OlIg9ZnZEP0Qrt+8TOK5Rrj0aOpNCTdj3ozOLKCbJ8B3pfwcR9o646Lh3nZDrZtGpqNyu25mFEnJX3mJhwpUYv9lmIKjjm/a3IBNzSxwQBDOA5SGjACX5F4LeFgYXXJpMjW517RbCMAQEMbyCxiV8PfIOxyC0lW6k6gVhVfVzDJT+u29EX6RNzFizZ5LFgeF1E7i3CRBnpNP4exIsU6pjLjUu5MfyM30tv1Q+cnBtFIhgmQ5VetVFRW3zGJ1/A8S279TzavS8ztRO9weJLK0LuNhOvKJdSAiTpgcxi6ysIZwCG/XKPkdy32fJKRNG7lTb1FwTREzd50J3z00/qqxig4H7WoO2xtbnj/T9KmcFOHpms/MHZ8wEwAHnqqvaXA32ToweigzYVkuNsYy2WJZyI/Hc+2IGOMegyikDNwjX+I1L1HTtSKdOQYCSt84MIbETQfuXZL7P0IW5CnDiOboMP9PwqdklvixTMw3iQUlJwezyePaUqRX88 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74491aa0-babb-4ad7-e471-08dbbea02199 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB6798.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2023 14:51:57.4867 (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: kcWpY24kgThqtLVdX+OlIr5u7taGplT3zrY2+Y9zQMWbDgU+hmC7Bm5pNZFhB/+IQLh53yTRV0AAEskg26x8+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB7097 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-26_11,2023-09-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309260130 X-Proofpoint-GUID: cfU6-8oJW3DcbkQYtkgn3hyHFhKEnSPm X-Proofpoint-ORIG-GUID: cfU6-8oJW3DcbkQYtkgn3hyHFhKEnSPm X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5,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 List-Id: On 13 Sep 2023, Torbjorn SVENSSON outgrape: > On 2023-09-13 20:37, Nick Alcock wrote: >> On 13 Sep 2023, Torbj=C3=B6rn SVENSSON verbalised: >>=20 >>> v1 -> v2: >>> Changed all functions with signed interger return type to return -1 bas= ed on >>> comment from Alan. >>> >>> v2 -> v3: >>> Added ctf_set_errno_signed function to return a signed -1 value based o= n >>> comment from Nick. >>> >>> Ok for trunk? >> If this touches exactly those functions that return int, and fixes the >> reported bug, it's good as far as I'm concerned, except for a couple of >> possible comment improvements: > > I've verified the calls by building binutils (with the configure flags me= ntioned in my last mail) with CFLAGS=3D"-Wsign-conversion > -Wconversion" and looking for any warnings related to ctf_set_errno. Afte= r applying this patch, there were no warnings left. Oh right, that should work (given a platform on which this goes wrong in the first place). I should add -Wconversion to my test flags... >>> +/* Store the specified error code into the CTF dict, and then return -= 1 >>> + (CTF_ERR) for the benefit of the caller. */ >> It's not CTF_ERR in this case, it's just -1. Perhaps: > > True, but why is then ctf_set_errno returning CTF_ERR? Simply because I foolishly assumed that CTF_ERR would always end up =3D=3D -1 even when passed through a function returning int. This is, uh, not true. I do wish that C was defined such that we had one consistent type we could compare with for errors and not have to worry, but we don't: functions returning a ctf_id_t return CTF_ERR on error, functions returning an int return -1 on error and that's just the way it is :( (This was always true, even in the Solaris era, but when ctf_id_t was an int this was less visible than it is now.) > I somehow want to make it obvious that it's not wrong and that it > should *never* be CTF_ERR in the signed function or the problem would > reappear. Yeah. > The other possibility is to do the inverse, meaning that the > ctf_set_errno function is returning an integer (-1) and that there is > a function ctf_set_errno_unsigned that is calling the ctf_set_errno > function but casting the returned value to unsigned long (or ... and then all the ctf_id_t-returning functions call that? > ctf_id_t). I personally think this solution is a bit more clean as -1 > is the error value from all functions, just a matter if it's signed or > unsigned. Honestly I suspect all we need is a better name: ctf_set_int_errno(...); ctf_set_type_errno(...) and then use one or the other, consistently. (Neither needs to call the other: they're only two lines long!) > I suppose the ctf_set_errno_unsigned could even be a macro in the ctf-imp= l.h header file. I'd make both of them inline functions personally (I bet it would reduce code size!) >>> +int >>> +ctf_set_errno_signed (ctf_dict_t *fp, int err) >>> +{ >>> + fp->ctf_errno =3D err; >>> + /* Don't rely on CTF_ERR here as it will not properly sign extend on= 64-bit >>> + Windows ABI. */ >>> + return -1; >>> +} >> ... that Windows is not really the problem here. It's more >> /* Don't rely on CTF_ERR here; it is a ctf_id_t (unsigned long), and >> it will be truncated to a non--1 value on platforms on which int >> and unsigned long are different sizes. */ >> perhaps? (At least, I think that's what's going on.) > > The problem happens when the signed integral type is wider than unsigned = long. ... sizeof(signed int) > sizeof(unsigned long int)?! Is that even possible? I would have assumed from the C type hierarchy and the integer conversion rank rules would have required that unsigned long int was at least as big as any non-long integral type, but I don't see anywhere it's required in the standard, dammit... >> This probably needs testing on a wide variety of platforms with >> different type sizes. I'll add throwing this through my entire test >> matrix to my todo list, and fix any bugs observed: but the basic idea >> looks sound to me. > > Do you want to run this full matrix before or after submitting the patch? > If it's before; when do you think you will have time to do that? > > Let me know how you want to proceed. OK, I'm back from various conferences so I can throw tests past this at any time, it's largely automated. So once I stop faffing about and changing my mind and we converge on something I'll throw it past every test I've got. (It takes a day or so.) --=20 NULL && (void)