Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4e8cde8 authored by android-build-team Robot's avatar android-build-team Robot Committed by android-build-merger
Browse files

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

am: 193c893b

Change-Id: Id32203ab069343410a02c03956a7c6135f8a1b33
parents eb209829 193c893b
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -864,11 +864,16 @@ status_t TombstoneSection::BlockingCall(int pipeWriteFd) const {
        // Read from the pipe concurrently to avoid blocking the child.
        // Read from the pipe concurrently to avoid blocking the child.
        FdBuffer buffer;
        FdBuffer buffer;
        err = buffer.readFully(dumpPipe.readFd().get());
        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) {
        if (err != NO_ERROR) {
            ALOGW("[%s] failed to read stack dump: %d", this->name.string(), err);
            ALOGW("[%s] failed to read stack dump: %d", this->name.string(), err);
            dumpPipe.readFd().reset();
            dumpPipe.readFd().reset();
            break;
            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 dump = std::make_unique<char[]>(buffer.size());
        auto iterator = buffer.data();
        auto iterator = buffer.data();