Page MenuHome

Mantaflow - Crash when enabling guides
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Linux-5.4.0-56-generic-x86_64-with-debian-bullseye-sid 64 Bits
Graphics card: AMD RAVEN (DRM 3.35.0, 5.4.0-56-generic, LLVM 10.0.0) X.Org 4.6 (Core Profile) Mesa 20.0.8

Blender Version
Broken: version:

  • 2.92.0 Alpha, branch: master, commit date: 2020-12-14 15:44, hash: rB010f44b855ca
  • 2.92.0 Alpha, branch: master, commit date: 2020-11-19 22:15, hash: rBfdd3032f8fad

Worked: 2.90.1, 2.91.0

Short description of error
When I enable "Guides" in the attached file blender crashes.

Exact steps for others to reproduce the error
Open the attached file and enable "Guides" in the mantaflow properties.

MANTA::readGuiding(MANTA * const this, FluidModifierData * fmd, int framenr, bool sourceDomain) (/home/dev/01-data/01-git/blender-git/blender/intern/mantaflow/intern/MANTA_main.cpp:1379)
manta_read_guiding(MANTA * fluid, FluidModifierData * fmd, int framenr, bool sourceDomain) (/home/dev/01-data/01-git/blender-git/blender/intern/mantaflow/intern/manta_fluid_API.cpp:99)
BKE_fluid_modifier_processDomain(FluidModifierData * fmd, Depsgraph * depsgraph, Scene * scene, Object * ob, Mesh * me, const int scene_framenr) (/home/dev/01-data/01-git/blender-git/blender/source/blender/blenkernel/intern/fluid.c:4022)
BKE_fluid_modifier_process(FluidModifierData * fmd, Depsgraph * depsgraph, Scene * scene, Object * ob, Mesh * me) (/home/dev/01-data/01-git/blender-git/blender/source/blender/blenkernel/intern/fluid.c:4154)
BKE_fluid_modifier_do(FluidModifierData * fmd, Depsgraph * depsgraph, Scene * scene, Object * ob, Mesh * me) (/home/dev/01-data/01-git/blender-git/blender/source/blender/blenkernel/intern/fluid.c:4172)
modifyMesh(ModifierData * md, const ModifierEvalContext * ctx, Mesh * me) (/home/dev/01-data/01-git/blender-git/blender/source/blender/modifiers/intern/MOD_fluid.c:130)
BKE_modifier_modify_mesh(ModifierData * md, const ModifierEvalContext * ctx, struct Mesh * me) (/home/dev/01-data/01-git/blender-git/blender/source/blender/blenkernel/intern/modifier.c:1055)
mesh_calc_modifiers(Depsgraph * depsgraph, Scene * scene, Object * ob, int useDeform, const bool need_mapping, const CustomData_MeshMasks * dataMask, const int index, const bool use_cache, const bool allow_shared_mesh, Mesh ** r_deform, Mesh ** r_final) (/home/dev/01-data/01-git/blender-git/blender/source/blender/blenkernel/intern/DerivedMesh.cc:1200)
mesh_build_data(Depsgraph * depsgraph, Scene * scene, Object * ob, const CustomData_MeshMasks * dataMask, const bool need_mapping) (/home/dev/01-data/01-git/blender-git/blender/source/blender/blenkernel/intern/DerivedMesh.cc:1806)
makeDerivedMesh(Depsgraph * depsgraph, Scene * scene, Object * ob, BMEditMesh * em, const CustomData_MeshMasks * dataMask) (/home/dev/01-data/01-git/blender-git/blender/source/blender/blenkernel/intern/DerivedMesh.cc:1944)
BKE_object_handle_data_update(Depsgraph * depsgraph, Scene * scene, Object * ob) (/home/dev/01-data/01-git/blender-git/blender/source/blender/blenkernel/intern/object_update.c:193)
BKE_object_eval_uber_data(Depsgraph * depsgraph, Scene * scene, Object * ob) (/home/dev/01-data/01-git/blender-git/blender/source/blender/blenkernel/intern/object_update.c:385)
std::__invoke_impl<void, void (*&)(Depsgraph*, Scene*, Object*), Depsgraph*, Scene*&, Object*&>(void (*&)(Depsgraph *, Scene *, Object *) __f) (/usr/include/c++/9/bits/invoke.h:60)
std::__invoke<void (*&)(Depsgraph*, Scene*, Object*), Depsgraph*, Scene*&, Object*&>(void (*&)(Depsgraph *, Scene *, Object *) __fn) (/usr/include/c++/9/bits/invoke.h:95)
std::_Bind<void (*(std::_Placeholder<1>, Scene*, Object*))(Depsgraph*, Scene*, Object*)>::__call<void, Depsgraph*&&, 0ul, 1ul, 2ul>(std::tuple<Depsgraph*&&>&&, std::_Index_tuple<0ul, 1ul, 2ul>)(std::_Bind<void (*(std::_Placeholder<1>, Scene*, Object*))(Depsgraph*, Scene*, Object*)> * const this, std::tuple<Depsgraph*&&> && __args) (/usr/include/c++/9/functional:400)
std::_Bind<void (*(std::_Placeholder<1>, Scene*, Object*))(Depsgraph*, Scene*, Object*)>::operator()<Depsgraph*, void>(Depsgraph*&&)(std::_Bind<void (*(std::_Placeholder<1>, Scene*, Object*))(Depsgraph*, Scene*, Object*)> * const this) (/usr/include/c++/9/functional:484)
std::_Function_handler<void (Depsgraph*), std::_Bind<void (*(std::_Placeholder<1>, Scene*, Object*))(Depsgraph*, Scene*, Object*)> >::_M_invoke(std::_Any_data const&, Depsgraph*&&)(const std::_Any_data & __functor,  __args#0) (/usr/include/c++/9/bits/std_function.h:300)
std::function<void (Depsgraph*)>::operator()(Depsgraph*) const(const std::function<void(Depsgraph*)> * const this,  __args#0) (/usr/include/c++/9/bits/std_function.h:688)
blender::deg::(anonymous namespace)::evaluate_node(const blender::deg::(anonymous namespace)::DepsgraphEvalState * state, blender::deg::OperationNode * operation_node) (/home/dev/01-data/01-git/blender-git/blender/source/blender/depsgraph/intern/eval/deg_eval.cc:113)
blender::deg::(anonymous namespace)::deg_task_run_func(TaskPool * pool, void * taskdata) (/home/dev/01-data/01-git/blender-git/blender/source/blender/depsgraph/intern/eval/deg_eval.cc:124)

Revisions and Commits

Event Timeline

Robert Guetzkow (rjg) renamed this task from Mantaflow - Crash to Mantaflow - Crash when enabling guides.Dec 15 2020, 11:08 AM
Robert Guetzkow (rjg) updated the task description. (Show Details)
Robert Guetzkow (rjg) changed the task status from Needs Triage to Confirmed.Dec 15 2020, 11:10 AM

I can reproduce this both the with the attached file and from the default startup file. The fmd is NULL in MANTA::readGuiding.

Robert Guetzkow (rjg) triaged this task as High priority.Dec 15 2020, 11:16 AM
Robert Guetzkow (rjg) updated the task description. (Show Details)

Is this issue open for contributions? I was playing around with debugging this to test out my local development setup (breakpoints etc.), and I have a small patch that seems to address it while still leaving fluid simulation in tact.

@Pi Lanningham (Quantumplation) Patches are always welcome! This particular ticket has already been assigned to a developer though, so it might be a duplication of effort. Our wiki provides instructions how to submit a patch using arcanist or by creating a diff.

This seems to fix it already. However, I've never used fluid guides, so I don't know if this breaks something else...

diff
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index 2dc7d3cc9e9..367d0851034 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -4019,7 +4019,9 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *fmd,
     /* Read guide cache. */
     if (with_guide) {
       FluidModifierData *fmd2 = (with_gdomain) ? fmd_parent : fmd;
-      has_guide = manta_read_guiding(fds->fluid, fmd2, scene_framenr, with_gdomain);
+      if (fmd2) {
+        has_guide = manta_read_guiding(fds->fluid, fmd2, scene_framenr, with_gdomain);
+      }
     }
 
     /* Read noise and data cache */

@Sebastián Barschkis (sebbas), is this fix ok?

Jacques Lucke (JacquesLucke) changed the subtype of this task from "Report" to "Bug".Jan 4 2021, 11:47 AM