[PATCH] posix/tst-spawn: Fix racy tests in spawned processes.
Stefan Liebler
stli@linux.ibm.com
Mon Jan 28 14:15:00 GMT 2019
On 01/28/2019 02:41 PM, Stefan Liebler wrote:
> Hi,
>
> from time to time I get fails in tst-spawn like:
> tst-spawn.c:111: numeric comparison failure
> Â Â left: 0 (0x0); from: xlseek (fd2, 0, SEEK_CUR)
> Â right: 28 (0x1c); from: strlen (fd2string)
> error: 1 test failures
> tst-spawn.c:252: numeric comparison failure
> Â Â left: 1 (0x1); from: WEXITSTATUS (status)
> Â right: 0 (0x0); from: 0
> error: 1 test failures
>
> It turned out, that a child process is testing it's open file
> descriptors with e.g. a sequence of testing the current position,
> setting the position to zero and reading a specific amount of bytes.
>
> Unfortunately starting with commit
> 2a69f853c03034c2e383e0f9c35b5402ce8b5473 the test is spawning a second
> child process which is sharing some of the file descriptors. If the
> test sequence as mentioned above is running in parallel it leads to test
> failures.
>
> As the second call of posix_spawn shall test a NULL pid argument, this
> patch is just moving the waitpid of the first child before the
> posix_spawn of the second child.
>
> Okay for commit?
> (I assume 2.30)
>
> Bye,
> Stefan
>
> ChangeLog:
>
> Â Â Â Â * posix/tst-spawn do_test(): Move waitpid before posix_spawn.
>
Sorry. Forgot to attach the patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20190128_tst-spawn.patch
Type: text/x-patch
Size: 2367 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20190128/3c9009bd/attachment.bin>
More information about the Libc-alpha
mailing list