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

Commit b4db3a5f authored by Hans Boehm's avatar Hans Boehm Committed by Android (Google) Code Review
Browse files

Merge "Better log why zygote falls back to Java" into main

parents 4398c63e 2cc8ce4c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -244,6 +244,8 @@ class ZygoteConnection {

                if (parsedArgs.mInvokeWith != null || parsedArgs.mStartChildZygote
                        || !multipleOK || peer.getUid() != Process.SYSTEM_UID) {
                    Log.w(TAG, "Resorting to Java fork code; multipleOK = " + multipleOK
                            + (parsedArgs.mInvokeWith != null ? "; invokeWith used" : ""));
                    // Continue using old code for now. TODO: Handle these cases in the other path.
                    pid = Zygote.forkAndSpecialize(parsedArgs.mUid, parsedArgs.mGid,
                            parsedArgs.mGids, parsedArgs.mRuntimeFlags, rlimits,
+16 −0
Original line number Diff line number Diff line
@@ -253,6 +253,22 @@ class NativeCommandBuffer {
          niceNameAddr(),
          static_cast<unsigned>(mEnd), static_cast<unsigned>(mNext),
          static_cast<int>(mLinesLeft), mFd);
    if (niceNameAddr()[0] == '\0') {
      // The above didn't identify the command; dump buffer prefix as well.
      static constexpr uint32_t DUMP_SIZE = 40;
      char bufferCopy[DUMP_SIZE + 1];
      uint32_t i = 0;
      for (; i < DUMP_SIZE && i < mEnd; ++i) {
        if (mBuffer[i] < 0x20 || mBuffer[i] >= 0x7f) {
          // Not easily printable. Includes the expected newlines.
          bufferCopy[i] = '?';
        } else {
          bufferCopy[i] = mBuffer[i];
        }
      }
      bufferCopy[i] = '\0';
      ALOGD("Buffer content prefix: %s", bufferCopy);
    }
  }

 private: