Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use _exit() in fork test to fix race (gearman#47)
Been doing some analysis. So what happens is this: 1) child forks, which ends up with the same socket for both child and parent. 1-parent) parent calls waitpid to wait for child to exit 2) child successfully echoes 3) child calls exit() which calls some registered atexit handler which shuts down the shared connection 4) parent wakes up, sees client was successful, tries to use the same connection socket which was just shut down. I don't know how this test worked ever. But most likely there was a race between the SIGCHLD and the exit handlers, and that may have been fixed in recent libc's. Closes gearman#44
- Loading branch information