ViDA-NYU/reprozip — pull request #37 by remram44 (2014-07-09 21:50:12+00:00)
Title: "Race condition" in process creation logic

(this is what fails on Tuan Anh's experiment)

A process might start executing before the function that created it (e.g. fork, clone or vfork) returns. In this case, we get a "warning: found unexpected process", and then when the parent resumes after the syscall, it creates a second process in the table with the same pid. Then things just break.

The fix for this should probably go on top of the signal branch, since there isn't much signal handling in master right now.

The actual events I get for a new process are:
* parent process returns from fork, clone or vfork (this is when I currently add it to the process table)
* *parent process gets a `SIGTRAP | PTRACE_EVENT_` (this is ignored)*
* child process appears and gets a `SIGTRAP | PTRACE_EVENT_` (this is when I set options and change from `ALLOCATED` to `ATTACHED`)