old-cross-binutils/gdb/testsuite/gdb.threads
Don Breazeal 7868401b7b PR remote/19496, interrupted syscall in forking-threads-plus-bkpt
This patch addresses "fork:Interrupted system call" (or wait:) failures
in gdb.threads/forking-threads-plus-breakpoint.exp.

The test program spawns ten threads, each of which do ten fork/waitpid
sequences.  The cause of the problem was that when one of the fork
children exited before the corresponding fork parent could initiate its
waitpid for that child, a SIGCHLD and/or SIGSTOP was delivered and
interrupted a fork or waitpid in another thread.

The fix was to wrap the system calls in a loop to retry the call if
it was interrupted, like:

do
  {
    pid = fork ();
  }
while (pid == -1 && errno == EINTR);

Since this is a Linux-only test I figure it is OK to use errno and EINTR.
I tried a number of alternative fixes using SIG_IGN, SA_RESTART,
pthread_sigblock, and bsd_signal, but none of these worked as well.

Tested on Nios II Linux target with x86 Linux host.

gdb/testsuite/ChangeLog:
2016-03-16  Don Breazeal  <donb@codesourcery.com>

	* gdb.threads/forking-threads-plus-breakpoint.c (thread_forks):
	Retry fork and waitpid on interrupted system call errors.
	* gdb.threads/forking-threads-plus-breakpoint.exp: (do_test):
	Use with_timeout_factor to increase timeout to 90.
2016-03-16 15:13:44 -07:00
..
attach-into-signal.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
attach-into-signal.exp More "Program" -> "Thread NN received signal" testsuite adjustment 2016-03-09 20:24:14 +00:00
attach-many-short-lived-threads.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
attach-many-short-lived-threads.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
attach-stopped.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
attach-stopped.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
bp_in_thread.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
bp_in_thread.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
break-while-running.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
break-while-running.exp Reapply: List inferiors/threads/pspaces in ascending order 2016-01-12 01:12:38 +00:00
clone-new-thread-event.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
clone-new-thread-event.exp Fix PR threads/19422 - show which thread caused stop 2016-01-18 15:15:18 +00:00
clone-thread_db.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
clone-thread_db.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
continue-pending-after-query.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
continue-pending-after-query.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
continue-pending-status.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
continue-pending-status.exp Fix PR threads/19422 - show which thread caused stop 2016-01-18 15:15:18 +00:00
corethreads.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
corethreads.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
create-fail.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
create-fail.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
current-lwp-dead.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
current-lwp-dead.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
dlopen-libpthread-lib.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
dlopen-libpthread.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
dlopen-libpthread.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
execl.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
execl.exp Reapply: List inferiors/threads/pspaces in ascending order 2016-01-12 01:12:38 +00:00
execl1.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
fork-child-threads.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
fork-child-threads.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
fork-plus-threads.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
fork-plus-threads.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
fork-thread-pending.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
fork-thread-pending.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
forking-threads-plus-breakpoint.c PR remote/19496, interrupted syscall in forking-threads-plus-bkpt 2016-03-16 15:13:44 -07:00
forking-threads-plus-breakpoint.exp PR remote/19496, interrupted syscall in forking-threads-plus-bkpt 2016-03-16 15:13:44 -07:00
gcore-stale-thread.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gcore-stale-thread.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gcore-thread.exp Reapply: List inferiors/threads/pspaces in ascending order 2016-01-12 01:12:38 +00:00
hand-call-in-threads.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
hand-call-in-threads.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
hand-call-new-thread.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
hand-call-new-thread.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
ia64-sigill.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
ia64-sigill.exp More "Program" -> "Thread NN received signal" testsuite adjustment 2016-03-09 20:24:14 +00:00
info-threads-cur-sal-2.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
info-threads-cur-sal.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
info-threads-cur-sal.exp Reapply: List inferiors/threads/pspaces in ascending order 2016-01-12 01:12:38 +00:00
interrupted-hand-call.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
interrupted-hand-call.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
kill.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
kill.exp Reapply: List inferiors/threads/pspaces in ascending order 2016-01-12 01:12:38 +00:00
killed.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
killed.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
leader-exit.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
leader-exit.exp Fix PR threads/19422 - show which thread caused stop 2016-01-18 15:15:18 +00:00
linux-dp.c
linux-dp.exp More "Program" -> "Thread NN received signal" testsuite adjustment 2016-03-09 20:24:14 +00:00
local-watch-wrong-thread.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
local-watch-wrong-thread.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
manythreads.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
manythreads.exp More "Program" -> "Thread NN received signal" testsuite adjustment 2016-03-09 20:24:14 +00:00
multi-create-ns-info-thr.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
multi-create.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
multi-create.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
multiple-step-overs.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
multiple-step-overs.exp Reapply: List inferiors/threads/pspaces in ascending order 2016-01-12 01:12:38 +00:00
names.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
names.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
next-bp-other-thread.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
next-bp-other-thread.exp Reapply: List inferiors/threads/pspaces in ascending order 2016-01-12 01:12:38 +00:00
next-while-other-thread-longjmps.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
next-while-other-thread-longjmps.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
no-unwaited-for-left.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
no-unwaited-for-left.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
non-ldr-exc-1.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
non-ldr-exc-1.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
non-ldr-exc-2.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
non-ldr-exc-2.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
non-ldr-exc-3.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
non-ldr-exc-3.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
non-ldr-exc-4.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
non-ldr-exc-4.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
non-ldr-exit.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
non-ldr-exit.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
non-stop-fair-events.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
non-stop-fair-events.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
pending-step.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
pending-step.exp More "Program" -> "Thread NN received signal" testsuite adjustment 2016-03-09 20:24:14 +00:00
print-threads.c
print-threads.exp More "Program" -> "Thread NN received signal" testsuite adjustment 2016-03-09 20:24:14 +00:00
process-dies-while-handling-bp.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
process-dies-while-handling-bp.exp Move foreach_with_prefix to lib/gdb.exp 2016-01-25 13:15:11 +00:00
pthread_cond_wait.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
pthread_cond_wait.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
pthreads.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
pthreads.exp Fix PR threads/19422 - show which thread caused stop 2016-01-18 15:15:18 +00:00
queue-signal.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
queue-signal.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
reconnect-signal.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
reconnect-signal.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
schedlock.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
schedlock.exp Fix PR threads/19422 - show which thread caused stop 2016-01-18 15:15:18 +00:00
siginfo-threads.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
siginfo-threads.exp Fix PR threads/19422 - show which thread caused stop 2016-01-18 15:15:18 +00:00
signal-command-handle-nopass.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
signal-command-handle-nopass.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
signal-command-multiple-signals-pending.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
signal-command-multiple-signals-pending.exp Fix PR threads/19422 - show which thread caused stop 2016-01-18 15:15:18 +00:00
signal-delivered-right-thread.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
signal-delivered-right-thread.exp Fix PR threads/19422 - show which thread caused stop 2016-01-18 15:15:18 +00:00
signal-sigtrap.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
signal-sigtrap.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
signal-while-stepping-over-bp-other-thread.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
signal-while-stepping-over-bp-other-thread.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
sigstep-threads.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
sigstep-threads.exp More "Program" -> "Thread NN received signal" testsuite adjustment 2016-03-09 20:24:14 +00:00
sigthread.c
sigthread.exp Fix PR threads/19422 - show which thread caused stop 2016-01-18 15:15:18 +00:00
staticthreads.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
staticthreads.exp More "Program" -> "Thread NN received signal" testsuite adjustment 2016-03-09 20:24:14 +00:00
step-bg-decr-pc-switch-thread.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
step-bg-decr-pc-switch-thread.exp Reapply: List inferiors/threads/pspaces in ascending order 2016-01-12 01:12:38 +00:00
step-over-lands-on-breakpoint.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
step-over-lands-on-breakpoint.exp Reapply: List inferiors/threads/pspaces in ascending order 2016-01-12 01:12:38 +00:00
step-over-trips-on-watchpoint.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
step-over-trips-on-watchpoint.exp Reapply: List inferiors/threads/pspaces in ascending order 2016-01-12 01:12:38 +00:00
stepi-random-signal.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
stepi-random-signal.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
switch-threads.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
switch-threads.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
thread-execl.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
thread-execl.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
thread-find.exp Per-inferior/Inferior-qualified thread IDs 2016-01-13 10:59:43 +00:00
thread-specific-bp.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
thread-specific-bp.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
thread-specific.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
thread-specific.exp Add $_gthread convenience variable 2016-01-13 11:03:19 +00:00
thread-unwindonsignal.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
thread_check.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
thread_check.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
thread_events.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
thread_events.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
threadapply.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
threadapply.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
threxit-hop-specific.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
threxit-hop-specific.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
tid-reuse.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
tid-reuse.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
tls-main.c
tls-nodebug.c
tls-nodebug.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
tls-shared.c
tls-shared.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
tls-so_extern.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
tls-so_extern.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
tls-so_extern_main.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
tls-var-main.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
tls-var.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
tls-var.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
tls.c
tls.exp More "Program" -> "Thread NN received signal" testsuite adjustment 2016-03-09 20:24:14 +00:00
tls2.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
watchpoint-fork-child.c Fix gdb.threads/watchpoint-fork*.c compilation 2016-03-01 17:25:56 +00:00
watchpoint-fork-mt.c Fix gdb.threads/watchpoint-fork*.c compilation 2016-03-01 17:25:56 +00:00
watchpoint-fork-parent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
watchpoint-fork-st.c Fix gdb.threads/watchpoint-fork*.c compilation 2016-03-01 17:25:56 +00:00
watchpoint-fork.exp Fix PR threads/19422 - show which thread caused stop 2016-01-18 15:15:18 +00:00
watchpoint-fork.h Fix gdb.threads/watchpoint-fork*.c compilation 2016-03-01 17:25:56 +00:00
watchthreads-reorder.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
watchthreads-reorder.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
watchthreads.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
watchthreads.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
watchthreads2.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
watchthreads2.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
wp-replication.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
wp-replication.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00