public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "andrew.burgess at embecosm dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/26819] RISC-V: internal-error: int finish_step_over(execution_control_state*): Assertion
Date: Thu, 03 Jun 2021 21:38:45 +0000	[thread overview]
Message-ID: <bug-26819-4717-YbOzZY7eH5@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26819-4717@http.sourceware.org/bugzilla/>

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

--- Comment #40 from Andrew Burgess <andrew.burgess at embecosm dot com> ---
Final comment for the night.  I now have this test passing reliably, I changed
the file spike-2-hwthread.cfg (this is one of the files that the steps to
reproduce document has us download), this is the openocd config file.  Within
this file are two lines like this:

  target create $_TARGETNAME_0 riscv -chain-position $_CHIPNAME.cpu -rtos
hwthread
  target create $_TARGETNAME_1 riscv -chain-position $_CHIPNAME.cpu -coreid 1

I changed these lines to be this:

  target create $_TARGETNAME_0 riscv -chain-position $_CHIPNAME.cpu -rtos
hwthread -coreid 0
  target create $_TARGETNAME_1 riscv -chain-position $_CHIPNAME.cpu -rtos
hwthread -coreid 1

And now the test passes just fine.

As I've said in previous comments, I'm no openocd expert, I added the extra
'-rtos hwthread' for the second core as it is the presence of this rtos setting
that is causing openocd to send back the thread-id.  Maybe there's more going
on here and adding this flag is bad for some reason?  I added the '-coreid 0'
to the first core just for symmetry, I suspect 0 is the default.

Unless there's new evidence that comes up, I'm pretty convinced that the issue
here was either openocd has a bug, or openocd was misconfigured, however,  I
think there is an open issue for whether GDB could/should have handled this
situation better?

I think that the packets coming from the remote should be considered user
input, and as such, we should not rely on them being "correct".  As such, when
invalid packets arrive GDB should be throwing an error, not quitting with an
assertion failure.

I'm not really sure where we should be catching this particular error, or what
we should do.  I doubt we can reasonably expect to recover, I think the target
has shown itself to be unreliable in this case (reporting a stop against a
thread that should not be running)...

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

  parent reply	other threads:[~2021-06-03 21:38 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30 16:11 [Bug gdb/26819] New: " jmatyas at codasip dot com
2020-10-30 16:13 ` [Bug gdb/26819] " jmatyas at codasip dot com
2020-11-08  9:07 ` [Bug gdb/26819] RISC-V: " jmatyas at codasip dot com
2020-11-08 10:07 ` andrew.burgess at embecosm dot com
2020-11-08 11:10 ` jmatyas at codasip dot com
2020-11-08 11:13 ` jmatyas at codasip dot com
2020-11-09  9:51 ` andrew.burgess at embecosm dot com
2021-01-06  6:37 ` jmatyas at codasip dot com
2021-01-06  9:35 ` andrew.burgess at embecosm dot com
2021-01-08 11:03 ` jmatyas at codasip dot com
2021-01-08 16:09 ` simark at simark dot ca
2021-01-14  1:27 ` cvs-commit at gcc dot gnu.org
2021-01-14  1:29 ` simark at simark dot ca
2021-01-14  9:11 ` andrew.burgess at embecosm dot com
2021-01-14  9:41 ` jmatyas at codasip dot com
2021-01-16 11:00 ` jmatyas at codasip dot com
2021-01-16 11:03 ` jmatyas at codasip dot com
2021-01-16 11:04 ` jmatyas at codasip dot com
2021-01-17  3:36 ` simark at simark dot ca
2021-01-17 22:37 ` jmatyas at codasip dot com
2021-01-17 22:38 ` jmatyas at codasip dot com
2021-01-17 22:39 ` jmatyas at codasip dot com
2021-01-18  5:15 ` simark at simark dot ca
2021-01-18 11:01 ` jmatyas at codasip dot com
2021-01-18 15:23 ` sebastian.huber@embedded-brains.de
2021-01-27 12:35 ` jmatyas at codasip dot com
2021-01-27 16:00 ` simark at simark dot ca
2021-02-07 21:20 ` jmatyas at codasip dot com
2021-02-08  2:00 ` simon.marchi at polymtl dot ca
2021-02-08  2:02 ` simon.marchi at polymtl dot ca
2021-02-20 20:51 ` simark at simark dot ca
2021-02-24  9:17 ` jmatyas at codasip dot com
2021-02-25  7:41 ` jmatyas at codasip dot com
2021-02-25 20:50 ` simark at simark dot ca
2021-03-04 23:23 ` jmatyas at codasip dot com
2021-03-04 23:24 ` jmatyas at codasip dot com
2021-03-04 23:25 ` jmatyas at codasip dot com
2021-03-04 23:25 ` jmatyas at codasip dot com
2021-03-04 23:27 ` simark at simark dot ca
2021-03-04 23:46 ` jmatyas at codasip dot com
2021-03-04 23:49 ` jmatyas at codasip dot com
2021-06-03 20:41 ` andrew.burgess at embecosm dot com
2021-06-03 21:19 ` andrew.burgess at embecosm dot com
2021-06-03 21:38 ` andrew.burgess at embecosm dot com [this message]
2021-06-06 14:28 ` brobecker at gnat dot com
2021-06-07  5:28 ` jmatyas at codasip dot com
2021-06-07  8:30 ` andrew.burgess at embecosm dot com
2021-08-06  1:41 ` lennordocdoc0921 at gmail dot com
2022-04-09 15:07 ` [Bug tdep/26819] " tromey at sourceware dot org
2022-11-29 19:38 ` tromey at sourceware dot org

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-26819-4717-YbOzZY7eH5@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).