Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testsuite: improve test reliability and prepare for asan testing #1733

Merged
merged 9 commits into from Oct 15, 2018
Prev

configure: check for RTLD_DEEPBIND, rename

  • Loading branch information...
trws committed Oct 14, 2018
commit 4646ef40eb9037f3de9162bfbb8cd2654bcada00
@@ -59,11 +59,17 @@ AS_CASE($ax_cv_cxx_compiler_vendor,
AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])

X_AC_ENABLE_SANITIZER
if test "x$san_enabled" != "xno" ; then
AC_DEFINE([DEEPBIND], [0],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
#include <dlfcn.h>
#if !(defined(RTLD_DEEPBIND))
#error nope
#endif
])], [has_deepbind=yes], [has_deepbind=no])
if test "x$san_enabled" != "xno" || test "x$has_deepbind" = "xno" ; then
AC_DEFINE([FLUX_DEEPBIND], [0],
[deepbind is unsupported with asan, musl and so-forth])

This comment has been minimized.

Copy link
@grondo

grondo Oct 12, 2018

Contributor

I might suggest a different name for the DEEPBIND config.h macro. Perhaps FLUX_DEEPBIND to give a hint in the code that we're using a locally provided define.

This comment has been minimized.

Copy link
@trws

trws Oct 14, 2018

Author Member

Good point @grondo. It also made me notice I had forgotten to add the check for whether RTLD_DEEPBIND even exists, so it's renamed and the check has been added as well.

else
AC_DEFINE([DEEPBIND], [RTLD_DEEPBIND],
AC_DEFINE([FLUX_DEEPBIND], [RTLD_DEEPBIND],
[deepbind is unsupported with asan, musl and so-forth])
fi

@@ -531,7 +531,7 @@ module_t *module_add (modhash_t *mh, const char *path)
int rc;

dlerror ();
if (!(dso = dlopen (path, RTLD_NOW | RTLD_LOCAL | DEEPBIND))) {
if (!(dso = dlopen (path, RTLD_NOW | RTLD_LOCAL | FLUX_DEEPBIND))) {
log_msg ("%s", dlerror ());
errno = ENOENT;
return NULL;
@@ -230,7 +230,7 @@ static connector_init_f *find_connector (const char *scheme, void **dsop)
}
if (!(path = find_file (name, searchpath)))
goto done;
if (!(dso = dlopen (path, RTLD_LAZY | RTLD_LOCAL | DEEPBIND))) {
if (!(dso = dlopen (path, RTLD_LAZY | RTLD_LOCAL | FLUX_DEEPBIND))) {
errno = EINVAL;
goto done;
}
@@ -263,7 +263,7 @@ char *flux_modname(const char *path)
char *name = NULL;

dlerror ();
if ((dso = dlopen (path, RTLD_LAZY | RTLD_LOCAL | DEEPBIND))) {
if ((dso = dlopen (path, RTLD_LAZY | RTLD_LOCAL | FLUX_DEEPBIND))) {
int errnum = EINVAL;
if ((np = dlsym (dso, "mod_name")) && *np)
if (!(name = strdup (*np)))
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.