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: [PATCH 8/8] add non-stop test that stresses thread starvation issues


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


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