public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.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	[thread overview]
Message-ID: <bug-25939-4717-RR1F6gtwbt@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-25939-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=25939

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pedro Alves <palves@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f809832224cc45eb58812f6d4bb03cbf52fad980

commit f809832224cc45eb58812f6d4bb03cbf52fad980
Author: Pedro Alves <palves@redhat.com>
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 inferior
           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 none
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  <palves@redhat.com>

            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 pid
            instead of inferior_ptid.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2020-06-22 10:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 11:11 [Bug gdb/25939] New: " ro at gcc dot gnu.org
2020-05-07 11:11 ` [Bug gdb/25939] " ro at gcc dot gnu.org
2020-05-18 15:57 ` cvs-commit at gcc dot gnu.org
2020-05-19  8:04 ` cvs-commit at gcc dot gnu.org
2020-06-14  1:44 ` brobecker at gnat dot com
2020-06-14 15:12 ` ro at CeBiTec dot Uni-Bielefeld.DE
2020-06-21 16:34 ` cvs-commit at gcc dot gnu.org
2020-06-22 10:18 ` cvs-commit at gcc dot gnu.org [this message]
2020-06-22 10:20 ` palves at redhat dot com
2020-06-22 18:19 ` brobecker at gnat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-25939-4717-RR1F6gtwbt@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).