google / capsicum-test

Test suite for Capsicum
BSD 2-Clause "Simplified" License
46 stars 30 forks source link

Fix potential race in PdkillOtherSignal test #54

Closed arichardson closed 3 years ago

arichardson commented 3 years ago

On a slow emulated (uniprocessor) system it can happen that the SIGUSR1 signal is sent before the child process has registered the SIGUSR1 handler. In that case the waitpid status will show that the child was killed by a signal and the test fails. To avoid this race use a pipe to ensure that the SIGUSR1 handler has been registered before continuing execution in the parent. This also slightly speeds up the test by avoiding the sleep(1).

arichardson commented 3 years ago

rebased on top of #49