diff options
author | Steven Moreland <smoreland@google.com> | 2021-02-18 19:28:26 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-02-18 19:28:26 +0000 |
commit | 6785dc4b997a206e34c87faa8813c9cfa946e807 (patch) | |
tree | f584b23a81b98d8f31369faeef3fee34381e4c7c | |
parent | d49bfa9bc628e8e6542e3264011e1fa734f66ed2 (diff) | |
parent | edd49128bc6028792314ad12779678310967e343 (diff) | |
download | libhidl-6785dc4b997a206e34c87faa8813c9cfa946e807.tar.gz |
libhidlbase: avoid dlclose am: edd49128bc
Original change: https://android-review.googlesource.com/c/platform/system/libhidl/+/1592996
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I4d23e19613633cc473b8dda746362a8a7d9db3e3
-rw-r--r-- | transport/ServiceManagement.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp index b51c600..c4e03c3 100644 --- a/transport/ServiceManagement.cpp +++ b/transport/ServiceManagement.cpp @@ -417,18 +417,27 @@ struct PassthroughServiceManager : IServiceManager1_1 { *(void **)(&generator) = dlsym(handle, sym.c_str()); if(!generator) { const char* error = dlerror(); - LOG(ERROR) << "Passthrough lookup opened " << lib - << " but could not find symbol " << sym << ": " - << (error == nullptr ? "unknown error" : error); - dlclose(handle); - return true; + LOG(ERROR) << "Passthrough lookup opened " << lib << " but could not find symbol " + << sym << ": " << (error == nullptr ? "unknown error" : error) + << ". Keeping library open."; + + // dlclose too problematic in multi-threaded environment + // dlclose(handle); + + return true; // continue } ret = (*generator)(name.c_str()); if (ret == nullptr) { - dlclose(handle); - return true; // this module doesn't provide this instance name + LOG(ERROR) << "Could not find instance '" << name.c_str() << "' in library " << lib + << ". Keeping library open."; + + // dlclose too problematic in multi-threaded environment + // dlclose(handle); + + // this module doesn't provide this particular instance + return true; // continue } // Actual fqname might be a subclass. |