libbinder: driver unfinished write error code

This fatal log used to be hidden inside of a function (Parcel::remove)
which always failed, and so when it was removed, the error gained
context, but I failed to include other relevant information in the log,
such as the error code.

Bug: 154144726
Test: m only
Change-Id: I477aaee1a335a9faf8c9b249a97c979c08bc4ebf
Merged-In: I477aaee1a335a9faf8c9b249a97c979c08bc4ebf
This commit is contained in:
Steven Moreland 2020-04-16 16:22:52 -07:00
parent a1f69c6c13
commit b1a4d5836e

View file

@ -997,7 +997,11 @@ status_t IPCThreadState::talkWithDriver(bool doReceive)
if (err >= NO_ERROR) {
if (bwr.write_consumed > 0) {
if (bwr.write_consumed < mOut.dataSize())
LOG_ALWAYS_FATAL("Driver did not consume write buffer");
LOG_ALWAYS_FATAL("Driver did not consume write buffer. "
"err: %s consumed: %zu of %zu",
statusToString(err).c_str(),
(size_t)bwr.write_consumed,
mOut.dataSize());
else {
mOut.setDataSize(0);
processPostWriteDerefs();