This is an extension of
eb41d768f ("MINOR: tools: use only opportunistic
symbols resolution"). It also makes sure we're not calling dladddr() in
parallel to dladdr_and_size(), as a preventive measure against some
potential deadlocks in the inner layers of the libc.
goto use_array;
i = dladdr_and_size(addr, &dli, &size);
- if (!isolated)
- HA_SPIN_UNLOCK(OTHER_LOCK, &dladdr_lock);
- if (!i)
+ if (!i) {
+ if (!isolated)
+ HA_SPIN_UNLOCK(OTHER_LOCK, &dladdr_lock);
goto use_array;
+ }
/* 1. prefix the library name if it's not the same object as the one
* that contains the main function. The name is picked between last '/'
ha_thread_relax();
}
+ if (!isolated)
+ HA_SPIN_UNLOCK(OTHER_LOCK, &dladdr_lock);
+
if (dli_main.dli_fbase != dli.dli_fbase) {
fname = dli.dli_fname;
p = strrchr(fname, '/');