From c235284b5fe30920d68d570cb656344a00998386 Mon Sep 17 00:00:00 2001 From: Chrissie Caulfield Date: Mon, 14 May 2018 08:24:10 +0100 Subject: [PATCH] log: Use RTLD_NOOPEN when checking symbols (#310) on FreeBSD 11 call dlopen on a shared library causes the constructors to run again. As we're just getting symbols we don't need this to happen. Actually we don't WANT it to happen because it can cause qb_log_init to be called twice (recursively) and the dlnames list gets corrupted. This causess corosync (at leasT0 to crash at startup. Signed-off-by: Christine Caulfield --- lib/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/log.c b/lib/log.c index 30516ad26..756af59a0 100644 --- a/lib/log.c +++ b/lib/log.c @@ -831,7 +831,7 @@ _log_so_walk_dlnames(void) qb_list_for_each_safe(iter, next, &dlnames) { dlname = qb_list_entry(iter, struct dlname, list); - handle = dlopen(dlname->dln_name, RTLD_LAZY); + handle = dlopen(dlname->dln_name, RTLD_LAZY|RTLD_NOLOAD); error = dlerror(); if (!handle || error) { qb_log(LOG_ERR, "%s", error);