Home

Crash by cyclic use of Boolean Modifier
Closed, ResolvedPublic

Description
Steps to reproduce:

1. Create 2 cubes (cube1, cube2)
2. Add boolean modifier to cube1 and set Object=cube2
3. Add boolean modifier to cube2 and set Object=cube1

Then Blender crashes immediately outputting the following message:

Dependency cycle detected:
cube1 depends on cube2 through Boolean Modifier.
cube2 depends on cube1 through Boolean Modifier.

Segmentation fault (core dumped)
$

Such use of the modifier makes no sense, but we might do that accidentally and lose our data unexpectedly.

r51289
Ubuntu 12.10 amd64
irie (Shinsuke Irie) set Type to Bug.Via Old WorldOct 13 2012, 4:50 AM
mont29 (Bastien Montagne) added a comment.Via Old WorldOct 13 2012, 11:19 AM
We just run into an infinite loop, as boolean modifier expects the final mesh (i.e. with all modifiers applied) of its second operand…

Not sure though how to nicely fix that, perhaps returning to 2.63 code in applyModifer when getting second operand's dm (it indeed fixes the crash)? Or placing a sort of "watchdog" to prevent recursion?

Will leave this one to sergey! :)
sergey (Sergey Sharybin) added a comment.Via Old WorldOct 15 2012, 2:04 PM
That was a change from Campbell to support some special cases when objects from different layers are used.

Campbell, this indeed should be solved in a different way. Could you look into this?

Side note: the same could happen with array modifier when recursion appears on Start/End cap objects.
brecht (Brecht Van Lommel) added a comment.Via Old WorldNov 10 2012, 4:24 AM
At some point I changed all modifiers to use only derivedFinal and just fail if it is not available. This reveals issues in our dependency graph of course, which may not be possible to fix without a major refactor.

If this is an important case to have working now, it could do some manual check for recursion, like a flag in the modifier that is set/cleared before/after running.
moolah (Moolah Nasreddin) added a comment.Via Old WorldNov 10 2012, 2:24 PM
IMO, Blender lacks of "solid" working modifiers for creating full range of modern particle and mesh FX. So by now I suppose it's really better to have some hacks (before that major refactor) for several modifiers than NOT to have them. Boolean is a very important modifier for creating complex effects without tricky workarounds.
Committed workaround r54017, but ideal but avoids crash.
campbellbarton (Campbell Barton) closed this task as "Resolved".Via Old WorldJan 23 2013, 6:45 AM

Add Comment