summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2022-02-03 21:25:59 +0000
committer Steven Moreland <smoreland@google.com> 2022-02-03 21:34:09 +0000
commitfa462e8c44f52d33846b90b8f9e1b23476906bca (patch)
tree896323b61dd6dfd1dcdbbb7ca6bc305faeb4fce2
parent4db55d2f36981cad8e5d9cb134c016daca02d01e (diff)
Binder: small failed transactions can be due to size
The error message here is a bit misleading. Big transactions are likely to fill the buffer and cause an overflow, but many small transactions can too. Bug: N/A Test: N/A Change-Id: Id174214397b4ed4dd734908b395d426ce6a09de4
-rw-r--r--core/jni/android_util_Binder.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index 61b91ddaa2e7..13ca13322cc7 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -873,7 +873,7 @@ void signalExceptionForError(JNIEnv* env, jobject obj, status_t err,
const char* exceptionToThrow;
char msg[128];
// TransactionTooLargeException is a checked exception, only throw from certain methods.
- // FIXME: Transaction too large is the most common reason for FAILED_TRANSACTION
+ // TODO(b/28321379): Transaction size is the most common cause for FAILED_TRANSACTION
// but it is not the only one. The Binder driver can return BR_FAILED_REPLY
// for other reasons also, such as if the transaction is malformed or
// refers to an FD that has been closed. We should change the driver
@@ -890,8 +890,9 @@ void signalExceptionForError(JNIEnv* env, jobject obj, status_t err,
exceptionToThrow = (canThrowRemoteException)
? "android/os/DeadObjectException"
: "java/lang/RuntimeException";
- snprintf(msg, sizeof(msg)-1,
- "Transaction failed on small parcel; remote process probably died");
+ snprintf(msg, sizeof(msg) - 1,
+ "Transaction failed on small parcel; remote process probably died, but "
+ "this could also be caused by running out of binder buffer space");
}
jniThrowException(env, exceptionToThrow, msg);
} break;