From 4d1969799b081fd4a28fc14561627be148f0ba5a Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Thu, 12 Aug 2021 15:49:44 -0700 Subject: libbinder_ndk: dump class ptrs in assoc. failure We know nothing about them if they mismatch now. This could help us figure out certain kind of memory corruption issues or, if we dump process memory and have access to mapping information, determine where the globals that refer to these different classes come from (AIBinder_Class ptrs are usually stored in globals). Bug: 195473723 Test: see log in logcat Change-Id: I3010b62d70a63114fa4610d25860d3602740e185 --- libs/binder/ndk/ibinder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/binder/ndk/ibinder.cpp b/libs/binder/ndk/ibinder.cpp index 2abb6f7992..11e9fc5d7b 100644 --- a/libs/binder/ndk/ibinder.cpp +++ b/libs/binder/ndk/ibinder.cpp @@ -82,8 +82,8 @@ std::optional AIBinder::associateClassInternal(const AIBinder_Class* clazz const String16& currentDescriptor = mClazz->getInterfaceDescriptor(); if (newDescriptor == currentDescriptor) { LOG(ERROR) << __func__ << ": Class descriptors '" << currentDescriptor - << "' match during associateClass, but they are different class objects. " - "Class descriptor collision?"; + << "' match during associateClass, but they are different class objects (" + << clazz << " vs " << mClazz << "). Class descriptor collision?"; } else { LOG(ERROR) << __func__ << ": Class cannot be associated on object which already has a class. " -- cgit v1.2.3-59-g8ed1b