diff --git a/src/module.c b/src/module.c index d40b2ea01b..34f34b0f74 100644 --- a/src/module.c +++ b/src/module.c @@ -12274,7 +12274,16 @@ int moduleLoad(const char *path, void **module_argv, int module_argc, int is_loa } } - handle = dlopen(path, RTLD_NOW | RTLD_LOCAL); + int dlopen_flags = RTLD_NOW | RTLD_LOCAL; +#ifndef __SANITIZE_ADDRESS__ + /* RTLD_DEEPBIND, which is required for loading modules that contains the + * same symbols, does not work with ASAN. Therefore, we exclude + * RTLD_DEEPBIND when doing test builds with ASAN. + * See https://github.com/google/sanitizers/issues/611 for more details.*/ + dlopen_flags |= RTLD_DEEPBIND; +#endif + + handle = dlopen(path, dlopen_flags); if (handle == NULL) { serverLog(LL_WARNING, "Module %s failed to load: %s", path, dlerror()); return C_ERR;