public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Yan, Zhiyong" <Zhiyong.Yan@windriver.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: The patch for bugzilla 30387
Date: Mon, 8 May 2023 01:24:28 +0000	[thread overview]
Message-ID: <DS0SPRMB000135CCA723713AA4680CB6E7719@DS0SPRMB0001.namprd11.prod.outlook.com> (raw)
In-Reply-To: <DS0PR11MB64479B3A4C1BAC798B3AC5AFE7729@DS0PR11MB6447.namprd11.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 1799 bytes --]

Hi,
How is this patch going ?

Best Regards
Zhiyong

From: Yan, Zhiyong
Sent: Friday, May 5, 2023 10:14 AM
To: gdb-patches@sourceware.org
Subject: The patch for bugzilla 30387

Hi,
There is a patch for https://sourceware.org/bugzilla/show_bug.cgi?id=30387, in the attachment.
Bugzilla 30387 has given the steps of producing this issue on arm platform.
Attached step5-assert.txt is a debug log which contains several "gdb step next" output.
For example, at line 29, resume_one_thread() doesn't call process_one_lwp() because  thread LWP 316.316 is pending, as a result the software breaking point is not installed. Later, if this pending thread makes "wait_1: Hit a non-gdbserver trap event." happen, stop_all_lwps() -> "prepare_resume_reply: Writing resume reply for" ->...
In such case, "gdb N" can finish without assert error.
But in step5-assert.txt, from line 14923 to 14943, we can see the pending thread make below happen,
"
wait_for_event_filtered: Got a pending child 316
362.994099   [threads] wait_for_event_filtered: Got an event from pending child 316 (117f)
362.994379   [threads] wait_1: Ignored signal 17 for LWP 316
"
In this case "resume_stopped_resumed_lwps" will resume every 'stopped-resumed' thread, but a thread (previously pending) has no software break point installed, then resume_stopped_resumed_lwps() asserts failed in maybe_hw_step().

      So, my points is:

  1.  Gdb should not assume pending threads always generate "a non-gdbserver trap event", a "Signal 17" event could happen.
  2.  Now that resume_stopped_resumed_lwps() -> may_hw_step() assumes that the break point must already exist, resume_one_thread() should ensure the software breaking point is installed although the thread is pending.

Best Regards.
Zhiyong







  reply	other threads:[~2023-05-08  1:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05  2:13 Yan, Zhiyong
2023-05-08  1:24 ` Yan, Zhiyong [this message]
2023-05-10 15:52   ` Tom Tromey
2023-05-11  6:26     ` Yan, Zhiyong

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=DS0SPRMB000135CCA723713AA4680CB6E7719@DS0SPRMB0001.namprd11.prod.outlook.com \
    --to=zhiyong.yan@windriver.com \
    --cc=gdb-patches@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).