This is the mail archive of the
mailing list for the GDB project.
Re: [RFA] gdbserver crash in gdb/gdbserver/thread.c::thread_search_callback
- From: Pedro Alves <palves at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>, gdb-patches at sourceware dot org
- Date: Mon, 21 Dec 2015 16:53:12 +0000
- Subject: Re: [RFA] gdbserver crash in gdb/gdbserver/thread.c::thread_search_callback
- Authentication-results: sourceware.org; auth=none
- References: <1450710922-29601-1-git-send-email-brobecker at adacore dot 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 18.104.22.168
> 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.
> * 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.