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]

[patch] testsuite: fork-thread-pending: safety alarm


Hi,

I got a stale/hanging process:

15458 ?        SNl   19:19 /unsafe/home/jkratoch/hammock/20130216Build-fedoragdb-f17/fedora-17-x86_64/build/gdb-7.4.50.20120120/build-x86_64-redhat-linux-gnu/gdb/testsuite.unix.-m64.-fPIC.-pie/gdb.threads/fork-thread-pending
15473 ?        SNl    2:10  \_ /unsafe/home/jkratoch/hammock/20130216Build-fedoragdb-f17/fedora-17-x86_64/build/gdb-7.4.50.20120120/build-x86_64-redhat-linux-gnu/gdb/testsuite.unix.-m64.-fPIC.-pie/gdb.threads/fork-thread-pending

I do not see a reason why, GDB successfully finished according to the log.
GDB should then kill the child which should also end the parent.

But for example if GDB crashed during its exit then testcase will run forever.

So I will check in this safety alarm.  This may make interactive debugging of
the testcase with GDB more difficult but one can remove the alarm easily in
such case IMO.


Thanks,
Jan


gdb/testsuite/
2013-02-18  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.threads/fork-thread-pending.c (main): Add alarm.

diff --git a/gdb/testsuite/gdb.threads/fork-thread-pending.c b/gdb/testsuite/gdb.threads/fork-thread-pending.c
index 43188bd..1c06c0b 100644
--- a/gdb/testsuite/gdb.threads/fork-thread-pending.c
+++ b/gdb/testsuite/gdb.threads/fork-thread-pending.c
@@ -94,6 +94,8 @@ main (void)
   int args[NUMTHREADS];
   int i, j;
 
+  alarm (600);
+
   i = pthread_barrier_init (&barrier, NULL, NUMTHREADS);
   assert (i == 0);
 


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