This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] fix crasher on detach command


On Monday 07 June 2010 19:31:26, Michael Snyder wrote:
> Pedro Alves 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?
> 
> It was a bad connect, which aborted part way through.
> So yes, we're in an inconsistent internal state.

Then we need to fix that, instead of adding workarounds in other
areas.

> > What's the backtrace like at the time of the crash?  I assume
> > the remove_breakpoints_pid call is coming from within target_detach?
> 
> It's fairly normal, target_detach is called by detach_command.

Okay.  What I was interested was in seeing a paste of the
backtrace, to confirm that's the where the call to
remove_breakpoints_pid is being done, but what you say seems
to confirm it.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]