Maniphest T101458

Cycles: Changing volume density when path guiding is enabled causes crash
Closed, Resolved

Assigned To
Sebastian Herholz (sherholz)
Authored By
Sun Kim (persun)
Sep 29 2022, 10:50 AM
Tags
  • BF Blender
  • Cycles
  • Render & Cycles
Subscribers
Brecht Van Lommel (brecht)
Omar Emara (OmarSquircleArt)
Philipp Oeser (lichtwerk)
Sebastian Herholz (sherholz)
Sun Kim (persun)

Description

System Information
Operating system: Windows-10-10.0.19043-SP0 64 Bits
Graphics card: Radeon RX 570 Series ATI Technologies Inc. 4.5.14800 Core Profile Context 22.5.1 30.0.15021.11005

Blender Version
Broken: version: 3.4.0 Alpha, branch: master, commit date: 2022-09-29 01:57, hash: rBe2df1958449a
Worked: n/a

Short description of error
Blender crashes on Cycles render preview if I change volume density when path guiding is enabled.

Exact steps for others to reproduce the error

  • Open the above file. The scene has an object with volume material and path guiding is enabled
  • Go render preview. Wait until it starts to render
  • Change volume material's density value to something else
  • Crash

Revisions and Commits

rB Blender

Event Timeline

Sun Kim (persun) created this task.Sep 29 2022, 10:50 AM
Sun Kim (persun) updated the task description.Sep 29 2022, 10:58 AM
Omar Emara (OmarSquircleArt) changed the task status from Needs Triage to Confirmed.Sep 29 2022, 11:12 AM
Omar Emara (OmarSquircleArt) added projects: Cycles, Render & Cycles.
Omar Emara (OmarSquircleArt) added a subscriber: Omar Emara (OmarSquircleArt).
* thread #18, name = 'blender', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
    frame #0: 0x0000000004101045 blender`openpgl::cpp::VolumeSamplingDistribution::PDF(this=0x0000000000000000, direction=0x00007fffeeb972c0) const at VolumeSamplingDistribution.h:183:5
   180
   181  OPENPGL_INLINE float VolumeSamplingDistribution::PDF(const pgl_vec3f& direction) const
   182  {
-> 183      OPENPGL_ASSERT(m_volumeSamplingDistributionHandle);
   184      return pglVolumeSamplingDistributionPDF(m_volumeSamplingDistributionHandle, direction);
   185  }
   186
(lldb) bt
* thread #18, name = 'blender', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
  * frame #0: 0x0000000004101045 blender`openpgl::cpp::VolumeSamplingDistribution::PDF(this=0x0000000000000000, direction=0x00007fffeeb972c0) const at VolumeSamplingDistribution.h:183:5
    frame #1: 0x0000000005988922 blender`ccl::volume_shader_phase_eval(ccl::KernelGlobalsCPU const*, ccl::IntegratorStateCPU*, ccl::ShaderData const*, ccl::ShaderVolumePhases const*, ccl::float3, ccl::BsdfEval*) [inlined] ccl::guiding_phase_pdf(kg=0x00007fff7c17f270, state=0x00007fffeeba1d70, omega_in=const ccl::float3 @ 0x00007fffeeb971e0) at guiding.h:536:49
    frame #2: 0x00000000059888a0 blender`ccl::volume_shader_phase_eval(kg=0x00007fff7c17f270, state=0x00007fffeeba1d70, sd=0x00007fffeeb9f850, phases=0x00007fffeeb9f600, omega_in=const ccl::float3 @ 0x00007fffeeb9de30, phase_eval=0x00007fffeeb9de40) at volume_shader.h:262:29
    frame #3: 0x00000000058a6642 blender`ccl::volume_integrate(ccl::KernelGlobalsCPU const*, ccl::IntegratorStateCPU*, ccl::Ray*, float*) [inlined] ccl::integrate_volume_direct_light(kg=0x00007fff7c17f270, state=0x00007fffeeba1d70, sd=0x00007fffeeb9f850, rng_state=0x00007fffeeb9d5f0, P=const ccl::float3 @ 0x00007fffeeb9d4d0, phases=0x00007fffeeb9f600, throughput=ccl::Spectrum @ 0x00007fffeeb9d4c0, ls=0x00007fffeeb9f540) at shade_volume.h:766:21
    frame #4: 0x00000000058a6173 blender`ccl::volume_integrate(kg=0x00007fff7c17f270, state=0x00007fffeeba1d70, ray=0x00007fffeeba1a50, render_buffer=0x00007fff7c189e30) at shade_volume.h:1057:5
    frame #5: 0x00000000055ec6f2 blender`ccl::integrator_shade_volume(kg=0x00007fff7c17f270, state=0x00007fffeeba1d70, render_buffer=0x00007fff7c189e30) at shade_volume.h:1121:32
    frame #6: 0x00000000055eded7 blender`ccl::integrator_megakernel(kg=0x00007fff7c17f270, state=0x00007fffeeba1d70, render_buffer=0x00007fff7c189e30) at megakernel.h:75:11
    frame #7: 0x00000000055edb15 blender`ccl::kernel_cpu_avx2_integrator_megakernel(kg=0x00007fff7c17f270, state=0x00007fffeeba1d70, render_buffer=0x00007fff7c189e30) at kernel_arch_impl.h:109:1
    frame #8: 0x0000000006224915 blender`auto ccl::CPUKernelFunction<void (*)(ccl::KernelGlobalsCPU const*, ccl::IntegratorStateCPU*, float*)>::operator(this=0x00000000164c8878, args=0x00007fff7c17f270, args=0x00007fffeeba1d70, args=0x00007fff7c189e30)<ccl::KernelGlobalsCPU*, ccl::IntegratorStateCPU*, float*>(ccl::KernelGlobalsCPU*, ccl::IntegratorStateCPU*, float*) const at kernel_function.h:33:12
    frame #9: 0x000000000621fcce blender`ccl::PathTraceWorkCPU::render_samples_full_pipeline(this=0x00007fff780955a0, kernel_globals=0x00007fff7c17f270, work_tile=0x00007fffeebba828, samples_num=16) at path_trace_work_cpu.cpp:147:5
    frame #10: 0x0000000006221607 blender`ccl::PathTraceWorkCPU::render_samples(this=0x00007fff84a48ab0, work_index=419)::$_0::operator()() const::'lambda'(long)::operator()(long) const at path_trace_work_cpu.cpp:98:7
    frame #11: 0x00000000062214db blender`tbb::internal::parallel_for_body<ccl::PathTraceWorkCPU::render_samples(ccl::PathTraceWork::RenderStatistics&, int, int, int)::$_0::operator()() const::'lambda'(long), long>::operator(this=0x00007fffe8008960, r=0x00007fffeebba998)(tbb::blocked_range<long> const&) const at parallel_for.h:177:17
    frame #12: 0x00000000062213da blender`tbb::interface9::internal::start_for<tbb::blocked_range<long>, tbb::internal::parallel_for_body<ccl::PathTraceWorkCPU::render_samples(ccl::PathTraceWork::RenderStatistics&, int, int, int)::$_0::operator()() const::'lambda'(long), long>, tbb::auto_partitioner const>::run_body(this=0x00007fffe8008940, r=0x00007fffeebba998) at parallel_for.h:115:13
    frame #13: 0x0000000006221222 blender`void tbb::interface9::internal::dynamic_grainsize_mode<tbb::interface9::internal::adaptive_mode<tbb::interface9::internal::auto_partition_type> >::work_balance<tbb::interface9::internal::start_for<tbb::blocked_range<long>, tbb::internal::parallel_for_body<ccl::PathTraceWorkCPU::render_samples(this=0x00007fffe8008978, start=0x00007fffe8008940, range=0x00007fffe8008948)::$_0::operator()() const::'lambda'(long), long>, tbb::auto_partitioner const>, tbb::blocked_range<long> >(tbb::interface9::internal::start_for<tbb::blocked_range<long>, tbb::internal::parallel_for_body<ccl::PathTraceWorkCPU::render_samples(ccl::PathTraceWork::RenderStatistics&, int, int, int)::$_0::operator()() const::'lambda'(long), long>, tbb::auto_partitioner const>&, tbb::blocked_range<long>&) at partitioner.h:438:23
    frame #14: 0x0000000006220f40 blender`void tbb::interface9::internal::partition_type_base<tbb::interface9::internal::auto_partition_type>::execute<tbb::interface9::internal::start_for<tbb::blocked_range<long>, tbb::internal::parallel_for_body<ccl::PathTraceWorkCPU::render_samples(this=0x00007fffe8008978, start=0x00007fffe8008940, range=0x00007fffe8008948)::$_0::operator()() const::'lambda'(long), long>, tbb::auto_partitioner const>, tbb::blocked_range<long> >(tbb::interface9::internal::start_for<tbb::blocked_range<long>, tbb::internal::parallel_for_body<ccl::PathTraceWorkCPU::render_samples(ccl::PathTraceWork::RenderStatistics&, int, int, int)::$_0::operator()() const::'lambda'(long), long>, tbb::auto_partitioner const>&, tbb::blocked_range<long>&) at partitioner.h:256:16
    frame #15: 0x0000000006220e27 blender`tbb::interface9::internal::start_for<tbb::blocked_range<long>, tbb::internal::parallel_for_body<ccl::PathTraceWorkCPU::render_samples(ccl::PathTraceWork::RenderStatistics&, int, int, int)::$_0::operator()() const::'lambda'(long), long>, tbb::auto_partitioner const>::execute(this=0x00007fffe8008940) at parallel_for.h:142:22
    frame #16: 0x0000000000a3dd35 blender`tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::process_bypass_loop(tbb::internal::context_guard_helper<false>&, tbb::task*, long) + 533
    frame #17: 0x0000000000a3dfeb blender`tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task&, tbb::task*) + 235
    frame #18: 0x0000000000a29c57 blender`tbb::internal::arena::process(tbb::internal::generic_scheduler&) + 391
    frame #19: 0x0000000000a36ac0 blender`tbb::internal::market::process(rml::job&) + 32
    frame #20: 0x0000000000a38d8c blender`tbb::internal::rml::private_worker::run() + 76
    frame #21: 0x0000000000a38f89 blender`tbb::internal::rml::private_worker::thread_routine(void*) + 9
    frame #22: 0x00007ffff7e4c74d libc.so.6`___lldb_unnamed_symbol3500 + 717
    frame #23: 0x00007ffff7ece700 libc.so.6`___lldb_unnamed_symbol3926 + 11
Omar Emara (OmarSquircleArt) added a subscriber: Sebastian Herholz (sherholz).Sep 29 2022, 11:12 AM
Philipp Oeser (lichtwerk) added subscribers: Brecht Van Lommel (brecht), Philipp Oeser (lichtwerk).Sep 30 2022, 9:25 AM

CC @Sebastian Herholz (sherholz)
CC @Brecht Van Lommel (brecht)

Sebastian Herholz (sherholz) added a comment.Oct 5 2022, 2:11 PM

@Sun Kim (persun) I can replicate the bug and I might have found the cause of the problem.
On my system (18c/36t Linux), it could take up to one minute of constantly changing the density parameter before a crash happens,
is this similar to your experience, or does it crash on your system right away?

Sun Kim (persun) added a comment.Oct 5 2022, 2:21 PM
In T101458#1427879, @Sebastian Herholz (sherholz) wrote:

is this similar to your experience, or does it crash on your system right away?

Not right away but it only takes a second or two in my case.

Sebastian Herholz (sherholz) added a comment.Oct 6 2022, 12:36 PM

@Sun Kim (persun) could you try out the following experimental build and check if the problem is fixed?
https://builder.blender.org/download/experimental/cycles_path_guiding/

I tried to replicate the bug on three systems, and while I could replicate it, it often took more than 1min of constantly changing the parameters to trigger it.
One potential bug I found that hopefully fixes this problem was an uninitialized parameter.

Sun Kim (persun) added a comment.Oct 6 2022, 1:24 PM
In T101458#1428467, @Sebastian Herholz (sherholz) wrote:

@Sun Kim (persun) could you try out the following experimental build and check if the problem is fixed?

No crash with this build. I also played with some scenes (the report file and other file where I discovered this issue) with 10 minutes or so just in case, and it still doesn't crash. ;)

Sebastian Herholz (sherholz) closed this task as Resolved by committing rBe1a334875567: Fix T101458: Changing volume density when pg is enabled causes crash.Oct 6 2022, 2:40 PM
Sebastian Herholz (sherholz) claimed this task.
Sebastian Herholz (sherholz) added a commit: rBe1a334875567: Fix T101458: Changing volume density when pg is enabled causes crash.