Hello David Ribeiro Alves,
I'd like you to do a code review. Please visit
http://gerrit.cloudera.org:8080/6259
to review the following change.
Change subject: subprocess: Get rid of fork/exec SIGPIPE reset race
......................................................................
subprocess: Get rid of fork/exec SIGPIPE reset race
There is a potential race in the current fork/exec procedure where,
after fork(), we set the signal disposition for SIGPIPE to SIG_DFL, and
then exec(). The problem with this sequence is that the parent process
may have outstanding threads performing socket or pipe writes which
could get interleaved between setting the signal handler to the default
and the exec().
The workaround in this patch is to set the signal handler in the child
to a no-op handler function in between fork() and exec(). Upon exec(),
the handler disposition is reset to SIG_DFL atomically and
automatically, resulting in the child getting SIG_DFL for SIGPIPE
without racy behavior.
Change-Id: I6ba5232775376fecbc05a14402a67d00e90818fa
---
M src/kudu/util/subprocess.cc
1 file changed, 10 insertions(+), 6 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/59/6259/1
--
To view, visit http://gerrit.cloudera.org:8080/6259
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ba5232775376fecbc05a14402a67d00e90818fa
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Mike Percy <[email protected]>
Gerrit-Reviewer: David Ribeiro Alves <[email protected]>