Skip to content

Possible race condition with PathTracer and tbb #571

@sankhesh

Description

@sankhesh

Running into a segfault with vtk's TestPathTracerMaterials sometimes.

Ref: https://open.cdash.org/testSummary.php?project=11&name=VTK::RenderingRayTracingCxx-TestPathTracerMaterials&date=2023-09-01

Stack trace

Thread 14 "vtkRenderingRay" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc6ffb6c0 (LWP 243266)]
FresnelConductorSpectral_create___un_3C_s_5B_unShadingContext_5D__3E_REFCunf_3C_8_3E_REFCunf_3C_8_3E__avx512skx (ctx=0x7fffc6fb45c0, eta=..., k=...) at /home/sankhesh/Projects/ospray/ospray/modules/cpu/render/bsdfs/Fresnel.ih:310
310       self->eta = eta;
(gdb) bt
#0  FresnelConductorSpectral_create___un_3C_s_5B_unShadingContext_5D__3E_REFCunf_3C_8_3E_REFCunf_3C_8_3E__avx512skx (ctx=0x7fffc6fb45c0, eta=..., k=...) at /home/sankhesh/Projects/ospray/ospray/modules/cpu/render/bsdfs/Fresnel.ih:310
#1  Metal_getBSDF___un_3C_s_5B__c_unMaterial_5D__3E_un_3C_s_5B_unShadingContext_5D__3E_REFs_5B__c_vyDifferentialGeometry_5D_REFs_5B__c_vyRay_5D_REFs_5B__c_vyMedium_5D__avx512skx (super=0x5555568304b0, ctx=0x7fffc6fb45c0, dg=..., __anon_parameter_3=..., __anon_parameter_4=...) at Metal.ispc:29
#2  0x00007fffeaaf8c36 in samplePath___REFs_5B__c_vyPathContext_5D_REFs_5B_vyPathState_5D_REFs_5B_vyRay_5D_REFs_5B_vyScreenSample_5D_REFs_5B__c_unFeatureFlagsHandler_5D__avx512skx (pathContext=..., pathState=..., ray=..., sample=..., ffh=...) at PathSampler.ispc:276
#3  0x00007fffeaabad11 in PathTraceIntegrator_Li___un_3C_s_5B__c_unPathTracer_5D__3E_un_3C_s_5B__c_unWorld_5D__3E_REFs_5B__c_vyvec2f_5D_REFs_5B_vyRay_5D_un_3C_s_5B_vyLDSampler_5D__3E_un_3C_s_5B_vyRandomSampler_5D__3E_REFs_5B__c_unFeatureFlagsHandler_5D__avx512skx (self=0x5555568308f0, world=0x555557810560, ldSampler=<optimized out>, randomSampler=<optimized out>, ffh=..., pixel=..., ray=...) at PathTracer.ispc:92
#4  PathTracer_renderPixel___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_CvyuCvyuCvyuREFs_5B__c_unFeatureFlagsHandler_5D__avx512skx (self=0x5555568308f0, fb=0x555556d73c30, camera=0x5555568470f0, world=0x555557810560, ix=..., iy=..., accumID=..., ffh=...) at PathTracer.ispc:158
#5  0x00007fffeaabb420 in PathTracer_renderTask___un_3C_s_5B_unRenderer_5D__3E_un_3C_s_5B_unFrameBuffer_5D__3E_un_3C_s_5B_unCamera_5D__3E_un_3C_s_5B_unWorld_5D__3E_un_3C_Cunu_3E_REFs_5B__c_unFeatureFlagsHandler_5D__avx512skx (_self=<optimized out>, fb=0x555556d73c30, camera=0x5555568470f0, world=0x555557810560, taskIDs=<optimized out>, ffh=...) at PathTracer.ispc:220
#6  0x00007fffeafcc708 in operator() (__closure=0x7fffc6bf84b0, i=3210) at /home/sankhesh/Projects/ospray/ospray/modules/cpu/ispc_tasksys.cpp:57
#7  0x00007fffeafcd6d8 in tbb::detail::d1::parallel_for_body_wrapper<rkcommon::ISPCLaunch(void**, void*, void*, int, int, int)::<lambda(size_t)>, long unsigned int>::operator()(const tbb::detail::d1::blocked_range<unsigned long> &) const (this=0x7fffde5a2e58, r=...) at /home/sankhesh/Projects/ospray/install/include/oneapi/tbb/parallel_for.h:211
#8  0x00007fffeafcd4cf in tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<long unsigned int>, tbb::detail::d1::parallel_for_body_wrapper<rkcommon::ISPCLaunch(void**, void*, void*, int, int, int)::<lambda(size_t)>, long unsigned int>, const tbb::detail::d1::auto_partitioner>::run_body(tbb::detail::d1::blocked_range<unsigned long> &) (this=0x7fffde5a2e00, r=...)
    at /home/sankhesh/Projects/ospray/install/include/oneapi/tbb/parallel_for.h:122
#9  0x00007fffeafcd2cd in tbb::detail::d1::dynamic_grainsize_mode<tbb::detail::d1::adaptive_mode<tbb::detail::d1::auto_partition_type> >::work_balance<tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<long unsigned int>, tbb::detail::d1::parallel_for_body_wrapper<rkcommon::ISPCLaunch(void**, void*, void*, int, int, int)::<lambda(size_t)>, long unsigned int>, const tbb::detail::d1::auto_partitioner>, tbb::detail::d1::blocked_range<long unsigned int> >(tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<long unsigned int>, tbb::detail::d1::parallel_for_body_wrapper<rkcommon::ISPCLaunch(void**, void*, void*, int, int, int)::<lambda(size_t)>, long unsigned int>, const tbb::detail::d1::auto_partitioner> &, tbb::detail::d1::blocked_range<unsigned long> &, tbb::detail::d1::execution_data &) (this=0x7fffde5a2e78, start=..., range=...,
    ed=...) at /home/sankhesh/Projects/ospray/install/include/oneapi/tbb/partitioner.h:450
#10 0x00007fffeafcd001 in tbb::detail::d1::partition_type_base<tbb::detail::d1::auto_partition_type>::execute<tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<long unsigned int>, tbb::detail::d1::parallel_for_body_wrapper<rkcommon::ISPCLaunch(void**, void*, void*, int, int, int)::<lambda(size_t)>, long unsigned int>, const tbb::detail::d1::auto_partitioner>, tbb::detail::d1::blocked_range<long unsigned int> >(tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<long unsigned int>, tbb::detail::d1::parallel_for_body_wrapper<rkcommon::ISPCLaunch(void**, void*, void*, int, int, int)::<lambda(size_t)>, long unsigned int>, const tbb::detail::d1::auto_partitioner> &, tbb::detail::d1::blocked_range<unsigned long> &, tbb::detail::d1::execution_data &) (this=0x7fffde5a2e78, start=..., range=..., ed=...)
    at /home/sankhesh/Projects/ospray/install/include/oneapi/tbb/partitioner.h:289
#11 0x00007fffeafcce1c in tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<long unsigned int>, tbb::detail::d1::parallel_for_body_wrapper<rkcommon::ISPCLaunch(void**, void*, void*, int, int, int)::<lambda(size_t)>, long unsigned int>, const tbb::detail::d1::auto_partitioner>::execute(tbb::detail::d1::execution_data &) (this=0x7fffde5a2e00, ed=...)
    at /home/sankhesh/Projects/ospray/install/include/oneapi/tbb/parallel_for.h:175
#12 0x00007fffec63b15e in tbb::detail::r1::task_dispatcher::local_wait_for_all<false, tbb::detail::r1::outermost_worker_waiter> (this=0x7fffde30cf00, t=0x7fffde5a2e00, waiter=...) at /localdisk/ci/runner007/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/task_dispatcher.h:322
#13 0x00007fffec61bd4b in tbb::detail::r1::task_dispatcher::local_wait_for_all<tbb::detail::r1::outermost_worker_waiter> (this=0x5555568304b0, t=<optimized out>, waiter=...) at /localdisk/ci/runner007/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/task_dispatcher.h:458
#14 tbb::detail::r1::arena::process (this=0x5555568304b0, tls=...) at /localdisk/ci/runner007/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/arena.cpp:137
#15 0x00007fffec61b446 in tbb::detail::r1::market::process (this=0x5555568304b0, j=...) at /localdisk/ci/runner007/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/market.cpp:599
#16 0x00007fffec6207dc in tbb::detail::r1::rml::private_worker::run (this=0x5555568304b0) at /localdisk/ci/runner007/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/private_server.cpp:271
#17 0x00007fffec620766 in tbb::detail::r1::rml::private_worker::thread_routine (arg=0x5555568304b0) at /localdisk/ci/runner007/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/private_server.cpp:221
#18 0x00007ffff7c8c9eb in ?? () from /usr/lib/libc.so.6
#19 0x00007ffff7d10dfc in ?? () from /usr/lib/libc.so.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions