Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [RFA] gdbserver crash in gdb/gdbserver/thread.c::thread_search_callback
Date: Mon, 21 Dec 2015 16:53:00 -0000	[thread overview]
Message-ID: <56782E78.8070400@redhat.com> (raw)
In-Reply-To: <1450710922-29601-1-git-send-email-brobecker@adacore.com>

On 12/21/2015 03:15 PM, Joel Brobecker wrote:
> Connecting GDB to a LynxOS-178 GDBserver causes GDBserver to crash:
> 
>     % gdbserver :4444 simple_main
>     Process simple_main created; pid = 19
>     Listening on port 4444
>     Remote debugging from host 205.232.38.10
>     Segmentation fault (core dumped)
> 
> We saw this crash on LynxOS and also when using GDBserver on Windows.
> 
> The crash happens in thread_search_callback where the function
> calls the_target->thread_stopped (via the thread_stopped macro)
> without verifying whether the callback is NULL or not.
> 
> For the record, the regression was introduced by:
> 
>     commit a67a9faef0e32886c83611cc7a0ba61e91123063
>     Date:   Mon Nov 30 16:05:26 2015 +0000
>     Subject: gdbserver:prepare_access_memory: pick another thread
> 

Whoops, sorry about that.

> gdb/gdbserver/ChangeLog:
> 
>         * target.c (thread_search_callback): Add check that
>         the thread_stopped target callback is not NULL before
>         calling it.
> 
> Does the fix look good to you?
> Tested on both Windows (native gdbserver) and LynxOS using
> AdaCore's gdb-testsuite.

LGTM.

Thanks,
Pedro Alves


  reply	other threads:[~2015-12-21 16:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-21 15:15 Joel Brobecker
2015-12-21 16:53 ` Pedro Alves [this message]
2015-12-22 15:27   ` pushed: " Joel Brobecker

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=56782E78.8070400@redhat.com \
    --to=palves@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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