Changeset: 8ba05de3cf9d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8ba05de3cf9d
Modified Files:
monetdb5/mal/mal_linker.c
Branch: Sep2022
Log Message:
Don't attempt to load the "monetdb5" module since it's already loaded.
This fixes the sanitizer run of example_proxy.
diffs (41 lines):
diff --git a/monetdb5/mal/mal_linker.c b/monetdb5/mal/mal_linker.c
--- a/monetdb5/mal/mal_linker.c
+++ b/monetdb5/mal/mal_linker.c
@@ -166,11 +166,12 @@ loadLibrary(const char *filename, int fl
const char *s;
int idx;
const char *mod_path = GDKgetenv("monet_mod_path");
- int is_mod;
+ bool is_mod;
+ bool is_monetdb5 = strcmp(filename, "monetdb5") == 0;
- is_mod = (strcmp(filename, "monetdb5") != 0 && strcmp(filename,
"embedded") != 0);
+ is_mod = (!is_monetdb5 && strcmp(filename, "embedded") != 0);
- if (lastfile == 0 && strcmp(filename, "monetdb5") != 0 &&
strcmp(filename, "embedded") != 0) { /* first load reference to local functions
*/
+ if (lastfile == 0 && is_mod) { /* first load reference to local
functions */
str msg = loadLibrary("monetdb5", flag);
if (msg != MAL_SUCCEED)
return msg;
@@ -208,9 +209,9 @@ loadLibrary(const char *filename, int fl
throw(LOADER, "loadLibrary", RUNTIME_LOAD_ERROR
"Library filename path is too large");
#ifdef __APPLE__
- handle = mdlopen(nme, RTLD_NOW | RTLD_GLOBAL);
+ handle = mdlopen(is_monetdb5 ? NULL : nme, RTLD_NOW |
RTLD_GLOBAL);
#else
- handle = dlopen(nme, RTLD_NOW | RTLD_GLOBAL);
+ handle = dlopen(is_monetdb5 ? NULL : nme, RTLD_NOW |
RTLD_GLOBAL);
#endif
if (!handle) {
if (flag)
@@ -268,7 +269,8 @@ loadLibrary(const char *filename, int fl
}
if (handle == NULL) {
- if (strcmp(filename, "monetdb5") != 0 && strcmp(filename,
"sql") != 0
+ if (!is_monetdb5
+ && strcmp(filename, "sql") != 0
&& strcmp(filename, "generator") != 0
#ifdef HAVE_GEOM
&& strcmp(filename, "geom") != 0
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]