]> git.ipfire.org Git - thirdparty/glibc.git/commit
tst-mallocfork2: Fix race condition, use fewer resources
authorFlorian Weimer <fweimer@redhat.com>
Fri, 13 May 2016 14:55:01 +0000 (16:55 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 24 May 2016 08:59:55 +0000 (10:59 +0200)
commit25a34b0ac1356c1442380db2d2b13e05ccaeedd9
tree846486d71da9869330e7f7f1a8618021b6a60bf7
parent2143af6a47027c48d8dc168e255d8f527377bc56
tst-mallocfork2: Fix race condition, use fewer resources

The first SIGUSR1 signal could arrive when sigusr1_sender_pid
was still 0.  As a result, kill would send SIGSTOP to the
entire process group.  This would cause the test to hang before
printing any output.

This commit also adds a sched_yield to the signal source, so that
it does not flood the parent process with signals it has never a
chance to handle.

Even with these changes, tst-mallocfork2 still fails reliably
after the fix in commit commit 56290d6e762c1194547e73ff0b948cd79d3a1e03
(Increase fork signal safety for single-threaded processes) is
backed out.

(cherry picked from commit e2cd73a2ccabe8acae28719a0c3c1c03f2b5f9fb)

The backport increases the timeout to 20 seconds, in line with
the default on master.  (The branch default of 2 seconds is too
tight.)
ChangeLog
malloc/tst-mallocfork2.c