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 220A03858C52 for ; Thu, 28 Sep 2023 16:41:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 220A03858C52 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 (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38SDgTwA016444; Thu, 28 Sep 2023 16:41:43 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=L98z+wmow4Qqs5j5sg5Ww+7R2vAEiWuI7TRDwQVNf70=; b=vNi7NVJekP2IHMHE9IC6QQ8BfLV1Vx765tMhNbGe4R5pi/n8tvmmQyyApaTPjn06wQUq +x9jut8666XD6eUPxJ4uEQNBgW2HyKZLFhc9qL3+FdJvEKbR1arGjxTapeZsj1kkVBSi CxcuJlXQ6GXdsX15xiYwiaFHsaLG1gO2JDCd2eNAzyref5zxpBUtJyR0zuZLhwjFvVi4 l3jnfkVCu08FE46vjBDidt9EPJn29HxzAK4ntvxZJWC+4dZeiPuwHU5lsm7CkEMn+uO5 hGZ5TYKnlGViWOR2sS1ai2HjFsBfzOqgqm12otQyRxhxUhHz5FjKXezegLiuSfnUKlL+ Yg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9pm2d28n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 16:41:43 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38SFSfwK004851; Thu, 28 Sep 2023 16:41:42 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2042.outbound.protection.outlook.com [104.47.74.42]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pfad5xf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 16:41:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GBDNZf6c+kvj1sbWVUIjWPpnbYz7WX+lSy+yU4KHPwZUeEV+5wh+q46MEN3cyeN9LDtt8MQTWG+EGpwMXHcRHNTTJ0KQbKxfyLC5pVecJUascEXfb+niyq1oii8ndNHOAOIiwB0UPpJPju48S+plIMQ5i0JJuA+Wq9yQzt62ev/qcFxnbIJLDQlKtLBHS4QeCkxIrO+GopvH3kd1q1iXUpwQU6251DvLyDPazerQkwVbovSFuJk2Cwzx3F47G2SzDm6m3ZvDscBaAVKeSpBPBw/Z9spUeg3qx2YNSiEIcEAT5lB6EwhGCoMhwrsHsWCHLYa9NCQH3D45kw0r/YoP7w== 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=L98z+wmow4Qqs5j5sg5Ww+7R2vAEiWuI7TRDwQVNf70=; b=jo+fr+l/WYY/xPPmld9WbY6UMN/zYab6fxM3jpmTbB4H1lmzpI0df/RaMg++5Zef5/hasgbfzu9AF9J11uZCYBnCf/yxpj2yBoFW4FLZbqbpRYHKV3zHtsr1l/pEgrGoj+3m94MOTXZUKBEr4stk3IAl427voooQ0fPPhEfzjJf+wVclizzzLBCq540NWf7bbc2DUK7AUJV0oS4bnPxb9ylHd1RnijBdTuIXjEu8QDA84Q/QqPqgxFvmDFZDRqqy9d9MNc3c2/zsr+EhhHMBNfs9yUzKzhSOcB5wLKuBurHKXudi5Ff6SnpTC0Kzu20WtBqGnniiAqaZXd0YAW4EQw== 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=L98z+wmow4Qqs5j5sg5Ww+7R2vAEiWuI7TRDwQVNf70=; b=B8cttAKWspL/U1l3lNOP3MyETW6QE45vl3Y6fb2M8r9RLLpniliSNRkcEDxFYC7+h39tWXY0ao5aOAQlWUAbQ+Rq6lyEY8s740S8RGOs9jsjbpku7aJxiJRQyPEtRB0bCW+aNsqOaXAjLLHetQB2Vjftjlcoo3OOJdkfawHRgMI= Received: from CY8PR10MB6777.namprd10.prod.outlook.com (2603:10b6:930:98::6) by PH0PR10MB7007.namprd10.prod.outlook.com (2603:10b6:510:282::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Thu, 28 Sep 2023 16:41:38 +0000 Received: from CY8PR10MB6777.namprd10.prod.outlook.com ([fe80::ca0c:fffa:3d10:3377]) by CY8PR10MB6777.namprd10.prod.outlook.com ([fe80::ca0c:fffa:3d10:3377%3]) with mapi id 15.20.6813.017; Thu, 28 Sep 2023 16:41:38 +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> <87wmwdt2bf.fsf@esperi.org.uk> Emacs: it's like swatting a fly with a supernova. Date: Thu, 28 Sep 2023 17:41:31 +0100 In-Reply-To: (Torbjorn SVENSSON's message of "Tue, 26 Sep 2023 19:49:34 +0200") Message-ID: <87r0mimero.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: LO4P265CA0170.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:312::9) To CY8PR10MB6777.namprd10.prod.outlook.com (2603:10b6:930:98::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB6777:EE_|PH0PR10MB7007:EE_ X-MS-Office365-Filtering-Correlation-Id: 904673e1-b090-4363-6f61-08dbc041c941 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Bjjd0YuopCyMg0QAPMPr0I7YUupniOSvWFqp1rhD75M26ITiwvPtCueJjRQXbIx8kvyKTifFakfg0tEnUPftvtpotMBSD5Eu9puHjzYESQ83+weT+Gi5re29loAYGIMH4aSvMdUhxIb1fXMkbs3ERKZX89jUl+TGPN93soYf5tZH9vFaQo23F9lff4e34U3zKRyxa7NTdYXGX6o0B13BXfRpPmPXc0NrCWp3SdAbpMfO/jGSp9RJLil+DjuQnRKv1p6MORoNwVtIZxAVY3/jHJqgP3qpM9Wnw9jCTrIAvCONboeln+seJIpxf24D1mhA82f2qadQ/yPG12L9W5zLXVxevKWQkBx14yUFyMDBXDmMV26S51NBYk0F1Bq79qhNngBXtJ63WVo0Zm54Xcl8MX2TfonjRNKSAd9pNKa62vdpOH0AFAaPbPe8A/xqYFyz4am31B2oBFC/z+99OvoavB3VM1QujpmDWJG2OFjbmTDP8NuE3p+rSgpUhGbpd9/nAtRbwEm/k4ZLt6c1SN21OKj195J0BCD+6e8iLKeP5wSSHW8Wkz8RqrWKpTfEgwUfWrInm1pjwKyCINDgmLqjoEV9G1GWexTEpCr4jnQGCGokCOxVfRwG3WstivgxvMbt X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY8PR10MB6777.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(39860400002)(396003)(366004)(136003)(346002)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(6666004)(36756003)(66574015)(86362001)(83380400001)(5660300002)(478600001)(6506007)(38100700002)(6486002)(53546011)(6512007)(9686003)(316002)(54906003)(6916009)(66476007)(66556008)(66946007)(8936002)(44832011)(2906002)(8676002)(4326008)(41300700001)(460985005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?N3JSNGRjNE1Xb3hSaUNCMkZSZGdJM0VHTzVBTmg3N1pJZjd6VVFvNnc4RHIy?= =?utf-8?B?YVAzM2hpMGxsV0x5dHE1SkJHeDNSdXBabzF1QUZYRTk1OVgxRXFjTDlTMEpk?= =?utf-8?B?Qll4VUxsV00rckNkSExZcXplU1NESHBUV3g3eE55eS9NcmhtRWVJZkh5WXlC?= =?utf-8?B?Mjl1VkV4blNFdHcyMzVnOUFYUHY3ano3VkN3WFFXenF4R2tuZDZkWHhqQ0t4?= =?utf-8?B?aTBXSHJNc25QNVoxZkJob3FqZHdmN2l0RUo3dFpJUHdDSVl3RW81enZzU3VG?= =?utf-8?B?bWcydVE1Z3ZxdXFQVUdCT2VMdk9CVHRWM2FDNkw5a0I3dDdZQTZsaD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25RQUlNNXNJREZCWHZIRTZqejcx?= =?utf-8?B?eVE9PQ==?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: sAo0nl2U4GKzlYcZkAh6Td9ug4NZD2DR0t94TaY3UWlaO6UlTYBxXK3byI1znAB+CNn0JqtirQsNiKzJluwI/WoPd9MAG5pQ8mc1FPBlFGyW5ylyJd3tG/Nf6XzSj1VmZ8drQ8DTDu71xIyyVmCFm/xj9CJoPejrPpSVaVMBoHcOG4PiARJ8mZ9TnuQVmwqjPYB5eNH3crKXcrARveoCcZEygP4SA7K4UPp8s0j1SwM1jCGEHC6z5MrgbP30VuQG8sLlyDrh05zKcJHWO9//XLbwDyJCE2DYnwsu28CCviYd9SMRxx6j9M7eZus+4corh8FQoYB9R5l+WDmvynG28+RkKMbo49AZNE3cvZgCIBRwPH9kcTq38vNibB8z0h8zAb8M0v+IwrJSoO9BZD76zG+y+VZKU0S+p4BHDiCbwk8WSZaIvY/ZkLx4Zzad5dNBILMZEXYKMsw4i0Kff43CGmwUjy+y0wwa5S1lFrfSJBshugnucPsx8aE5ifr4yAJ66Md8gd1VwqhDq5HZKABWCkRp2B963Ze75j9ZxK5Eg6Q88rtGERN7n2DV56Z8gPRQMez4iZ6N2ZD5A3RNK0R/+UDguOIk6Fv80MncLoM7vTxf5teiwMV8ve6ClBsA68pUynRhx0t2JlssSt5AAMJJbaBzRSAzO9Usz2VpD2W3ugWJO9WWDumMl3wGxGNkf3DyYYQ8/i1XBYSTzVfZpUpEfllZ+N7VRcxL/OxPFgDIKZDv4fOd0OeguSNpwdNLR92AqbG7DAUrLBHb3a9MYvo56JgmOpxqrJZe5UH+w1Tk4q7YjccqBp1MTwk0fjNknw9c X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 904673e1-b090-4363-6f61-08dbc041c941 X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB6777.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 16:41:38.7185 (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: UaoFaVW8vtZXMOrV2ngnZVKsDpJnD+nGkObAXG0y2b9eYmDMwXCTxpOMnBscOiuL3iF/f4ULBwX96hCGkyu8Xg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB7007 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-28_16,2023-09-28_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309280145 X-Proofpoint-ORIG-GUID: Nrer8SZ4YoJwCfZWOADCft3QfYWXAG9B X-Proofpoint-GUID: Nrer8SZ4YoJwCfZWOADCft3QfYWXAG9B X-Spam-Status: No, score=-5.0 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 26 Sep 2023, Torbjorn SVENSSON said: > On 2023-09-26 16:51, Nick Alcock wrote: >> 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: >> 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!) > > Ok. I've updated the patch (V4) to be like you suggested above. Thanks! >>> I suppose the ctf_set_errno_unsigned could even be a macro in the ctf-i= mpl.h header file. >> I'd make both of them inline functions personally (I bet it would reduce >> code size!) > > I do not see any major difference in code size for the ld.exe binary afte= r the change. Oh well, it was just a pious hope really. >>>>> +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 unsigne= d 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... > > I don't know about the 'sizeof(signed int) > sizeof(unsigned long > int)' part, but what I said was _integral type_, not _int_. In the Ah true. My apologies. > case where I saw the problem, it was ssize_t but I'm not sure what > that maps to, but it's wider than unsigned long int apparently in this > case. Aha! So this is *not* a problem with functions returning int -- it is specifically a problem with functions returning *size_t types*. My apologies, I misunderstood the entire problem. We probably *do* still want ctf_set_errno_signed for functions returning int (for clarity if nothing else), but for ssize_t in particular this won't do: we probably want a ctf_set_errno_ssize_t or something. The name is awful but I wasted a day failing to think of a better one :( There are very few functions returning (s)size_t in libctf: extern size_t ctf_archive_count (const ctf_archive_t *); extern ssize_t ctf_type_lname (ctf_dict_t *, ctf_id_t, char *, size_t); extern ssize_t ctf_type_size (ctf_dict_t *, ctf_id_t); extern ssize_t ctf_type_align (ctf_dict_t *, ctf_id_t); extern ssize_t ctf_member_next (ctf_dict_t *, ctf_id_t, ctf_next_t **, const char **name, ctf_id_t *membtype, int flags); Of these, ctf_archive_count () cannot fail, so the problem reduces to ssize_t alone. These functions should probably return (ssize_t) ctf_set_errno_signed (...)) (it's rare enough that a utility functions to do this is probably unnecessary). We also have (in ctf_type_lname): if (str =3D=3D NULL) return CTF_ERR; /* errno is set for us. */ This should probably become a straight -1 (no cast necessary). ctf_type_size () already gets this right (but needs _ssize_t adjustments to its ctf_set_errno () calls, as does get_vbytes_common in ctf-open.c). The same is true of ctf_type_align (), and, of course, ctf_member_next (). >>>> 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 patc= h? >>> 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.) > > If you do not see any problem with the V4 patch, then please go ahead > and run the tests that you have to get a verdict. ... sorry, I'm still flailing at it. Maybe the above is helpful? (It's only a very small change atop what you've already done, I think.) --=20 NULL && (void)