This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug remote/19496] fork test failures in gdb.threads/forking-threads-plus-breakpoint with remote target
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Wed, 16 Mar 2016 22:17:38 +0000
- Subject: [Bug remote/19496] fork test failures in gdb.threads/forking-threads-plus-breakpoint with remote target
- Auto-submitted: auto-generated
- References: <bug-19496-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=19496
--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Don Breazeal <donb@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7868401b7b63d851eea5de3b780591238d579bd1
commit 7868401b7b63d851eea5de3b780591238d579bd1
Author: Don Breazeal <donb@codesourcery.com>
Date: Wed Mar 16 15:13:44 2016 -0700
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.
--
You are receiving this mail because:
You are on the CC list for the bug.