Skip to content

Instantly share code, notes, and snippets.

@andrwng
Created July 30, 2018 17:47
Show Gist options
  • Save andrwng/bd22824797ded401a44a13f69f39dc1f to your computer and use it in GitHub Desktop.
Save andrwng/bd22824797ded401a44a13f69f39dc1f to your computer and use it in GitHub Desktop.
diff --git a/src/kudu/util/subprocess.cc b/src/kudu/util/subprocess.cc
index d68cb7f656f78847430887d4dfa0676d8392ee1a..8d3ef7dc752799785effbfd990a9b4700fcfd546 100644
--- a/src/kudu/util/subprocess.cc
+++ b/src/kudu/util/subprocess.cc
@@ -376,6 +376,10 @@ Status Subprocess::Start() {
// TODO: prctl(PR_SET_PDEATHSIG) is Linux-specific, look into portable ways
// to prevent orphans when parent is killed.
prctl(PR_SET_PDEATHSIG, SIGKILL);
+
+ // Allow the child process to be ptraced by any thread.
+ // This is synonymous with `prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY)`.
+ prctl(0x59616d61, ((unsigned long)-1));
#endif
// stdin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment