RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
1k stars 182 forks source link

problem with ospInit ospShutdown cycling #338

Closed demarle closed 2 years ago

demarle commented 5 years ago

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.

johguenther commented 2 years ago

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.