From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ti3CFRLBGWMjnTUAWB0awg (envelope-from ) for ; Thu, 08 Sep 2022 06:16:50 -0400 Received: by simark.ca (Postfix, from userid 112) id 4C4C61E22A; Thu, 8 Sep 2022 06:16:50 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=fvyaOP+M; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id CC7C21E222 for ; Thu, 8 Sep 2022 06:16:49 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A06DC3858C2D for ; Thu, 8 Sep 2022 10:16:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A06DC3858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662632206; bh=JBNA7wuRAEEoq/6SqOzf43TbmeF+w70A1OVfvZNOYOA=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=fvyaOP+Mdq7tYE6PQOkaidY47ty9L1KHKlEl2gY/SUpd4xbz733XKXiKvJkgxbwNk rD6SUMZGUxWIK/7AC+4kwnCNnMGZVPJCtQ7XM6SoDbU6QHZaN5y7+lKCLXYIc6Dgvt h3wAb2adEE607xDYMtdtKGuXSoT1v7O4EKmuGJuQ= Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10040.outbound.protection.outlook.com [40.107.1.40]) by sourceware.org (Postfix) with ESMTPS id A7A6C3858D28 for ; Thu, 8 Sep 2022 10:16:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A7A6C3858D28 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Gzz3/sOvCdTabCCG2JydQu4Qs+tbbxSyPEkkyjGOl9xci4SWih3HOzb/tZ3F/hIqTq2Eix3o2cB0c2Swv/s0R5yToL3BTUGSlg9QtTr5ey49DWJ9R9HRvBt95z3jGVMj3NfYqwvodV1E/hZT2SIs884wXg+VpWV/YGLceHmEWPX6Cx+6FpBEkeqx6pfxWP/l7lUhtudU5zxWRWWlK/XNlek+WXKSPZd/LI3d+8b/MWgil71RrbM5hfpy3H5KrEura1d4cUqghJ2loIF8ojKxERCNa6JYcpoZENzMXnKqJI/UUjPNWMwr0mtwKFY3BO9Vr3iCyGOYJgoKFIdqf5t5Mg== ARC-Message-Signature: i=2; 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=JBNA7wuRAEEoq/6SqOzf43TbmeF+w70A1OVfvZNOYOA=; b=LJQY1Yjnv84GEP/7fK3+foIZKkSsYFl2OlsLTgBNXQgQ7fGJP8JjRNb/gUR24zziAoDDT5A5X67yDq8o4AkAVXJn854isurajULAKDA9jssyr/ur8JTaee04S2lnnrMv5PZCbthF5AbF1IdlRBr/LRXblaA6jCKzfaZikGFvyQkp3KT1eQgq1xTZFBt1Aj4Nn0i3s5FQnkn1uvBtmGwB2vfN9HudHvOrRUdT0ltZUkc9yEUon+u2jY8dJVch+sScXXhMdCNZT4EMl/abg4g1M+NFAszGnqpO2iLxDfViLBUX1CZW/EOfQluPJ4d/fRHdjpj9xNTnMUF2U1BApbt++w== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from AS9PR0301CA0020.eurprd03.prod.outlook.com (2603:10a6:20b:468::26) by AS1PR08MB7476.eurprd08.prod.outlook.com (2603:10a6:20b:4dc::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Thu, 8 Sep 2022 10:16:01 +0000 Received: from VE1EUR03FT057.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:468:cafe::d0) by AS9PR0301CA0020.outlook.office365.com (2603:10a6:20b:468::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.15 via Frontend Transport; Thu, 8 Sep 2022 10:16:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT057.mail.protection.outlook.com (10.152.19.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.13 via Frontend Transport; Thu, 8 Sep 2022 10:16:00 +0000 Received: ("Tessian outbound cc6a8ab50b6b:v123"); Thu, 08 Sep 2022 10:16:00 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: cb1cceae49dd8773 X-CR-MTA-TID: 64aa7808 Received: from c2a3962c6ec0.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1E7912FD-1150-4539-B5DE-B237F55123D4.1; Thu, 08 Sep 2022 10:15:52 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c2a3962c6ec0.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 08 Sep 2022 10:15:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RDUmYjXg7NVKeok3Qsco7uOVa+7RCwSfLLOi8QXLgv6YjOLxYrC0fBNCwgcoy9mfn2723yRvpR2wjS/3HgZCKlh7CeAi1OZH5lNkjouCG/TLGMqqAIvrMnvNz9S5l0kgYJcRLBRF0MN3VwqrUkXY2UpNGo+X1NrZgBolso7ffd5gnXPgTz0pwmQ5aPTJWUN5f8f0x48m1cEa42tT/DF2z4sdWnZKO7j0EbboEDfQMJIyWZPmMNi/a/pakinL5e7wF6djWOGZofZPssZVfhgTmcWNQl9cuyHrzKyjwKW2wcBCu61E2ry5C+nftuqww9F+mDnifMkbSPNkLE2jI60MBw== 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=JBNA7wuRAEEoq/6SqOzf43TbmeF+w70A1OVfvZNOYOA=; b=QAEI+Vh2dhm8wlzuuzdxmJR8XiQ6B+rBAZEz5OMSGGm10B0Y9VuPauK7zyFvho6VQk5cQQWuLhuhjaSYKsF/8ox3GKrdTh7WD5TZKwTONRGzq+ACODDo6/lI86H+3FEab8ke/cAB1YJ+iRkd/yHsYcvNWQgLLazeib5tbVeXdndXC6cdq199Ru5PECBgXeGvC5TAes01kDrilmozFiGIwiudA+Iu87/g4lvzAPI/ErW9+s1AfC56RoG+WM9H2zYMw9bjeZGbbBXfF+z4m0fKPbV/by/OFiw2xyEivn2CrAvG2qqyhwiE5s4ucZEiS+go/Nn4rz3G16BPGXSg93pgvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by PAVPR08MB8847.eurprd08.prod.outlook.com (2603:10a6:102:2fd::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.14; Thu, 8 Sep 2022 10:15:50 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::b932:b8bf:a61d:db28]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::b932:b8bf:a61d:db28%3]) with mapi id 15.20.5588.017; Thu, 8 Sep 2022 10:15:50 +0000 Message-ID: <280bf97a-7823-3f3f-68f9-a7060af5ea41@arm.com> Date: Thu, 8 Sep 2022 11:15:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH][gdb/testsuite] Use prototype to call libc functions Content-Language: en-US To: Kevin Buettner , Tom de Vries via Gdb-patches References: <20220905122706.GA23594@delia.home> <20220907104106.099b2c4d@f35-zws-1> In-Reply-To: <20220907104106.099b2c4d@f35-zws-1> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0421.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18b::12) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: a706145c-6967-4a94-80e9-08da91832125 X-MS-TrafficTypeDiagnostic: PAVPR08MB8847:EE_|VE1EUR03FT057:EE_|AS1PR08MB7476:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 3yTKpakNGavYAUF5UrB7mPi8nHHFwnjH+nJHawnCiwikTC+ifGwJjHCMy+hVgupeBidWQy9zLAX3mQs56+XVDXdz27cQK2lhBiK/zp0Y5skpecVcPKVxTcVt9yARm67Uom2TP0V921VQx4fWTlljvOxIQ2Uk8u/3CsthNuU0gY1klgCsVFss0fASGWS6lbX04Uon2c8gp0WsYE9o2Zz/yVYxWVVITNQybL9NaogkZb0YI+1FmK3NBoPBIWsTXTYzKw+N//AyUFU+JwBeoJf54Fvk1I0RH1LvoqACAyeFE1o7bi9oP8uFiFpLrjvwLo1eCHKammz/uHQYHNZhkMerAbMu6yUC//RB8pEgrds880WM3ywwKcjakvQa4VccbNgTJ/3V6ukbIHaHCOP/ZYd9TfPlkN4izuAXpqdQe2r67yEBTGHhbSTRelStxrdgpCeRmvmwG3AN7SJo81TvL2UG8Co0RUgxft7+RSAjwYPTvVL3C62ItT6jArPBX6Wc6ePxaF98UnU0u1CmF5DUshgU/I4CUEcWQZt20NVn4WS/YkBgPzRyevxRvHuIYcHhIWL4UzuHwDfv1xO4ZPLqFWolHT5rmgLuN33NSVkaXioxSX5jDEXub8WRBuGNwiBcE9Dxympy4hMEXFerF+17sxwPFf+rR3caxcPM0ctMZzziaghT/e51/zX07mGMt5jI/c7bzFticD4AIbSNNz73NJWV79K+ZrhK2Nyl2rCznYekPGTmBoU+DuLY3RuHoKObRVvuXSucrcHJ1VQi51y3/sq7hiEHhR7kL1HZOTC5hFYnAIo4av7laRUPLR11cQblVKtphpuXKlHhi+LgMH0sa0c+6g== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB3919.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(376002)(136003)(39860400002)(396003)(346002)(366004)(478600001)(83380400001)(2616005)(8936002)(36756003)(5660300002)(2906002)(84970400001)(186003)(44832011)(31686004)(6486002)(316002)(6506007)(38100700002)(31696002)(110136005)(66946007)(4326008)(6512007)(41300700001)(8676002)(86362001)(6666004)(66476007)(66556008)(26005)(53546011)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB8847 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d5e98504-adc4-4349-23a9-08da91831a4e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bbNDUrjcSJCkMaZrcxWxFBy1ugjkPqSBDxQr7HpzWIei2WcUy3jNl7dBNEIPG0Wpz0ctQvV81YhmGoxshvLc/k8mT4l70zbfgwdkZaxNJPdffiJGaU2CsncLX88zR3Ti3aKBA/ZUs0grL/Snfy9JKI8u9RGeNDrxLUsB3iAqYkBX/eu6Jod6dDiP2ngBy6Swi819WcrNSTpMk6VfEcCgwujYmbsFUD8pMvwQbn7WAuMXldmqqcUi3XJ7N4k9NS4fqy6WwpBLrMviyKVKCteDrB1GSRrS1F2Ab+iOU37YwUwD+3Wo1/BZgBCynTenR9A7kV+amjhhRa7KqMWT83+DM5+tSQQfRv7D8On4kjzfpmh5HxqyoicZvgIOkOxGoKs3DKGJCZPM19u9xj5KUcuXdOfVzoRXPGuEQ1VfEVdLx9pGz5zuaOarrHf66nGAavT5meWqCR89naQgDWdnhhbQN1ubcOFWM48qczLEoypu27wbnGbKLORq27XX6rV/qoD5uVpaSYOlI2lRHgYIYCxqHSAa2QwVrc0ZjlzapKZi43rEt5A9/CMIHvedq27oU4wqs1cUekTbyCuvNKYal4M8uOXPVDgP+FN/IFvTuXj/EdLM38DgBSwobI12Y+EDC0oMPLsLLefZMdqaxxIGoO7BrNQUjeFuHO0X8+iOnHwHAzFNq7MV4YQTZ+Y1eHs2/dBempZJQ+q4tD0fcX5fxuyUKnhi+ByPQbREbIcbH2pLWz0vCeghdcXbuyf3NrjsNUANFLT9ivdJc0yJXxo4AM7OBHyqG8+I3lwMTifHO9hFDH4QXIBU5TleODdBar99X3l330/uIT1sNoJQIMHt3vsdxg== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230016)(4636009)(396003)(136003)(39860400002)(376002)(346002)(36840700001)(40470700004)(46966006)(107886003)(31696002)(6666004)(356005)(86362001)(82310400005)(81166007)(47076005)(110136005)(316002)(41300700001)(6486002)(336012)(6512007)(53546011)(2616005)(6506007)(84970400001)(478600001)(186003)(26005)(31686004)(2906002)(44832011)(36860700001)(8936002)(8676002)(82740400003)(36756003)(70206006)(70586007)(5660300002)(4326008)(40480700001)(83380400001)(40460700003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 10:16:00.8102 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a706145c-6967-4a94-80e9-08da91832125 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR08MB7476 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Luis Machado via Gdb-patches Reply-To: Luis Machado Cc: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 9/7/22 18:41, Kevin Buettner via Gdb-patches wrote: > On Mon, 5 Sep 2022 14:27:07 +0200 > Tom de Vries via Gdb-patches wrote: > >> Hi, >> >> On openSUSE Tumbleweed (using glibc 2.36), I run into: >> ... >> (gdb) print /d (int) munmap (4198400, 4096)^M >> Invalid cast.^M >> (gdb) FAIL: gdb.base/break-main-file-remove-fail.exp: cmdline: \ >> get integer valueof "(int) munmap (4198400, 4096)" >> ... >> >> The problem is that after starting the executable, the symbol has type >> "void (*) (void)": >> ... >> (gdb) p munmap >> $1 = {} 0x401030 >> (gdb) start >> ... >> (gdb) p munmap >> $2 = {void (void)} 0x7ffff7feb9a0 <__GI_munmap> >> ... >> which causes the "Invalid cast" error. >> >> Looking at the debug info for glibc for symbol __GI_munmap: >> ... >> <0><189683>: Abbrev Number: 1 (DW_TAG_compile_unit) >> <189691> DW_AT_name : ../sysdeps/unix/syscall-template.S >> <189699> DW_AT_producer : GNU AS 2.39.0 >> <1><1896ae>: Abbrev Number: 2 (DW_TAG_subprogram) >> <1896af> DW_AT_name : __GI___munmap >> <1896b3> DW_AT_external : 1 >> <1896b4> DW_AT_low_pc : 0x10cad0 >> <1896bc> DW_AT_high_pc : 37 >> ... >> that's probably caused by this bit (or similar bits for other munmap aliases). >> >> This is fixed in gas on trunk by commit 5578fbf672e ("GAS: Add a return type >> tag to DWARF DIEs generated for function symbols"). >> >> Work around this (for say gas 2.39) by explicitly specifying the prototype for >> munmap. >> >> Likewise for getpid in a couple of other test-cases. >> >> Tested on x86_64-linux. >> >> Any comments? > > I have mixed feelings about patches like this. > > One the one hand, it's nice to have the test "fixed" so that it doesn't > fail. > > But, on the other hand, this failure found a problem with the debug info > in glibc, so fixing it as you did here will remove that test. > > Perhaps you could add a new test which will still fail when the debug info > incorrectly specifies that munmap has a void return type? > > Kevin > My $0.02 is that the GDB testsuite is already very often affected by bugs in other components (compiler, debug info, linker, gas etc), which make it even harder to have a somewhat clean GDB testsuite run. I'd say it is the responsibility of whatever component contains the bug to have a test for it and fix it. In this case, gas. The XFAIL idea is also OK in my opinion.