In ParaView 5.7.rc1 (w/ ospray 1.8.x), but only on mac, I run into problems when we shutdown and restart ospray.
Unfortunately I have not yet been able to reproduce this with a simple test program and ospinit/ospshutdown cycles work fine with the same libraries and compiler on a failing machine.
The crashes I am seeing occur where the objectFactory's internal cache of creationFunctionPointers contains a stale function pointer into in a previously freed library (ospray_module_ispc) instead of the newly reloaded version of the same library.
If I prevent the cache hit in objectFactory, we find and use the new creation function pointer in the new library fine.
If I avoid calling ospShutdown entirely (which previous ParaViews used to do) things work fine too.
I am thinking that a clean solution would be to make ~library remove its entries in the objectFactory cache but don't see a good way to make that happen yet.
We cover ospInit ospShutdown cycling in tests and also fixed some problems. One known exception is the MPI device where multiple init/shutdown cycles won't be supported.
In ParaView 5.7.rc1 (w/ ospray 1.8.x), but only on mac, I run into problems when we shutdown and restart ospray.
Unfortunately I have not yet been able to reproduce this with a simple test program and ospinit/ospshutdown cycles work fine with the same libraries and compiler on a failing machine.
The crashes I am seeing occur where the objectFactory's internal cache of creationFunctionPointers contains a stale function pointer into in a previously freed library (ospray_module_ispc) instead of the newly reloaded version of the same library.
If I prevent the cache hit in objectFactory, we find and use the new creation function pointer in the new library fine.
If I call ospShutdown but disable library closure it also seems to work fine.
If I avoid calling ospShutdown entirely (which previous ParaViews used to do) things work fine too.
I am thinking that a clean solution would be to make ~library remove its entries in the objectFactory cache but don't see a good way to make that happen yet.