Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Stephan Rohr <stephan.rohr@intel.com>
Cc: gdb-patches@sourceware.org,  guinevere@redhat.com
Subject: Re: [PATCH vv2 1/1] gdb: fix assert after register write failure
Date: Mon, 19 Oct 2026 10:19:10 -0600	[thread overview]
Message-ID: <87o6cp1x4x.fsf@tromey.com> (raw)
In-Reply-To: <20261015141127.152846-2-stephan.rohr@intel.com> (Stephan Rohr's message of "Thu, 15 Oct 2026 14:11:27 +0000")

>>>>> "Stephan" == Stephan Rohr <stephan.rohr@intel.com> writes:

Stephan> From: Eduard Sargsyan <eduard.sargsyan@intel.com>
Stephan> GDB tries to invalidate register cache if write to register fails.  In case
Stephan> when write was requested to be done for a remote inferior and connection with
Stephan> remote is dead (so write request will fail) GDB cleans register caches and as
Stephan> result setting register status fails with segmentation fault, because internal
Stephan> pointers are not valid anymore and the unique_ptr with register status is
Stephan> null.

Stephan> This change adds check if register status cache is still valid before trying to
Stephan> modify (set status to UNKNOWN).

I don't mind this patch but I do wonder about it a little.

I couldn't find where m_register_status is reset.  How does this part
work?  Like, what set this to 'nullptr'?

And I wonder about the contract of this object.  I understand wanting
this particular spot to do this check.  But there are many other things
that access m_register_status.  Do those need checks, in theory, to
preserve some invariant?  Or just invalidation?

thanks,
Tom

  reply	other threads:[~2026-10-19 16:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 14:11 [PATCH v2 0/1] " Stephan Rohr
2026-10-15 14:11 ` [PATCH vv2 1/1] " Stephan Rohr
2026-10-19 16:19   ` Tom Tromey [this message]
2026-10-21 13:47     ` Rohr, Stephan
2026-10-21 17:22       ` Tom Tromey

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=87o6cp1x4x.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=guinevere@redhat.com \
    --cc=stephan.rohr@intel.com \
    /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