This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Implement internal_fork and internal_forkpty for OS X
ClosedPublic

Authored by kubamracek on Nov 20 2015, 4:13 AM.

Details

Summary

On Linux, we have internal_fork that forks without invoking user's pthread_atfork handlers, which is important for spawning external symbolizers. Let's implement this for OS X as well (using __fork). This patch also adds internal_forkpty which re-implements forkpty and uses __fork in it as well.

Diff Detail

Repository
rL LLVM

Event Timeline

kubamracek updated this revision to Diff 40766.Nov 20 2015, 4:13 AM
kubamracek retitled this revision from to [sanitizer] Implement internal_fork and internal_forkpty for OS X.
kubamracek updated this object.
kubamracek added reviewers: dvyukov, kcc, glider, samsonov.
dvyukov accepted this revision.Nov 20 2015, 5:46 AM
dvyukov edited edge metadata.

LGTM with a nit

lib/sanitizer_common/sanitizer_mac.cc
162 ↗(On Diff #40766)

add:

close(master);
close(slave);
This revision is now accepted and ready to land.Nov 20 2015, 5:46 AM
This revision was automatically updated to reflect the committed changes.