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

Crashes in ospExamples with mouse middle click #376

Closed paulmelis closed 4 years ago

paulmelis commented 4 years ago

With the default (volumetric sphere) scene I get different segfaults depending on the middle click. Click on background:

$ ~/software/ospray-superbuild-git/bin/ospExamples  
OSPRay error: null handle provided to void ospRelease(OSPObject)
pure virtual method called
pure virtual method called
pure virtual method called
pure virtual method called
pure virtual method called
terminate called without an active exception
OPENVKL ERROR [1]: iterateInterval##WIDTH() not implemented on this driver
Aborted (core dumped)

#0  0x00007f215840cf25 in raise () from /usr/lib/libc.so.6
[Current thread is 1 (Thread 0x7f214a87e700 (LWP 239238))]
(gdb) bt
#0  0x00007f215840cf25 in raise () from /usr/lib/libc.so.6
#1  0x00007f21583f6897 in abort () from /usr/lib/libc.so.6
#2  0x00007f21587b281d in __gnu_cxx::__verbose_terminate_handler ()
    at /build/gcc/src/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
#3  0x00007f21587bf4da in __cxxabiv1::__terminate (handler=<optimized out>)
    at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:47
#4  0x00007f21587bf537 in std::terminate () at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:57
#5  0x00007f21587c02e5 in __cxxabiv1::__cxa_pure_virtual ()
    at /build/gcc/src/gcc/libstdc++-v3/libsupc++/pure.cc:50
#6  0x00007f2158bc2237 in vklComputeSample8 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libopenvkl.so
#7  0x00007f2157b5a828 in delta_tracking___un_3C_s_5B_unVolumetricModel_5D__3E_REFs_5B__c_vyVolumeInterval_5D_un_3C_s_5B_vyRandomSampler_5D__3E_REFs_5B__c_vyvec3f_5D_REFs_5B__c_vyvec3f_5D_REFvyfREFs_5B_vyvec3f_5D_avx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#8  0x00007f2157b5866f in volumeTransmittance___REFs_5B__c_vyPathState_5D_un_3C_s_5B__c_unWorld_5D__3E_REFs_5B_vyRay_5D_un_3C_s_5B_vyLDSampler_5D__3E_un_3C_s_5B_vyRandomSampler_5D__3E_avx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#9  0x00007f2157b073f5 in nextEventEstimation___REFs_5B__c_vyPathContext_5D_REFs_5B__c_vyPathState_5D_REFs_5B_vyPathVertex_5D_avx2 () from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#10 0x00007f2157ac1e52 in samplePath___REFs_5B__c_vyPathContext_5D_REFs_5B_vyPathState_5D_REFs_5B_vyRay_5D_REFs_5B_vyScreenSample_5D_avx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#11 0x00007f2157a94906 in PathTraceIntegrator_Li___un_3C_s_5B__c_unPathTracer_5D__3E_un_3C_s_5B__c_unWorld_5D__3E_un_3C_s_5B_unFrameBuffer_5D__3E_CvyuCvyuREFs_5B__c_vyvec2f_5D_REFs_5B_vyRay_5D_un_3C_s_5B_vyLDSampler_5D__3E_un_3C_s_5B_vyRandomSampler_5D__3E_avx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#12 0x00007f2157a968d3 in PathTracer_renderTileJob___un_3C_s_5B_unPathTracer_5D__3E_un_3C_s_5B_unFrameBuffer_5D__3E_un_3C_s_5B_unCamera_5D__3E_un_3C_s_5B_unWorld_5D__3E_REFs_5B_unTile_5D_uniavx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#13 0x00007f21579f84e4 in Renderer_renderTile ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
...

Click on volume:

OSPRay error: null handle provided to void ospRelease(OSPObject)
pure virtual method called
pure virtual method called

Thread 6 "ospExamples" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe9b77700 (LWP 239299)]
0x00007ffff7fca5f0 in typeinfo for ospray::testing::Boxes ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_testing.so.1
(gdb) bt
#0  0x00007ffff7fca5f0 in typeinfo for ospray::testing::Boxes ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_testing.so.1
#1  0x00007ffff7eba087 in vklInitIntervalIterator8 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libopenvkl.so
#2  0x00007ffff6e531cb in delta_tracking___un_3C_s_5B_unVolumetricModel_5D__3E_REFs_5B__c_vyVolumeInterval_5D_un_3C_s_5B_vyRandomSampler_5D__3E_REFs_5B__c_vyvec3f_5D_REFs_5B__c_vyvec3f_5D_REFvyfREFs_5B_vyvec3f_5D_avx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#3  0x00007ffff6e5166f in volumeTransmittance___REFs_5B__c_vyPathState_5D_un_3C_s_5B__c_unWorld_5D__3E_REFs_5B_vyRay_5D_un_3C_s_5B_vyLDSampler_5D__3E_un_3C_s_5B_vyRandomSampler_5D__3E_avx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#4  0x00007ffff6e00354 in nextEventEstimation___REFs_5B__c_vyPathContext_5D_REFs_5B__c_vyPathState_5D_REFs_5B_vyPathVertex_5D_avx2 () from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#5  0x00007ffff6dbae52 in samplePath___REFs_5B__c_vyPathContext_5D_REFs_5B_vyPathState_5D_REFs_5B_vyRay_5D_REFs_5B_vyScreenSample_5D_avx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#6  0x00007ffff6d8d906 in PathTraceIntegrator_Li___un_3C_s_5B__c_unPathTracer_5D__3E_un_3C_s_5B__c_unWorld_5D__3E_un_3C_s_5B_unFrameBuffer_5D__3E_CvyuCvyuREFs_5B__c_vyvec2f_5D_REFs_5B_vyRay_5D_un_3C_s_5B_vyLDSampler_5D__3E_un_3C_s_5B_vyRandomSampler_5D__3E_avx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#7  0x00007ffff6d8f8d3 in PathTracer_renderTileJob___un_3C_s_5B_unPathTracer_5D__3E_un_3C_s_5B_unFrameBuffer_5D__3E_un_3C_s_5B_unCamera_5D__3E_un_3C_s_5B_unWorld_5D__3E_REFs_5B_unTile_5D_uniavx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#8  0x00007ffff6cf14e4 in Renderer_renderTile ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so

Click on volume (different place in the code):

OSPRay error: null handle provided to void ospRelease(OSPObject)
pure virtual method called
pure virtual method called
pure virtual method called
terminate called without an active exception
terminate called recursively
terminate called recursively

Thread 5 "ospExamples" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffea379700 (LWP 239327)]
0x00007ffff7705f25 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7705f25 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff76ef897 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff7aba6ad in __gnu_cxx::__verbose_terminate_handler ()
    at /build/gcc/src/gcc/libstdc++-v3/libsupc++/vterminate.cc:50
#3  0x00007ffff7ab84da in __cxxabiv1::__terminate (handler=<optimized out>)
    at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:47
#4  0x00007ffff7ab8537 in std::terminate () at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:57
#5  0x00007ffff7ab92e5 in __cxxabiv1::__cxa_pure_virtual ()
    at /build/gcc/src/gcc/libstdc++-v3/libsupc++/pure.cc:50
#6  0x00007ffff7ebb237 in vklComputeSample8 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libopenvkl.so
#7  0x00007ffff6e5407f in delta_tracking___un_3C_s_5B_unVolumetricModel_5D__3E_REFs_5B__c_vyVolumeInterval_5D_un_3C_s_5B_vyRandomSampler_5D__3E_REFs_5B__c_vyvec3f_5D_REFs_5B__c_vyvec3f_5D_REFvyfREFs_5B_vyvec3f_5D_avx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#8  0x00007ffff6e53055 in volumeTransmittance___REFs_5B__c_vyPathState_5D_un_3C_s_5B__c_unWorld_5D__3E_REFs_5B_vyRay_5D_un_3C_s_5B_vyLDSampler_5D__3E_un_3C_s_5B_vyRandomSampler_5D__3E_avx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#9  0x00007ffff6e0132d in nextEventEstimation___REFs_5B__c_vyPathContext_5D_REFs_5B__c_vyPathState_5D_REFs_5B_vyPathVertex_5D_avx2 () from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#10 0x00007ffff6dbae52 in samplePath___REFs_5B__c_vyPathContext_5D_REFs_5B_vyPathState_5D_REFs_5B_vyRay_5D_REFs_5B_vyScreenSample_5D_avx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#11 0x00007ffff6d8d906 in PathTraceIntegrator_Li___un_3C_s_5B__c_unPathTracer_5D__3E_un_3C_s_5B__c_unWorld_5D__3E_un_3C_s_5B_unFrameBuffer_5D__3E_CvyuCvyuREFs_5B__c_vyvec2f_5D_REFs_5B_vyRay_5D_un_3C_s_5B_vyLDSampler_5D__3E_un_3C_s_5B_vyRandomSampler_5D__3E_avx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#12 0x00007ffff6d8f8d3 in PathTracer_renderTileJob___un_3C_s_5B_unPathTracer_5D__3E_un_3C_s_5B_unFrameBuffer_5D__3E_un_3C_s_5B_unCamera_5D__3E_un_3C_s_5B_unWorld_5D__3E_REFs_5B_unTile_5D_uniavx2 ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so
#13 0x00007ffff6cf14e4 in Renderer_renderTile ()
   from /home/paulm/software/ospray-superbuild-git/bin/../lib64/libospray_module_ispc.so

And with the boxes scene: middle click on the background exits with a OSPRay error: null handle provided to void ospRelease(OSPObject)

jeffamstutz commented 4 years ago

Guarding the ospRelease() in cpp::ManagedObject destructor with an if (ospObject) fixes this. I'll incorporate that into what I'm about to merge. Thanks!

jeffamstutz commented 4 years ago

This is fixed in 39d1f273c.