Page MenuHome

New Depsgraph - Shrinkwrap crashes blender
Closed, ResolvedPublic

Description

System Information
Ubuntu 17.04 GTX 1080

Blender Version
Broken: bb4a12914fa

Short description of error
Shrinkwraps sometimes crash blender

Exact steps for others to reproduce the error

  1. open attached blend file with new depsgraph enabled
  2. middle mouse rotate about 5 degrees
  3. shift d a few times
  4. should crash

Event Timeline

Cant reproduce on locally built blender, only blender from buildbot... backtrace is as follows:

/home/user/blender/blender-2.79-bb4a12914fa-linux-glibc219-x86_64/blender(BLI_system_backtrace+0x20) [0x1a72fe0]
/home/user/blender/blender-2.79-bb4a12914fa-linux-glibc219-x86_64/blender() [0x107db08]
/lib/x86_64-linux-gnu/libc.so.6(+0x357f0) [0x7ffff63ac7f0]
/home/user/blender/blender-2.79-bb4a12914fa-linux-glibc219-x86_64/blender() [0x17693c7]
/home/user/blender/blender-2.79-bb4a12914fa-linux-glibc219-x86_64/blender(bvhtree_from_mesh_looptri+0x180) [0x176b150]
/home/user/blender/blender-2.79-bb4a12914fa-linux-glibc219-x86_64/blender(shrinkwrapModifier_deform+0x50d) [0x189365d]
/home/user/blender/blender-2.79-bb4a12914fa-linux-glibc219-x86_64/blender() [0x174bc28]
/home/user/blender/blender-2.79-bb4a12914fa-linux-glibc219-x86_64/blender() [0x174cdec]
/home/user/blender/blender-2.79-bb4a12914fa-linux-glibc219-x86_64/blender(makeDerivedMesh+0x70) [0x174cef0]
/home/user/blender/blender-2.79-bb4a12914fa-linux-glibc219-x86_64/blender(BKE_object_handle_data_update+0xf5) [0x183d525]
/home/user/blender/blender-2.79-bb4a12914fa-linux-glibc219-x86_64/blender(BKE_object_eval_uber_data+0x34) [0x183da64]
/home/user/blender/blender-2.79-bb4a12914fa-linux-glibc219-x86_64/blender() [0x1a87306]
/home/user/blender/blender-2.79-bb4a12914fa-linux-glibc219-x86_64/blender() [0x1a7326f]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76da) [0x7ffff79b86da]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x5f) [0x7ffff647fd7f]

managed to get it to crash on the locally built blender by tabbing in and out of the base mesh a few times:

bpy.ops.object.editmode_toggle()  # Operator
bpy.ops.object.editmode_toggle()  # Operator
bpy.ops.object.editmode_toggle()  # Operator
bpy.ops.object.editmode_toggle()  # Operator
bpy.ops.object.editmode_toggle()  # Operator
bpy.ops.mesh.select_all(action='TOGGLE')  # Operator
bpy.ops.mesh.select_all(action='TOGGLE')  # Operator
bpy.ops.mesh.select_all(action='TOGGLE')  # Operator
bpy.ops.mesh.select_all(action='TOGGLE')  # Operator
bpy.ops.mesh.select_all(action='TOGGLE')  # Operator
bpy.ops.mesh.select_all(action='TOGGLE')  # Operator
bpy.ops.mesh.select_all(action='TOGGLE')  # Operator
bpy.ops.mesh.select_all(action='TOGGLE')  # Operator
bpy.ops.mesh.select_all(action='TOGGLE')  # Operator
bpy.ops.object.editmode_toggle()  # Operator

# backtrace
/home/user/blender/blender-git/build_linux/bin/blender(BLI_system_backtrace+0x30) [0x555556992270]
/home/user/blender/blender-git/build_linux/bin/blender(+0xa60a41) [0x555555fb4a41]
/lib/x86_64-linux-gnu/libc.so.6(+0x357f0) [0x7ffff12d97f0]
/home/user/blender/blender-git/build_linux/bin/blender(+0x11048cb) [0x5555566588cb]
/home/user/blender/blender-git/build_linux/bin/blender(bvhtree_from_mesh_looptri+0x200) [0x55555665a9b0]
/home/user/blender/blender-git/build_linux/bin/blender(shrinkwrapModifier_deform+0x5f2) [0x555556783f02]
/home/user/blender/blender-git/build_linux/bin/blender(+0x10e5cf0) [0x555556639cf0]
/home/user/blender/blender-git/build_linux/bin/blender(+0x10e6eb0) [0x55555663aeb0]
/home/user/blender/blender-git/build_linux/bin/blender(makeDerivedMesh+0x90) [0x55555663afd0]
/home/user/blender/blender-git/build_linux/bin/blender(BKE_object_handle_data_update+0x4a8) [0x555556733958]
/home/user/blender/blender-git/build_linux/bin/blender(BKE_object_eval_uber_data+0x34) [0x555556733af4]
/home/user/blender/blender-git/build_linux/bin/blender(+0x1452913) [0x5555569a6913]
/home/user/blender/blender-git/build_linux/bin/blender(+0x143e530) [0x555556992530]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76da) [0x7ffff538a6da]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x5f) [0x7ffff13acd7f]
Sergey Sharybin (sergey) claimed this task.
Sergey Sharybin (sergey) triaged this task as Normal priority.

Hard to reproduce, and don't see anything wrong in depsgraph itself (all relations are correct). Suspect some threading conflict when building shrinkwrap target BVH. Could take a while to investigate :(

At the meantime, try running blender with --debug-depsgraph-no-threads command line argument and see if that fixes anything.

the --debug-depsgraph-no-threads does make it more stable definitely. The other thing we noticed was that if we triangulate the base mesh it seems to be a lot more stable as well. Not sure if that is of help at all with the bug hunting

What do you mean by "more stable"? Does the same exact crash happens?

In my brief testing I cant make it crash with either fix, but I am unsure if its just less often now or whether it fixed the issue.