diff options
author | Steven Moreland <smoreland@google.com> | 2021-02-18 20:55:01 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-02-18 20:55:01 +0000 |
commit | 0b3cd0401042f30b9b11a3d01377d764ffa627b4 (patch) | |
tree | f584b23a81b98d8f31369faeef3fee34381e4c7c | |
parent | d85f2c9bdcf7d0e6b0355d81eb7a8858bb20fac6 (diff) | |
parent | a2680e628763a10bd430425f3e79397e1e14d6a2 (diff) | |
download | libhidl-0b3cd0401042f30b9b11a3d01377d764ffa627b4.tar.gz |
libhidlbase: avoid dlclose am: edd49128bc am: 6785dc4b99 am: a2680e6287
Original change: https://android-review.googlesource.com/c/platform/system/libhidl/+/1592996
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ia122fcc72cb58a1ce29dacd352cacf6a39861aa9
-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. |