On Mon, Jul 06, 2020 at 12:42:55AM +0700, Robert Elz wrote: > Actually, that one is a possible solution. dlclose() is not required > to do anything at all. While having it never do anything isn't what > we'd want, having it do nothing if there is a pending atexit function > from the dynamic object (or even simply one registered by the dynamic > object - though the problematic case, as I understand it, is when the > function has been removed and so can no longer sensibly be called) is > not a ridiculous suggestion.
There is precedence for dlclose doing nothing - it's a no-op in musl libc, by design. There are obvious downsides (servers with reloadable modules suddenly have memory leaks) but that's arguably not critical. Their justification can be found here: https://wiki.musl-libc.org/functional-differences-from-glibc.html#Unloading-libraries
