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: Yao Qi <qiyaoltc at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Date: Thu, 02 Apr 2015 15:53:00 +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>
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? 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.
How about removing it?
--
Yao (éå)
From: Yao Qi <yao.qi@linaro.org>
Date: Thu, 2 Apr 2015 15:38:49 +0100
Subject: [PATCH] Remove unnecessary call to alarm
It is unnecessary to call alarm, and this causes some fails when
tests are running on some arm board.
gdb/testsuite:
2015-04-02 Yao Qi <yao.qi@linaro.org>
* gdb.threads/non-stop-fair-events.c (main): Don't call
alarm.
diff --git a/gdb/testsuite/gdb.threads/non-stop-fair-events.c
b/gdb/testsuite/gdb.threads/non-stop-fair-events.c
index 6a9d31d..8ce8fe8 100644
--- a/gdb/testsuite/gdb.threads/non-stop-fair-events.c
+++ b/gdb/testsuite/gdb.threads/non-stop-fair-events.c
@@ -64,8 +64,6 @@ main (void)
int res;
int i;
- alarm (60);
-
signal (SIGUSR1, handler);
for (i = 0; i < NUM_THREADS; i++)