public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: Pedro Alves <palves@redhat.com>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Delete program spaces directly when removing inferiors
Date: Wed, 08 Jul 2015 18:40:00 -0000	[thread overview]
Message-ID: <559D6E89.5040709@ericsson.com> (raw)
In-Reply-To: <559D6935.7060103@redhat.com>

On 15-07-08 02:17 PM, Pedro Alves wrote:
> Hmm, I think it'll fix a bug, actually.  There should always
> be an inferior.  And that deletes it.  So I assume
> that after closing the monitor target, GDB crashes as soon as
> it refers to the current inferior...
> 
> In the original multi-process support (~7.0), that was not the
> case -- if you were not debugging a process, there's be
> no inferior.  Seems like this code has bit rotten.

Ok, I had this intuition as well (about deleting the last inferior).

> I guess this suggests that no one's been using these monitor
> targets for a long while?

Or they don't mind/notice that it crashes at exit.

>>
>> Is there any way to test that code path relatively easily on x86?
>>
> 
> Don't think so.  You could stick a:
> 
>   delete_inferior_silent (ptid_get_pid (monitor_ptid));
> 
> call in remote.c:remote_close and see what happens there though.

I tried something similar (monitor_ptid is not available there), and
bad things happen indeed.

I'll try to update my patch to use discard_all_inferiors, but it will
be a "theoretical" fix, since there's no way to test.

Thanks!

  reply	other threads:[~2015-07-08 18:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29 20:33 Simon Marchi
2014-10-20 17:46 ` Simon Marchi
2014-12-01 13:25   ` Simon Marchi
2015-07-06 17:46     ` Simon Marchi
2015-07-08 12:05 ` Pedro Alves
2015-07-08 15:34   ` Simon Marchi
2015-07-08 15:43     ` Simon Marchi
2015-07-08 15:59       ` Pedro Alves
2015-07-08 18:10         ` Simon Marchi
2015-07-08 18:17           ` Pedro Alves
2015-07-08 18:40             ` Simon Marchi [this message]
2015-07-08 18:51               ` Pedro Alves
2015-07-08 19:44                 ` Simon Marchi
2015-07-08 19:49                   ` Simon Marchi

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=559D6E89.5040709@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).