This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 8/8] add non-stop test that stresses thread starvation issues
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Mon, 06 Apr 2015 12:26:21 +0100
- Subject: Re: [PATCH 8/8] add non-stop test that stresses thread starvation issues
- Authentication-results: sourceware.org; auth=none
- References: <1419625871-28848-1-git-send-email-palves at redhat dot com> <1419625871-28848-9-git-send-email-palves at redhat dot com> <551D57CC dot 9050403 at gmail dot com>
On 04/02/2015 03:53 PM, Yao Qi wrote:
> Hi, Pedro,
>
> On 26/12/14 20:31, Pedro Alves wrote:
>> +int
>> +main (void)
>> +{
>> + int res;
>> + int i;
>> +
>> + alarm (60);
>
> Is there any reason to call alarm here?
Yes, the test runs forever otherwise. See:
https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Don.27t_write_tests_that_run_forever
How about fixing this like attach-many-short-lived-threads.exp was
fixed here:
https://sourceware.org/ml/gdb-patches/2015-02/msg00152.html
?
> It causes some fails on
> arm-linux, that is, the board is slow, and alarm is triggered.
> Then thread is disappeared and current_thread is set to NULL.
> GDB/GDBserver doesn't know about that. When the inferior memory is
> accessed, current_thread is dereferenced, and GDBserver is crashed.
Sounds like we should have a test that explicitly covers that.
GDBserver shouldn't crash.
--
Pedro Alves