Closed demarle closed 3 years ago
This fix is not complete. The check for library exists will pass when ospray has reloaded the same named libray and we will use the stale function from the old version of the library. We need a timestamp or something like that.
The revised version now says the symbol is stale if the symbols library is at a different address. You can see it take effect here (even if the example won't necessarily crash without it).
#include "ospray/ospray.h"
int main(int argc, const char **argv) {
for (int i = 0; i < 10000; i++) {
OSPError init_error = ospInit(nullptr, nullptr);
if (init_error != OSP_NO_ERROR) {
return init_error;
}
ospShutdown();
}
return 0;
}
We how have ospcommon split into its own repository (due to OpenVKL coming soon, which also needs it), so this will be incorporated into that version of the repo. I'll keep this open as a reference and close it when it's merged there.
Many (all?) crashes with ospinit/ospShutdown have been fixed in v2.7 (and including the library code in rkcommon
).
the objectfactory's internal cache of creationfunctionpointers gets stale when a library is dlunloaded. This change fixes that by checking if the the library is still valid and if not making a new cache entry for it.
fixes: https://github.com/ospray/ospray/issues/338