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


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++)


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