public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: sergiodj+buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] (Ada) crash connecting to TSIM simulator
Date: Wed, 22 Nov 2017 01:50:00 -0000	[thread overview]
Message-ID: <54aa6c67f5a0d52dabd428cc40ce02781032acd3@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 54aa6c67f5a0d52dabd428cc40ce02781032acd3 ***

Author: Joel Brobecker <brobecker@adacore.com>
Branch: master
Commit: 54aa6c67f5a0d52dabd428cc40ce02781032acd3

(Ada) crash connecting to TSIM simulator

Connecting to a TSIM simulator over the remote protocol causes GDB
to crash with the following failed assertion:

    (gdb) tar remote :1234
    Remote debugging using :1234
    /[...]/gdb/ravenscar-thread.c:182: internal-error: ravenscar_update_inferior_ptid: Assertion `!is_ravenscar_task (inferior_ptid)' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n) y

What happens is the following. Upon connection to the target, GDB
sends a 'qfThreadInfo' query, which is the query asking the target
for the ID of the first thread, and TSIM replies 'm0':

    Sending packet: $qfThreadInfo#bb...Ack
    Packet received: m0

As a result of this, GDB takes the '0' as the TID, and because of it,
constructs a ptid whose value is {42000, 0, 0}. This trips our
!is_ravenscar_task check, because all it does to identify threads
corresponding to ravenscar tasks is that their lwp is null, because
that's how we construct their ptid.

But this is unfortunatly not sufficient when debugging with TSIM,
because the thread ID that TSIM returns causes the creation of
a ptid whose lwp is zero, which matches the current identification
scheme and yet is clearly not a ravenscar task.

The fix is to also make sure that the ptid's tid field is nonzero.

gdb/ChangeLog:

        * ravenscar-thread.c (is_ravenscar_task): Also verify that
        the ptid's TID is nonzero.


             reply	other threads:[~2017-11-22  1:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22  1:50 sergiodj+buildbot [this message]
2017-11-22  1:50 ` Failures on Fedora-x86_64-m64, branch master sergiodj+buildbot
2017-11-22  1:58 ` Failures on Fedora-x86_64-m32, " sergiodj+buildbot
2017-11-22  2:06 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " sergiodj+buildbot
2017-11-22  2:07 ` Failures on Fedora-s390x-m64, " sergiodj+buildbot
2017-11-22  2:18 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " sergiodj+buildbot
2017-11-22  2:27 ` Failures on Fedora-i686, " sergiodj+buildbot
2017-11-22  2:40 ` Failures on Fedora-x86_64-cc-with-index, " sergiodj+buildbot
2017-11-22  4:25 ` Failures on Ubuntu-AArch32-native-extended-gdbserver-m32, " sergiodj+buildbot
2017-11-22  4:50 ` Failures on Ubuntu-AArch32-native-gdbserver-m32, " sergiodj+buildbot
2017-11-22  5:17 ` Failures on Ubuntu-AArch32-m32, " sergiodj+buildbot

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=54aa6c67f5a0d52dabd428cc40ce02781032acd3@gdb-build \
    --to=sergiodj+buildbot@sergiodj.net \
    --cc=gdb-testers@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).