Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: Pedro Alves <pedro@codesourcery.com>,
	Michael Snyder <msnyder@vmware.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] fix crasher on detach command
Date: Tue, 08 Jun 2010 02:42:00 -0000	[thread overview]
Message-ID: <AANLkTim8gYEQymhGHvrsyp3VJ3GK0g6sXjYhMsSHzg-g@mail.gmail.com> (raw)
In-Reply-To: <201006071928.19374.pedro@codesourcery.com>

On Tue, Jun 8, 2010 at 02:28, Pedro Alves <pedro@codesourcery.com> wrote:
> On Monday 07 June 2010 19:11:02, Michael Snyder wrote:
>> Hi,
>>
>> The circumstances are, detach from a remote target that doesn't have
>> threads.  Remote.c leaves the PID arbitrarily as "42000", and
>> target_detach calls remove_breakpoints_pid, which crashes because
>> find_inferior_pid returns NULL.
>
> It shouldn't matter that the PID is arbitrary; there should be an
> inferior with that PID in the inferior list.  This probably means
> that the inferior got its PID cleared to 0 already when you get here?
> How?
>
> What's the backtrace like at the time of the crash?  I assume
> the remove_breakpoints_pid call is coming from within target_detach?
>
>>
>> The patch just adds a test for NULL.
>>
>>
>
>
> --
> Pedro Alves
>

I suggest we have a gdb_assert after this "struct inferior *inf =
find_inferior_pid (pid);"

Thanks,
Hui


  parent reply	other threads:[~2010-06-08  2:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-07 18:11 Michael Snyder
2010-06-07 18:28 ` Pedro Alves
2010-06-07 18:31   ` Michael Snyder
2010-06-07 18:37     ` Pedro Alves
2010-06-07 19:00       ` Michael Snyder
2010-06-07 19:09         ` Pedro Alves
2010-06-07 19:12           ` Pedro Alves
2010-06-07 23:50             ` Michael Snyder
2010-06-08 12:56               ` Pedro Alves
2010-06-08  0:11             ` Michael Snyder
2010-06-08 12:59               ` Pedro Alves
2010-06-08 16:52                 ` Michael Snyder
2010-06-08  2:42   ` Hui Zhu [this message]
2010-06-08 12:54     ` Pedro Alves

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=AANLkTim8gYEQymhGHvrsyp3VJ3GK0g6sXjYhMsSHzg-g@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.com \
    --cc=pedro@codesourcery.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