I don't fully understand the problem you're solving. Is it the case that parent process and tracer task simultaneously call RawWrite()? Do they have the shared memory (and thus shared report_fd/report_fd_pid, but different internal_getpid())? http://llvm-reviews.chandlerc.com/D2306