summaryrefslogtreecommitdiff
path: root/debuggerd/handler/debuggerd_handler.cpp
diff options
context:
space:
mode:
authorScott Lobdell <slobdell@google.com>2019-05-01 07:59:50 -0700
committerKiyoung Kim <kiyoungkim@google.com>2019-05-02 02:50:55 +0900
commit451b8327e20c528db5edf6a1a9614749ad46e3ce (patch)
treed647929331cb79127bc9ca092d94740afa1fe7ed /debuggerd/handler/debuggerd_handler.cpp
parent67962abeb7e18c290b03997e709b84b68c8c0a77 (diff)
parenta7c089f92495494d25797f741687a1f0b9575e3f (diff)
Merge QP1A.190501.001
Change-Id: I4400cfb92e362af46838594efd98e636c24189ca
Diffstat (limited to 'debuggerd/handler/debuggerd_handler.cpp')
-rw-r--r--debuggerd/handler/debuggerd_handler.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/debuggerd/handler/debuggerd_handler.cpp b/debuggerd/handler/debuggerd_handler.cpp
index 5f095f07b..2ee6a64e4 100644
--- a/debuggerd/handler/debuggerd_handler.cpp
+++ b/debuggerd/handler/debuggerd_handler.cpp
@@ -268,8 +268,15 @@ static void create_vm_process() {
_exit(errno);
}
- // Exit immediately on both sides of the fork.
- // crash_dump is ptracing us, so it'll get to do whatever it wants in between.
+ // crash_dump is ptracing both sides of the fork; it'll let the parent exit,
+ // but keep the orphan stopped to peek at its memory.
+
+ // There appears to be a bug in the kernel where our death causes SIGHUP to
+ // be sent to our process group if we exit while it has stopped jobs (e.g.
+ // because of wait_for_gdb). Use setsid to create a new process group to
+ // avoid hitting this.
+ setsid();
+
_exit(0);
}