"The function dlerror() returns a human readable string describing the most recent error that occurred from dlopen(), dlsym() or dlclose() since the last call to dlerror()." dlerror(3)
So, only the first dlerror() will contain the actual error, and we end up with empty error messages in exceptions, e.g. in 2.1.2 where another dlerror swallows the error message even for the regular log stream:
When a
dlopen()
fails on plugin loading, the JPluginLoader callsdlerror()
multiple times (even though it's fewer times than 2.1.2). Remaining calls are at: https://github.com/JeffersonLab/JANA2/blob/59c2a54b77ba9c9e3bfae3c33b442206749f7310/src/libraries/JANA/Services/JPluginLoader.cc#L222-L223"The function dlerror() returns a human readable string describing the most recent error that occurred from dlopen(), dlsym() or dlclose() since the last call to dlerror()." dlerror(3)
So, only the first
dlerror()
will contain the actual error, and we end up with empty error messages in exceptions, e.g. in 2.1.2 where another dlerror swallows the error message even for the regular log stream: