Adhemerval Zanella d0e3ffb7a5 nptl: Fix racy pipe closing in tst-cancel{20,21}
The tst-cancel20 open two pipes and creates a thread which blocks
reading the first pipe.  It then issues a signal to activate the
signal handler which in turn blocks reading the second pipe end.
Finally the cancellation cleanup-up handlers are tested by first
closing the all the pipes ends and issuing a pthread_cancel.
The tst-cancel21 have a similar behavior, but use an extra fork
after the test itself.

The race condition occurs if the cancellation handling acts after the
pipe close: in this case read will return EOF (indicating side-effects)
and thus the cancellation must not act.  However current GLIBC
cancellation behavior acts regardless the syscalls returns with
sid-effects.

This patch adjust the test by moving the pipe closing after the
cancellation handling.  This avoid spurious cancellation if the case
of the race described.

Checked on x86_64 and i386.

	* nptl/tst-cancel20.c (do_one_test): Move the pipe closing after
	pthread_join.
	* nptl/tst-cancel21.c (tf): Likewise.
2015-12-02 14:45:50 -02:00
..
2015-10-27 21:46:03 +00:00
2015-06-12 10:10:18 +00:00
2015-01-06 08:23:58 -08:00
2015-01-06 08:23:58 -08:00
2015-01-06 08:23:58 -08:00
2014-05-07 14:00:01 +02:00
2015-08-09 04:19:17 -04:00
2013-06-06 20:36:07 +02:00
2011-10-24 21:43:33 -04:00
2015-11-04 11:32:36 +01:00
2008-05-31 08:56:14 +00:00
2011-09-10 14:34:15 -04:00
2015-10-27 21:46:03 +00:00
2015-10-27 21:46:03 +00:00