Parcourir la source

[master] fix 'unrecognized exception' problem

use RTLD_GLOBAL when opening modules, otherwise the exceptions some methods raise may not be recognized in catches
Jelte Jansen il y a 13 ans
Parent
commit
0e4960761e
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      src/lib/datasrc/factory.cc

+ 3 - 1
src/lib/datasrc/factory.cc

@@ -30,7 +30,9 @@ namespace isc {
 namespace datasrc {
 
 LibraryContainer::LibraryContainer(const std::string& name) {
-    ds_lib_ = dlopen(name.c_str(), RTLD_NOW | RTLD_LOCAL);
+    // use RTLD_GLOBAL so that shared symbols (e.g. exceptions)
+    // are recognized as such
+    ds_lib_ = dlopen(name.c_str(), RTLD_NOW | RTLD_GLOBAL);
     if (ds_lib_ == NULL) {
         isc_throw(DataSourceLibraryError, dlerror());
     }