[Unit-tests] Add --enable-fake-dlclose configure flag so modules are not unloaded and ASAN could give more info and not just <unknown module>.

This commit is contained in:
Andrey Volk 2020-10-04 19:24:30 +04:00
parent 6b3cd2e41f
commit 734e9776e0
2 changed files with 12 additions and 0 deletions

View File

@ -1986,6 +1986,16 @@ if test "${enable_address_sanitizer}" = "yes"; then
APR_ADDTO(LDFLAGS, -fsanitize=address)
fi
# Enable fake dlclose
AC_ARG_ENABLE(fake_dlclose,
[AC_HELP_STRING([--enable-fake-dlclose],[Do not unload dynamic libraries])],
[enable_fake_dlclose="$enable_fake_dlclose"],
[enable_fake_dlclose="no"])
if test "${enable_fake_dlclose}" = "yes"; then
APR_ADDTO(SWITCH_AM_CFLAGS, -DHAVE_FAKE_DLCLOSE)
fi
AC_ARG_ENABLE(,
[AC_HELP_STRING([--enable-pool-sanitizer],[build with sanitizer friendly pool behavior])],
[enable_pool_sanitizer="$enable_pool_sanitizer"],

View File

@ -91,7 +91,9 @@ SWITCH_DECLARE(void *) switch_dso_data_sym(switch_dso_lib_t lib, const char *sym
void switch_dso_destroy(switch_dso_lib_t *lib)
{
if (lib && *lib) {
#ifndef HAVE_FAKE_DLCLOSE
dlclose(*lib);
#endif
*lib = NULL;
}
}