Page MenuHome

Boolean union causing crash when combined with a dependency loop (2.93 regression)
Closed, ResolvedPublic

Description

System Information:
Operating system: Linux-5.10.0-4-amd64-x86_64-with-debian-bullseye-sid 64 Bits
Graphics card: GeForce RTX 3070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.67

Blender Version:
Broken: 2.93.0 Alpha, branch: master, commit date: 2021-03-24 01:38, hash: rB3f47df577d05
Worked: 2.92 release (Technically it doesn't work in 2.92, but Blender doesn't crash when doing this which is why I've listed it as "worked")

Short description of error:
I've found that when the boolean union modifier is used on an object with the target object also having a boolean modifier that has this object as it's target, Blender will crash (in some situations). Here's my crash log:


Technically this is a dependency loop and as such a user shouldn't be doing this, but I've found that from time to time I can accidentally select the wrong object with the eye dropper and as such this crash can occur.

Exact steps for others to reproduce the error:
Watch the video or read the steps below.

  1. With the "General" startup file, select the cube and duplicate it and move it.
  2. Now select the original cube and add a boolean modifier to it set to Difference mode and with the duplicate cube as the target.
  3. Now select the duplicate cube and give it a boolean modifier set to Union mode with the original cube as the target. Blender will crash.

Note: In step 2 I tell you to select the original cube then add the Difference boolean modifier to it. If you instead give the difference modifier to the duplicated cube, Blender will not crash unless you change a setting on the duplicate cubes modifier after setting up the union modifier. Not sure why.

EDIT:
Added a test file.

Event Timeline

Alaska (Alaska) updated the task description. (Show Details)
Falk David (filedescriptor) changed the task status from Needs Triage to Confirmed.Mar 24 2021, 10:23 AM
Falk David (filedescriptor) updated the task description. (Show Details)

I can reproduce this crash on the latest 2.93.0 Alpha, branch: master, commit date: 2021-03-24 08:34, hash: rB865025c343ac.

Ran this through a debug build. The crash happens in blender/source/blender/modifiers/intern/MOD_boolean.c:663 because mesh_operand is NULL.

mesh_operand = BKE_modifier_get_evaluated_mesh_from_evaluated_object(bmd->object, false);
BKE_mesh_wrapper_ensure_mdata(mesh_operand);

@Hans Goudey (HooglyBoogly) Does this just need a NULL check?

The dependency graph detects the cycle correctly:

Dependency cycle detected:
  OBCube/Geometry Component/GEOMETRY_EVAL() depends on
  OBCube.001/Geometry Component/GEOMETRY_EVAL() via 'Boolean Modifier'
  OBCube/Geometry Component/GEOMETRY_EVAL() via 'Boolean Modifier'
Detected 1 dependency cycles

Honestly I'm not sure, I didn't work on this code really. If a NULL check fixes this problem it looks like it would be reasonable to add.

Yes, a NULL check was all that was needed (and also in the similar Collection case). Thanks for the report. Fixed.