Merge "Preventing zombie process creation." into pi-dev am: ca6f36532d

am: 193c893b01

Change-Id: Id32203ab069343410a02c03956a7c6135f8a1b33
This commit is contained in:
android-build-team Robot
2018-05-02 18:05:11 -07:00
committed by android-build-merger

View File

@@ -864,11 +864,16 @@ status_t TombstoneSection::BlockingCall(int pipeWriteFd) const {
// Read from the pipe concurrently to avoid blocking the child.
FdBuffer buffer;
err = buffer.readFully(dumpPipe.readFd().get());
// Wait on the child to avoid it becoming a zombie process.
status_t cStatus = wait_child(child);
if (err != NO_ERROR) {
ALOGW("[%s] failed to read stack dump: %d", this->name.string(), err);
dumpPipe.readFd().reset();
break;
}
if (cStatus != NO_ERROR) {
ALOGE("TombstoneSection '%s' child had an issue: %s\n", this->name.string(), strerror(-cStatus));
}
auto dump = std::make_unique<char[]>(buffer.size());
auto iterator = buffer.data();