[systemd-devel] [PATCH 2/2] test: wait for cloned thread to exit

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Thu Dec 25 08:43:31 PST 2014

On Tue, Dec 23, 2014 at 10:15:49AM -0800, Filipe Brandenburger wrote:
> In test_raw_clone, make sure the cloned thread calls _exit() and in the parent
> thread call waitpid(..., __WCLONE) to wait for the child thread to terminate,
> otherwise there is a race condition where the child thread will log to the
> console after the test process has already exited and the assertion from the
> child thread might not be enforced.
> The absence of this patch might also create problems for other tests that would
> be added after this one, since potentially both parent and child would run
> those tests as the child would continue running.
> Tested by confirming that the logs from the child are printed before the test
> terminates and that a false assertion in the child aborts the test with a core
> dump.
Applied 2/2.


More information about the systemd-devel mailing list