From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2070.outbound.protection.outlook.com [40.107.22.70]) by sourceware.org (Postfix) with ESMTPS id 3ED083856DC8 for ; Wed, 4 May 2022 09:42:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3ED083856DC8 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=mNPCOvKlVb7g0G6bLnAuKd5N5TarH0g1mjPy3+hrW0+w/c/55v16exGFSnh7g+aG5zluMjcljBITJ/AkTSraVzLybExpL34N3TwuRFX8e0AQEVl8bCpP3X2Dm3n4gSyxnETig8CF1jkW/HjYdXqOb0nKOMcTqKejPSUXaqjdYwIKQ5aobvb/wpZU4R55U2203LFRpb1u48LpCmWr4fwzkZYP2mS6lJRs7ClgqQPCBtYxTAOeVgLnWkM7KKOfCoDev9UUJSzBSXJWTuPzbjCA5Fm6ibYkzzkswSOUuPnkwpHPUlsH7FvJcVl369zAXNV5qUNjTYLM9p/+CQT/N4ZGuQ== 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=Y8th0NWIq4/TpiTMiv8GnW7kyLglbdd2xXGDdqywm9M=; b=aAJwnejiK35n1isy1tOXfqVQBZjU++/gPonuehOY1zZmSv97CJn67irHfWtHneTaJh9udQFKB6lK+PfGEEwt6ioAtZWuZJ6LtCFvj1IOW24iFpWF8Fs421LwV0f1EiraRXC8wF6rTo/xyyDoNOA6MqvON/Obyow7kbTf5D25ul8nF84c+FkeZzOhzfIgcJ5yM82rXf77h2UXOP5bRbxatxvDsah7d0gJjA+V2giOfjvhrU+SuWheFcVJIxvSm0LW2KZ5nqt6bRBDtDAdoVfP9DhS+wyUd3OWrQQR4sfUg9GW8GgWIEy3byNX2/eINGPdqocVJrm8ujcnZ4GqfhzU/A== 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 AS8PR04CA0127.eurprd04.prod.outlook.com (2603:10a6:20b:127::12) by VI1PR08MB3376.eurprd08.prod.outlook.com (2603:10a6:803:7a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13; Wed, 4 May 2022 09:42:44 +0000 Received: from VE1EUR03FT027.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:127:cafe::5) by AS8PR04CA0127.outlook.office365.com (2603:10a6:20b:127::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.25 via Frontend Transport; Wed, 4 May 2022 09:42:44 +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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT027.mail.protection.outlook.com (10.152.18.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.15 via Frontend Transport; Wed, 4 May 2022 09:42:44 +0000 Received: ("Tessian outbound ab7864ef57f2:v118"); Wed, 04 May 2022 09:42:43 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b0d442070b895e82 X-CR-MTA-TID: 64aa7808 Received: from 1840a5c5e6e2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0D558E9C-9D21-4D94-B969-C247C5FAE2E2.1; Wed, 04 May 2022 09:42:37 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1840a5c5e6e2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 04 May 2022 09:42:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MBzj6rvQVDra8ViNNNpJfvnPSwdbtfUCDl08VY2XE/mpaayGzmZ2grKsGHGV6z4ESVGXHUZF44QkJUV8Aywwbvplf8QukUe8XY+ND6E7kkgG3JkaTeIjKYDi/j4xByDdEYagLXux/ucKGQqWjtPWAKjDqlqdr643w14XR+ZJ00gePcc1ZrbBA/QspWdcp1M7m8BptJnEepSNBjc4dHMZR57tmxfK1hbkskdVinhoeMV5+j6+gea87DA5suajb2lUed9q+RhODPsztvUqZJVYdcGIAPzGrmKd81cYbLIRbMR28Wtb7C4iFYv5t1r2pTxOQjvLAPDa7aZ84D5TQARZ7w== 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=Y8th0NWIq4/TpiTMiv8GnW7kyLglbdd2xXGDdqywm9M=; b=P3jAc/Puj1OLuXvNneVCPkqnGnXsS4rnrA45ZyAE7HUAkyrb8u+/J72uAl71XgkH6t7IdV6j6lGyjErKqFL9mSoYYJVi80D1C57551L3kX4zJnWUwqPdxa/dazqf37rwU2onhFbFigwpS1QWHjBCLkMWyWZU0JBOGO1xlrUfIUi+El+7aWrijRj41SyLoCyKLQD6K7eV+3NBQVizcfcKpfBzUlohjCXojvrsbmpakek5TmE4be5UbAqvyb8gb87LyHbQNCTonrDAEZpgjFl66ixosEtk3uwQjGDe/lWGLPIsG4GRR3vTWtVxkqgBnnXMve0DaUAAHb/LfV5p1CmJ3Q== 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 DB8PR08MB3932.eurprd08.prod.outlook.com (2603:10a6:10:a2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Wed, 4 May 2022 09:42:35 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::7080:6233:cf8f:a8a6]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::7080:6233:cf8f:a8a6%7]) with mapi id 15.20.5206.025; Wed, 4 May 2022 09:42:35 +0000 Message-ID: Date: Wed, 4 May 2022 10:42:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 0/2] Fix gdbserver/linux memory access regression Content-Language: en-US To: Pedro Alves , gdb-patches@sourceware.org References: <20220419224739.3029868-1-pedro@palves.net> <26ee78d5-d9ff-3ec3-5767-c6ae8cd5afa0@palves.net> <082d3a0a-f6a4-0e40-4e27-623a9949186c@arm.com> From: Luis Machado In-Reply-To: <082d3a0a-f6a4-0e40-4e27-623a9949186c@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SA0PR11CA0210.namprd11.prod.outlook.com (2603:10b6:806:1bc::35) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 7addc949-d0a1-4ed2-8275-08da2db2707e X-MS-TrafficTypeDiagnostic: DB8PR08MB3932:EE_|VE1EUR03FT027:EE_|VI1PR08MB3376:EE_ X-Microsoft-Antispam-PRVS: 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: 7pkpeIryjoWTGNiaqiF/Gr4eVJ0eJw6nXnofgExCasUh5sp2uGLNkIelTm6qGdW467p1bz1aUCBI+GUT87F+5wgFNV15xEsIrVM968zvWY+0C796hZ2CvhkC2SAtGAWuKOXPwT2Wex3CARRlKWXj8nJpxF+rOwlGRqwBNDt6yeFP5q89e8QURFV4puiFPvJYmoPzU0mExY694gPHluw66BiAyOw/7uzli+JR17Of+OGtWYTd2LWYRyRUStYZ9YjaAa9KTCMpTo19mL5ClWp051ne3WJXelN+3yoljrRTFsczf6mPCduPQ9jRe6McWXnzSSELPZJwEioVWoAWe66obJkds2mMApjmEiBavB92hpz/4AYA0d2tOerGv1/WF7vNEpRXNnDO8Nifszrl/p1UnctAgeVxDASmTqsJ6qLDzezA0f8iq79BA3I4wlsffj6Al1mfKkUGJEMZr+FVr36bsqb3a8BJRYegt7nJCqDO20c5OfhnQxj9sHvM9Xp+dY8C9jjfJfmHWblQmPfAEfmS1Qg9yY6mdicbaS+abt+Dw2Xk/jknTx4HS3SkfCcnsFkAi+CBgQqV2Ohq7wqKxX0/4GYdmZCjhohZajLQrg447QV6rewrWVECtxpcHAvc+eb4ITV2k2WKqHuuj+sc0c8UJ+ceHqsVD+4/3DSDRNTTT0CR1v2zGR/K8aS/KvG6L9uY55RwYxHIjFVQqV9SMwZkdP9wruNZqAR98uS33S7bGuVaQKTYHXT/A/NDoBa7PtexG71LujJJWZ1+M3/lEw0l0/vpzA9EyKMRVvBM5gWvUf7mo6mG8HegdwbG7NjJE8j/ 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:(13230001)(4636009)(366004)(8676002)(66556008)(66946007)(31686004)(66476007)(83380400001)(5660300002)(316002)(8936002)(6486002)(508600001)(36756003)(2906002)(44832011)(6512007)(86362001)(26005)(31696002)(53546011)(6506007)(38100700002)(6666004)(84970400001)(2616005)(186003)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB3932 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: VE1EUR03FT027.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3103f62e-633a-4ae8-70a8-08da2db26b3c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ffCyqjDa/9Y5cFQ+1HVeLdXwqHDtXsUjDgxJanWaeiq95p7BuMwJjE2XSw+0iFH0HvGIK3uSdcm7kCldzIcNl1FK/ofC/2t5MIewPrY4tzx20rM1w4X2nQ7ig1sWTEau3WaJlKwMdc4orOYtV7iOl04fcCyYeEApSgQOLOP9M/ihLAqN7FgpGf4uq1Wl2O1hOZWM2xQ4QcctTVoeQi2CQJOC02ohQ+W5lMGMBnSFZxoQvViU/8tWkFnQ0pwJdiGojhlnfNJZhJdPtVDzBcYpe54by0ELElScap5ZnqoDBSnocBH8JFvAHMIX3ue+avf+/yPF9/E7EdfhIaJ3JjnaJeJx7ChvypsEvHI23ezw5P2otn+Ae0sSDt2Vx4ctOoYz+kiUQcNARG4tHHiwQGWS3QPqW8Xce2/g9oUcOnHKOaZBZKwUW1nPITwd+yLXjUjm/HzjiEtiU3KA+LIqrN6FGfxmhGb9gzAwHhN6tSmDUY4eUB3GmkjtT9iV4qZF3de5qcs8a+SRXLcmVloNviVzLZCjAsILgr1JYuaMpNh7pDfSSO2G84btSCM6g4+keKYp2QMmF1T2eG0jLNzEtCdA+fE+gVKY/nE4lRyD1SuxbBijTptDtkfA2MPpCgTm5nLdm9H7ZqegfcnZVXYO1BWb3rvWesXSBxj5TZPy2WE9XSlIYkyC09QJLdKNBpfeFxXaIeijGYt/7hEZkma/wqr0mvBfCklNAo4rz7a6tknFIwedrLKhCwC1GlspHc8px4gO7WckCA0DIvLqjUsW6w/UoE0462CBxJEjtwMaUiJ6evg= 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:(13230001)(4636009)(46966006)(36840700001)(40470700004)(6486002)(8676002)(70586007)(70206006)(2616005)(40460700003)(83380400001)(5660300002)(508600001)(84970400001)(44832011)(6512007)(26005)(81166007)(8936002)(36756003)(6506007)(316002)(53546011)(186003)(2906002)(6666004)(47076005)(336012)(82310400005)(36860700001)(356005)(31696002)(31686004)(86362001)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2022 09:42:44.0011 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7addc949-d0a1-4ed2-8275-08da2db2707e 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: VE1EUR03FT027.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3376 X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY 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: 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: , X-List-Received-Date: Wed, 04 May 2022 09:42:50 -0000 On 5/4/22 10:11, Luis Machado via Gdb-patches wrote: > On 5/3/22 15:24, Pedro Alves wrote: >> On 2022-04-19 23:47, Pedro Alves wrote: >>> The recent change to make GDBserver always access memory via >>> /proc/pid/mem caused a regression in >>> gdb.threads/access-mem-running-thread-exit.exp that I somehow missed. >>> This is actually a pre-existing GDBserver issue being now exposed. >>> >>> Patch #2 fixes the GDBserver bug. >>> >>> Patch #1 fixes the gdb.threads/access-mem-running-thread-exit.exp >>> testcase itself -- it doesn't run properly against >>> --target_board=native-extended-gdbserver today. >>> >> >> I'm pushing this in. > > Just a heads-up, this seems to have regressed a few gdb.multi/*.exp > tests for aarch64-linux. > > I see the following internal error for > gdb.multi/multi-target-continue.exp for example: > > Starting program: > binutils-gdb/gdb/testsuite/outputs/gdb.multi/multi-target-continue/multi-target-continue > ^M > Error in re-setting breakpoint 2: Remote connection closed^M > ../../../repos/binutils-gdb/gdb/thread.c:85: internal-error: > inferior_thread: Assertion `current_thread_ != nullptr' failed.^M > A problem internal to GDB has been detected,^M > further debugging may prove unreliable. > > I haven't investigated this yet. Ok. I tracked this down to gdbserver crashing when trying to fetch the register cache using a nullptr for the thread pointer. This happens when trying to read memory, then the backend goes to try to figure out if it is 64-bit and then eventually tries to fetch the regcache with current_thread (nullptr). I'm guessing we should really be using the process pointer if there isn't a valid thread pointer to fetch the register data.