Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pedro Alves (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Sergio Durigan Junior <sergiodj@redhat.com>,	gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [review v2] Fix crash with core + TUI + run
Date: Tue, 12 Nov 2019 12:58:00 -0000	[thread overview]
Message-ID: <20191112125758.BD3BB20AF6@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1572635191000.I39e2f8b538c580c8ea5bf1d657ee877e47746c8f@gnutoolchain-gerrit.osci.io>

Pedro Alves has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/483
......................................................................


Patch Set 2: Code-Review+2

(1 comment)

This is OK, but please adjust the commit log comment, as pointed out below, before pushing.

Thanks for fixing this, and for the testcase.

| --- /dev/null
| +++ /COMMIT_MSG
| @@ -1,0 +74,20 @@ have a target already, and tries to close it (from target.c):
| +	target_close (prev); // <-- here
| +      }
| +  ...
| +
| +When the current target ('core_target') is being closed, it checks for
| +possible observers registered with it and calls them.  TUI is one of
| +those observers, it gets called, tries to update the status line, and
| +GDB crashes.
| +
| +The real problem is that we are calling 'target_close' too soon,
| +before we actually have the new target on top of the stack.

PS2, Line 84:

No, as I mentioned in a previous comment, the real problem is that
we're clearing m_stack[stratum], but forget to adjust m_top.
target_stack::unpush does that, but here I forgot to do it.
Please adjust the comment.

| +Interestingly, this scenario is covered in 'target_stack::unpush', but
| +for some reason we are not calling it here.  The fix, therefore, is to
| +call 'unpush' if there's a target on the stack.
| +
| +This patch has been tested on the Buildbot and no regressions have
| +been found.  I'm also submitting a testcase for it.
| +
| +gdb/ChangeLog:
| +2019-11-08  Sergio Durigan Junior  <sergiodj@redhat.com>

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I39e2f8b538c580c8ea5bf1d657ee877e47746c8f
Gerrit-Change-Number: 483
Gerrit-PatchSet: 2
Gerrit-Owner: Sergio Durigan Junior <sergiodj@redhat.com>
Gerrit-Reviewer: Pedro Alves <palves@redhat.com>
Gerrit-Reviewer: Sergio Durigan Junior <sergiodj@redhat.com>
Gerrit-CC: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Tue, 12 Nov 2019 12:57:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


  parent reply	other threads:[~2019-11-12 12:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-01 19:06 [review] Make sure we have a valid target on top when pushing a new target Sergio Durigan Junior (Code Review)
2019-11-04 17:02 ` Sergio Durigan Junior (Code Review)
2019-11-05 23:52 ` Pedro Alves (Code Review)
2019-11-08 21:25 ` [review v2] Fix crash with core + TUI + run Sergio Durigan Junior (Code Review)
2019-11-08 21:26 ` [review] " Sergio Durigan Junior (Code Review)
2019-11-08 23:13 ` [review v2] " Pedro Alves (Code Review)
2019-11-08 23:14 ` Pedro Alves (Code Review)
2019-11-08 23:21 ` Pedro Alves (Code Review)
2019-11-09  0:05 ` Simon Marchi (Code Review)
2019-11-09  0:11 ` Simon Marchi (2) (Code Review)
2019-11-12 12:58 ` Pedro Alves (Code Review) [this message]
2019-11-19  0:12 ` Sergio Durigan Junior (Code Review)
2019-11-19  0:15 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-11-19  0:15 ` Sourceware to Gerrit sync (Code Review)

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=20191112125758.BD3BB20AF6@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=gdb-patches@sourceware.org \
    --cc=gnutoolchain-gerrit@osci.io \
    --cc=sergiodj@redhat.com \
    --cc=simon.marchi@polymtl.ca \
    /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