From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 99A02385B834; Mon, 22 Jun 2020 10:18:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99A02385B834 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/25939] [10 regression] run fails with ICE on Solaris Date: Mon, 22 Jun 2020 10:18:31 +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: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: ro at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.1 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 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2020 10:18:31 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25939 --- Comment #6 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Pedro Alves : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df809832224cc= 45eb58812f6d4bb03cbf52fad980 commit f809832224cc45eb58812f6d4bb03cbf52fad980 Author: Pedro Alves Date: Mon Jun 22 10:54:08 2020 +0100 Solaris, target_wait(), don't rely on inferior_ptid Debugging on Solaris is broken, with the procfs target backend failing with: procfs: couldn't find pid 0 in procinfo list. as soon as you start a program. The problem is procfs_target::wait assuming that inferior_ptid is meaningful on entry, but, since the multi-target series, inferior_ptid is null_ptid before we call target_wait, in infrun.c: static ptid_t do_target_wait_1 (inferior *inf, ptid_t ptid, target_waitstatus *status, int options) { ... /* We know that we are looking for an event in the target of inferi= or INF, but we don't know which thread the event might come from. = As such we want to make sure that INFERIOR_PTID is reset so that no= ne of the wait code relies on it - doing so is always a mistake. */ switch_to_inferior_no_thread (inf); This patch tweaks the backend to remove the assumption that inferior_ptid points at something. sol-thread.c (the thread_stratum that sits on top of procfs.c) also has the same issue. Some spots in procfs_target::wait were returning TARGET_WAITKIND_SPURIOUS+inferior_ptid. This commit replaces those with waiting again without returning to the core. This fixes the relying on inferior_ptid, and also should fix the issue discussed here: https://sourceware.org/pipermail/gdb/2020-May/048616.html https://sourceware.org/pipermail/gdb/2020-June/048660.html gdb/ChangeLog: 2020-06-22 Pedro Alves PR gdb/25939 * procfs.c (procfs_target::wait): Don't reference inferior_ptid. Use the current inferior instead. Don't return TARGET_WAITKIND_SPURIOUS/inferior_ptid -- instead continue and wait again. * sol-thread.c (sol_thread_target::wait): Don't reference inferior_ptid. (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs) (sol_update_thread_list_callback): Use the current inferior's p= id instead of inferior_ptid. --=20 You are receiving this mail because: You are on the CC list for the bug.=