From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AF3DF3858032; Fri, 11 Nov 2022 12:47:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF3DF3858032 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668170867; bh=97XUYg2Fk9mR4YAPJjWzOPN2p5Zx5fyIivpw92oFFtk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZXobDGT4NZnhKSh9p9X8L9VKxSZGvB6tEzWUcmScab9nOzNqvc4o8qdNydfO8U2/A DI6+Mq19XyV4Z6P6eoldqoC8jCnXR2mHV0pry4Wqm9Zg/BUVc96rLG+IlzMlziE7jX ruH05GQwJu+lIJw+/YVsAgEs/YMKfz/4U4p8oBW0= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/29272] regression: previously OK rust tests crash with SIGILL/SEGV/ABRT on Debian armhf Date: Fri, 11 Nov 2022 12:47:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 11.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: luis.machado at arm dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29272 --- Comment #7 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Luis Machado : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D1e5ccb9c5ff4= fd8ade4a8694676f99f4abf2d679 commit 1e5ccb9c5ff4fd8ade4a8694676f99f4abf2d679 Author: Luis Machado Date: Tue Oct 25 11:01:32 2022 +0100 Make sure a copy_insn_closure is available when we have a match in copy_insn_closure_by_addr PR gdb/29272 Investigating PR29272, it was mentioned a particular test used to work = on GDB 10, but it started failing with GDB 11 onwards. I tracked it down to some displaced stepping improvements on commit 187b041e2514827b9d86190ed2471c4c7a352874. In particular, one of the corner cases using copy_insn_closure_by_addr = got silently broken. It is hard to spot because it doesn't have any good te= sts for it, and the situation is quite specific to the Arm target. Essentially, the change from the displaced stepping improvements made i= t so we could still invoke copy_insn_closure_by_addr correctly to return the pointer to a copy_insn_closure, but it always returned nullptr due to the order of the statements in displaced_step_buffer::prepare. The way it is now, we first write the address of the displaced step buf= fer to PC and then save the copy_insn_closure pointer. The problem is that writing to PC for the Arm target requires figuring out if the new PC is thumb mode or not. With no copy_insn_closure data, the logic to determine the thumb mode during displaced stepping doesn't work, and gives random results that are difficult to track (SIGILL, SIGSEGV etc). Fix this by reordering the PC write in displaced_step_buffer::prepare and, for safety, add an assertion to displaced_step_buffer::copy_insn_closure_by_addr so GDB stops right when it sees this invalid situation. If this gets broken again in the future, it will be easier to spot. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29272 Approved-By: Simon Marchi --=20 You are receiving this mail because: You are on the CC list for the bug.=