From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on0624.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0e::624]) by sourceware.org (Postfix) with ESMTPS id 91E05385771B for ; Mon, 15 May 2023 21:30:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 91E05385771B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5KPFVY1RWOr/IKim6GbmqIkEJIAH7FPcIdNtJVkwg0U=; b=KHuvKKN8mAPrIBVxEHFWuXbeIw01yDIIvLtq4FAQZyVq9GG9pd4BFi8ZGQugAyAz9gOxMnhhGP0nWm1/ijJPvc/nhcWVCdlRBI5EchNQSJU54UxrL0u7BMGRKSUpXpnEWw6YXsU9LPSaq2pLEg2xElVYGyhYD2n+y4eoBMsVWfk= Received: from AM9P193CA0018.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:21e::23) by DBAPR08MB5573.eurprd08.prod.outlook.com (2603:10a6:10:1a2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Mon, 15 May 2023 21:30:00 +0000 Received: from AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:21e:cafe::ae) by AM9P193CA0018.outlook.office365.com (2603:10a6:20b:21e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30 via Frontend Transport; Mon, 15 May 2023 21:30:00 +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 AM7EUR03FT022.mail.protection.outlook.com (100.127.140.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.14 via Frontend Transport; Mon, 15 May 2023 21:30:00 +0000 Received: ("Tessian outbound e13c2446394c:v136"); Mon, 15 May 2023 21:30:00 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 96079e6a26948774 X-CR-MTA-TID: 64aa7808 Received: from eb86caac1229.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7AFC78CB-9761-426F-9CC9-419C05B5F25A.1; Mon, 15 May 2023 21:29:53 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id eb86caac1229.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 15 May 2023 21:29:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DIrLzl9BxcOiKU0pZ/m7+li+LBqmvymD5Vh/Z0bIY8ojPiyjMuHAQqMirEHopAmdNJbk3ofz2gxRlq3hizVwOQE+kmXKk/G8enGT9qk1hv40mnL8ASbZxwO+pqqdC4Ry+Y2yjeyC8c+TFX+Xlf2QAIRjQgfekRopWVvUqj/oTfgS2g86HSleRanmOsZ4ZBei0GGKvuS/8vcJXjxgohfN5J9ogRhji+eXlQP8AHr9NBhDweDyKfPHf90otFhy1nek1aBOZNvFyJZ1S8yOuCZp0X4kf7AsM4QwcvPsWzai1XYi95s1926SoetPbxJqPcwlMGYlrMXb5BKsAVe9VkTp/Q== 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=5KPFVY1RWOr/IKim6GbmqIkEJIAH7FPcIdNtJVkwg0U=; b=I27lPsEBVtvLs33ySlQ22z2BDbilGDhVqIvanhFeJN3TjRCDJtADcWk4Ghkf9GpazsUzWN/xU92oJebj4Y9TXWtQlK0SUunkh5TZPyZnUPw2o/YDaUXw+UqFs6Kyc7OU4t5nsTAZce4Q3qKnmK1JuVVc5fYCezw7wpDkWYvZaR9K793dUHQQZ2o2gjl5c6kd9NXw2XzQa9bzmQdLyd64xAe8pzJ2FUmXbjcoZ1BR42tNn6qn4pfiBJMK4H41I+d/8y9+J264s+W4dSsvI5pW1uXw8W/TiStPd41RlDQ7wfiImbTeK111HXQ00y8XlzxlIviHy6709o/HA8oh7SMKtg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5KPFVY1RWOr/IKim6GbmqIkEJIAH7FPcIdNtJVkwg0U=; b=KHuvKKN8mAPrIBVxEHFWuXbeIw01yDIIvLtq4FAQZyVq9GG9pd4BFi8ZGQugAyAz9gOxMnhhGP0nWm1/ijJPvc/nhcWVCdlRBI5EchNQSJU54UxrL0u7BMGRKSUpXpnEWw6YXsU9LPSaq2pLEg2xElVYGyhYD2n+y4eoBMsVWfk= 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 AM9PR08MB6100.eurprd08.prod.outlook.com (2603:10a6:20b:287::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.32; Mon, 15 May 2023 21:29:52 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::c6b8:4dc0:6f9:7f40]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::c6b8:4dc0:6f9:7f40%3]) with mapi id 15.20.6387.030; Mon, 15 May 2023 21:29:51 +0000 Message-ID: <36ee8832-c197-6055-4e62-953f8769f84c@arm.com> Date: Mon, 15 May 2023 22:29:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] gdb/testsuite: fix s390 failure in break-main-file-remove-fail.exp To: Andrew Burgess , gdb-patches@sourceware.org References: Content-Language: en-US From: Luis Machado In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LNXP265CA0021.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5e::33) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AM9PR08MB6100:EE_|AM7EUR03FT022:EE_|DBAPR08MB5573:EE_ X-MS-Office365-Filtering-Correlation-Id: 97af2606-6e82-49d9-393f-08db558b89bd 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: +q/Zuo0MZJF5Iau2wky5vqtQI3m79wdqcp8/mGFBd+IQMKNYjpohkLW2s+rtIJEbcJi5Ee2NBTe3X6+YlMbX6Y1+RZtI2azHbmi/rOUXTZSkgTj4+rDXNhqfZpUC3HuHYrr8GwemSFc08G+i0+CtycQkfVWTOCKYgwdi4zxVeOhJ1Eg6ZZknAbHECu8T9ZPgIzR8PbE6vDwy694PdqjqnFDsBmiWG8yFV3Y1T+VVV1jFBI4nNfi8EunY4Y8WM399A4OaJI8F+lrjTse57nJV9s9+16IrYJ8b56HzwaTJepkXiaxwx2ywxepHN/+cIjo3UL4YrhAj+uoINkd+JWHoeuKYaQ0GPcwtvzq8dzUiEzrRC/TeRgjnywSlB//sXLUKaPmKixFS0Dc97A/anNBgdQ4yOIlph7opokm8T4wcmmc4Xsp+2VoiLOSeM714Kom41ONzMz58mQbech6Yn/Cv2LkAtMmqeJPMm0+EGoSYYrNRTjuOG3gy1fg9WzJgHeJWX/TB8ZF4rxLfKAqIcHpF5TOw+tjBVR8KVlyNxU/W+ghTO4pKEOOpLzRJJmaQ0y2oXx0kPysE8V55EKYoR/2WCHS4VyVG7RDONYQ7quOFixAktJoG5HrGHH+Ko70mu0fq2dlPbqzK4kmwUTrU232vWg== 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:(13230028)(4636009)(136003)(396003)(39860400002)(376002)(366004)(346002)(451199021)(44832011)(31686004)(8936002)(5660300002)(8676002)(36756003)(84970400001)(316002)(41300700001)(2906002)(478600001)(66946007)(66556008)(66476007)(6486002)(186003)(53546011)(26005)(6512007)(6506007)(38100700002)(2616005)(83380400001)(31696002)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6100 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: AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 83c86471-f09a-4249-1456-08db558b83aa X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J9qSOll0eMEYx8lLYExDaP7dq4bhbm5L/K4+rYcp81LqGyxeVUX+oohc1k9qrReNx9UT5cpZrU/XUOMCfv+l6Jg1ClW2M5grZRHBN6/x/Wyg7/vHqp0gWrWnyKLHQ2b9vQkZbkfA6DJVa6+32ipGOlQJaS6m9WoITD9C57ittYQWOCDTJ1glHfuHIbA/JLm1hu0SEF2BoB0UeoaSmCqGqV+IMi5NmBVe7ue7zWb9wRq1Xr5ZYebIZ9SfGeAczGKUsocGE6IqOmWyqjs2wp8fm0ZZ46Nfm9FKb2jOalsZzB1joET68JhQf9J4RVUnfIvXZI8cD7mMtaTbttEJ1DYRA273ak9WLNbK3HaXsu5niTSewhWOOgfuutpSl12KX03HCMIU8Ke4HZx1ErbDt+SqGDN73v8f7Ojw5ZGXfuC0DIKHKkedFbPHPMmO0GSCBHPc0XzF7ws5J5+c7M2fG0ocX9FgHR8SjVJeFjNWieNbvQXsqS2MM0UEyMlQ1bAuWSeGFplFW4dvuGo/bKkjbeHbVrkLoltrKT7bVKZZVIOkVjmQwmrmMgy8Kkr0tOjFckOUhC7SQMho1VloyugxNMdf9selQ735ah7IzvXeuGjem+jI4eATF6NryjrkUKzpq/kg87ycjbBlfdMTJDgMUbV9SPiKnWYO2DI3qTSZiGqVuBKFOP7LGvseYYAVKrxh3/9suRvnA/6F9NrL1i8+BKTkz7Y57cSDmD05FqfKas6E4ZGg5ddz2P6buiGdN4Xt1SvH 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:(13230028)(4636009)(376002)(346002)(396003)(39860400002)(136003)(451199021)(40470700004)(46966006)(36840700001)(31686004)(84970400001)(40460700003)(70586007)(478600001)(70206006)(6486002)(86362001)(316002)(36756003)(47076005)(83380400001)(26005)(53546011)(186003)(6512007)(36860700001)(6506007)(336012)(2616005)(8936002)(8676002)(44832011)(2906002)(5660300002)(40480700001)(82310400005)(81166007)(82740400003)(31696002)(41300700001)(356005)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2023 21:30:00.2283 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97af2606-6e82-49d9-393f-08db558b89bd 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: AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5573 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,NICE_REPLY_A,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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 5/15/23 20:38, Andrew Burgess via Gdb-patches wrote: > After this commit: > > commit a68f7e9844208ad8cd498f89b5100084ece7d0f6 > Date: Tue May 9 10:28:42 2023 +0100 > > gdb/testsuite: extend special '^' handling to gdb_test_multiple > > buildbot notified me of a regression on s390 in the test: > > gdb.base/break-main-file-remove-fail.exp > > the failure looks like this: > > print /d ((int (*) (void *, size_t)) munmap) (16781312, 4096) > warning: Error removing breakpoint 0 > $2 = 0 > (gdb) FAIL: gdb.base/break-main-file-remove-fail.exp: cmdline: get integer valueof "((int (*) (void *, size_t)) munmap) (16781312, 4096)" > > The above commit changed get_integer_valueof so that no output is > expected between the command and the '$2 = 0' line. In this case the > 'warning: Error removing breakpoint 0' output is causing the > get_integer_valueof call to fail. > > The reason for this warning is that this test deliberately calls > munmap on a page of the inferior's code. The test is checking that > GDB can handle the situation where a s/w breakpoint can't be > removed (due to the page no longer being readable/writable). > > The test that is supposed to trigger the warning is later in the test > script when we delete a breakpoint. > > So why does s390 trigger the breakpoint earlier during the inferior > call? > > The s390 target uses AT_ENTRY_POINT as it's strategy for handling > inferior calls, that is, the trampoline that calls the inferior > function is places at the program's entry point, e.g. often the _start > label. > > If this location happens to be on the same page as the test script > unmaps then when the inferior function call returns GDB will not be > able to remove the temporary breakpoint that is inserted to catch the > inferior function call returning! As a result we end up seeing the > warning earlier than expected. > > I did wonder if this means I should relax the pattern in > get_integer_valueof - just accept that there might be additional > output from GDB which we should ignore. > > However, I don't think this the right way to go. With the change in > a68f7e984420 we are now stricter for GDB emitting warnings, and I > think that's a good thing. > > So, I think, in this case, in order to handle the possible extra > output, we should implement something like get_integer_valueof > directly in the gdb.base/break-main-file-remove-fail.exp test script. > > After this the test once again passes on s390. > --- > .../gdb.base/break-main-file-remove-fail.exp | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > > diff --git a/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp b/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp > index 66ccc60a21a..c7cf4f3df00 100644 > --- a/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp > +++ b/gdb/testsuite/gdb.base/break-main-file-remove-fail.exp > @@ -89,7 +89,22 @@ proc test_remove_bp { initial_load } { > set align_addr [expr $bp_addr - $bp_addr % $pagesize] > set munmap_prototype "int (*) (void *, size_t)" > set munmap_expr "(($munmap_prototype) munmap) ($align_addr, $pagesize)" > - set munmap [get_integer_valueof $munmap_expr -1] > + > + # Use gdb_test_multiple here rather than get_integer_valueof. > + # Targets that use the AT_ENTRY_POINT strategy for inferior > + # function calls will place a breakpoint near the entry point > + # to catch the return from the inferior function call, and > + # this is likely on the page we are about to unmap. As a > + # consequence we will see the warning about being unable to > + # remove the breakpoint here, which throws off > + # get_integer_valueof. > + set munmap -1 > + gdb_test_multiple "print /d ${munmap_expr}" "get result of munmap call" { > + -re -wrap "^(?:warning: Error removing breakpoint $::decimal\r\n)?\\$\[0-9\]* = (\[-\]*\[0-9\]*).*" { > + set munmap $expect_out(1,string) > + pass $gdb_test_name > + } > + } > > if {$munmap != 0} { > unsupported "can't munmap foo's page" > > base-commit: 6a1cf1bfedbcdb977d9ead3bf6a228360d78cc1b Thanks for the patch. I was chasing this one as well, as it also fails for arm and aarch64. From what I noticed, it also fails for ppc/ppc64. LGTM.