diff options
author | Jun Jiang <jun.a.jiang@intel.com> | 2014-04-29 14:22:10 +0800 |
---|---|---|
committer | Jun Jiang <jun.a.jiang@intel.com> | 2014-04-29 14:22:10 +0800 |
commit | abf8a2c608cb5f0d1523ab7d0c56e0da8a09cc87 (patch) | |
tree | 529fe94b06e035f03c7e7c24f3788e380fdaf470 /libs/binder/Parcel.cpp | |
parent | 108ed9fa946ec516c0d853927c76ebbfca1dcb23 (diff) | |
download | frameworks_native-abf8a2c608cb5f0d1523ab7d0c56e0da8a09cc87.zip frameworks_native-abf8a2c608cb5f0d1523ab7d0c56e0da8a09cc87.tar.gz frameworks_native-abf8a2c608cb5f0d1523ab7d0c56e0da8a09cc87.tar.bz2 |
Add error message for hints when exceptions occur during binder transactions.
It can help to detect some kind of error, such as why GraphicBuffer::flatten
will crash when handle is null.
Change-Id: I703cd035b96edb7afb324cf24d8230d4e55f4f52
Signed-off-by: Jun Jiang <jun.a.jiang@intel.com>
Diffstat (limited to 'libs/binder/Parcel.cpp')
-rw-r--r-- | libs/binder/Parcel.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 159003d..169e503 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -25,6 +25,7 @@ #include <binder/ProcessState.h> #include <binder/TextOutput.h> +#include <errno.h> #include <utils/Debug.h> #include <utils/Log.h> #include <utils/String8.h> @@ -1229,7 +1230,11 @@ status_t Parcel::read(FlattenableHelperInterface& val) const status_t err = NO_ERROR; for (size_t i=0 ; i<fd_count && err==NO_ERROR ; i++) { fds[i] = dup(this->readFileDescriptor()); - if (fds[i] < 0) err = BAD_VALUE; + if (fds[i] < 0) { + err = BAD_VALUE; + ALOGE("dup() failed in Parcel::read, i is %d, fds[i] is %d, fd_count is %d, error: %s", + i, fds[i], fd_count, strerror(errno)); + } } if (err == NO_ERROR) { |