Blender 2.80 Crashes in Rigid Body World Sim #59607

Closed
opened 2018-12-19 09:12:41 +01:00 by Matthias babisch · 9 comments

System Information
Operating system: Debian Buster
Graphics card: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] (rev a1)

Blender Version
Broken: blender-2.80-d46d8e831ce-linux-glibc224-x86_64

Short description of error
Segmentation Fault occured not in an obvious repeatable way. Got a Backtrace from gdb.

Exact steps for others to reproduce the error
I am playing around with Physics and Scripting. Dont know how to repeat the crash. It occured when running a simulation of a few stacked boxes in or before simulating the first frame.

[New Thread 0x7fff98cb6700 (LWP 7540)]

Thread 47 "blender" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd3960700 (LWP 31163)]
0x0000000001d5e337 in btDbvtBroadphase::destroyProxy(btBroadphaseProxy*, btDispatcher*) ()
(gdb) bt

  • 0 0x0000000001d5e337 in btDbvtBroadphase::destroyProxy(btBroadphaseProxy*, btDispatcher*) ()
  • 1 0x0000000001d6cb02 in btCollisionWorld::~btCollisionWorld() ()
  • 2 0x0000000001dc7a29 in btDiscreteDynamicsWorld::~btDiscreteDynamicsWorld() ()
  • 3 0x00000000019da0f2 in RB_dworld_delete ()
  • 4 0x0000000001971456 in BKE_rigidbody_validate_sim_world ()
  • 5 0x00000000019725c0 in rigidbody_update_simulation ()
  • 6 0x000000000197290b in BKE_rigidbody_rebuild_world ()
  • 7 0x0000000001bade4c in DEG::deg_task_run_func(TaskPool*, void*, int) ()
  • 8 0x0000000001b90310 in task_scheduler_thread_run ()
  • 9 0x00007ffff7f7bfa3 in start_thread (arg=) at pthread_create.c:486
  • 10 0x00007ffff723688f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
**System Information** Operating system: Debian Buster Graphics card: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] (rev a1) **Blender Version** Broken: blender-2.80-d46d8e831ce-linux-glibc224-x86_64 **Short description of error** Segmentation Fault occured not in an obvious repeatable way. Got a Backtrace from gdb. **Exact steps for others to reproduce the error** I am playing around with Physics and Scripting. Dont know how to repeat the crash. It occured when running a simulation of a few stacked boxes in or before simulating the first frame. [New Thread 0x7fff98cb6700 (LWP 7540)] Thread 47 "blender" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffd3960700 (LWP 31163)] 0x0000000001d5e337 in btDbvtBroadphase::destroyProxy(btBroadphaseProxy*, btDispatcher*) () (gdb) bt - 0 0x0000000001d5e337 in btDbvtBroadphase::destroyProxy(btBroadphaseProxy*, btDispatcher*) () - 1 0x0000000001d6cb02 in btCollisionWorld::~btCollisionWorld() () - 2 0x0000000001dc7a29 in btDiscreteDynamicsWorld::~btDiscreteDynamicsWorld() () - 3 0x00000000019da0f2 in RB_dworld_delete () - 4 0x0000000001971456 in BKE_rigidbody_validate_sim_world () - 5 0x00000000019725c0 in rigidbody_update_simulation () - 6 0x000000000197290b in BKE_rigidbody_rebuild_world () - 7 0x0000000001bade4c in DEG::deg_task_run_func(TaskPool*, void*, int) () - 8 0x0000000001b90310 in task_scheduler_thread_run () - 9 0x00007ffff7f7bfa3 in start_thread (arg=<optimized out>) at pthread_create.c:486 - 10 0x00007ffff723688f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Added subscriber: @mbabisch

Added subscriber: @mbabisch
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

Can you share the .blend file you used?
Does it happen every time you simulate these boxes?

Can you share the .blend file you used? Does it happen every time you simulate these boxes?

construction.blend

I found no clear pattern of crash. It does not happen every time. The probabiity for a crash seemed to go up the longer i play around.
Creating, simulating and starting again. I suggest you loop that and see if you can find it.

I let this Blender run with gdb as soon as then instabilities where apparent. Thats where i got the Backtrace from.

I will upload the blend file from a zfs-snapshot. It is certain that i made changes to it without saving when it crashed.
Perhaps it helps you anyway. It contains a script called "Generator" which tries to build a tower of
bricks. (Which is more like walls in this state.) It removes all Objects in a collection and then creates objects in that collection.

I needed to create a Script "Clear" to remove the objects and make the file smaller (for upload).

I noticed the blender crash log in /tmp just now. It contains a backtrace too, but the file is newer and contains the backtrace of a newer crash. (8:46) I am not sure its connected and in what phase this crash happened. Since it seems similar i will paste it here:

bpy.ops.object.select_all(action='DESELECT') # Operator
bpy.ops.rigidbody.objects_add() # Operator
bpy.ops.object.select_all(action='DESELECT') # Operator
bpy.ops.rigidbody.objects_add() # Operator
bpy.ops.object.select_all(action='DESELECT') # Operator
bpy.ops.rigidbody.objects_add() # Operator
bpy.ops.text.run_script() # Operator

backtrace

/opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender(BLI_system_backtrace+0x1d) [0x1b8ffad]
/opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender() [0x1153c09]
/lib/x86_64-linux-gnu/libc.so.6(+0x378e0) [0x7f439837d8e0]
/opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender(ZNK16rbFilterCallback23needBroadphaseCollisionEP17btBroadphaseProxyS1+0x2a) [0x19ded1a]
/opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender(ZN28btHashedOverlappingPairCache18addOverlappingPairEP17btBroadphaseProxyS1+0x26) [0x1d696d6]
/opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender(ZN16btDbvtBroadphase11createProxyERK9btVector3S2_iPvssP12btDispatcherS3+0x2dc) [0x1d5f73c]
/opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender(_ZN16btCollisionWorld18addCollisionObjectEP17btCollisionObjectss+0xdc) [0x1d6c9dc]
/opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender() [0x1970db3]
/opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender() [0x19725d7]
/opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender(BKE_rigidbody_do_simulation+0x1aa) [0x1972aea]
/opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender() [0x1bade4c]
/opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender() [0x1b90351]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7fa3) [0x7f4399184fa3]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f439843f88f]

Please note I am new to blender scripting and python. The scripts are quite horrible right now ?

[construction.blend](https://archive.blender.org/developer/F6005289/construction.blend) I found no clear pattern of crash. It does not happen every time. The probabiity for a crash seemed to go up the longer i play around. Creating, simulating and starting again. I suggest you loop that and see if you can find it. I let this Blender run with gdb as soon as then instabilities where apparent. Thats where i got the Backtrace from. I will upload the blend file from a zfs-snapshot. It is certain that i made changes to it without saving when it crashed. Perhaps it helps you anyway. It contains a script called "Generator" which tries to build a tower of bricks. (Which is more like walls in this state.) It removes all Objects in a collection and then creates objects in that collection. I needed to create a Script "Clear" to remove the objects and make the file smaller (for upload). I noticed the blender crash log in /tmp just now. It contains a backtrace too, but the file is newer and contains the backtrace of a newer crash. (8:46) I am not sure its connected and in what phase this crash happened. Since it seems similar i will paste it here: bpy.ops.object.select_all(action='DESELECT') # Operator bpy.ops.rigidbody.objects_add() # Operator bpy.ops.object.select_all(action='DESELECT') # Operator bpy.ops.rigidbody.objects_add() # Operator bpy.ops.object.select_all(action='DESELECT') # Operator bpy.ops.rigidbody.objects_add() # Operator bpy.ops.text.run_script() # Operator # backtrace /opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender(BLI_system_backtrace+0x1d) [0x1b8ffad] /opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender() [0x1153c09] /lib/x86_64-linux-gnu/libc.so.6(+0x378e0) [0x7f439837d8e0] /opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender(_ZNK16rbFilterCallback23needBroadphaseCollisionEP17btBroadphaseProxyS1_+0x2a) [0x19ded1a] /opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender(_ZN28btHashedOverlappingPairCache18addOverlappingPairEP17btBroadphaseProxyS1_+0x26) [0x1d696d6] /opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender(_ZN16btDbvtBroadphase11createProxyERK9btVector3S2_iPvssP12btDispatcherS3_+0x2dc) [0x1d5f73c] /opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender(_ZN16btCollisionWorld18addCollisionObjectEP17btCollisionObjectss+0xdc) [0x1d6c9dc] /opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender() [0x1970db3] /opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender() [0x19725d7] /opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender(BKE_rigidbody_do_simulation+0x1aa) [0x1972aea] /opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender() [0x1bade4c] /opt/blender-2.80b/blender-2.80-d46d8e831ce-linux-glibc224-x86_64/blender() [0x1b90351] /lib/x86_64-linux-gnu/libpthread.so.0(+0x7fa3) [0x7f4399184fa3] /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f439843f88f] Please note I am new to blender scripting and python. The scripts are quite horrible right now ?
Member

Did you ever run the Generator script? I wonder how you got the switch statement working which Python does not even have.

Did you ever run the `Generator` script? I wonder how you got the switch statement working which Python does not even have.

Oh well, my bad. The snapshot contained the save from yesterday. Which as you noted, obviously did not work. I must have fixed it without saving when it crashed.

Try this one:
import bpy
import mathutils
import random
from math import *

bpy.ops.rigidbody.world_add()

count=500

width=10
height=10

boxxs=0.8
boxys=0.4
boxzs=0.4

PI=3.141

for obj in bpy.data.collections['Generated-Blocks'].objects:

   bpy.data.objects.remove(obj)    

baseoffset = mathutils.Vector((0,0,0))
upvector=mathutils.Vector((0,0,boxzs))
for side in range(1,2):

  sideoffset=mathutils.Vector((0,0,0))
  runvector=mathutils.Vector((0,0,0))
  rotationvector=mathutils.Vector((0,0,0))
  if side == 1: 
      sideoffset = mathutils.Vector((boxxs*width/2,boxxs*width/2,0.1)) + baseoffset
      runvector = mathutils.Vector((boxxs,0,0))
      rotationvector=mathutils.Vector((0,0,PI/2))
  elif side == 2:
      sideoffset = mathutils.Vector((-boxxs*width/2,boxxs*width/2,0.1)) + baseoffset
      runvector = mathutils.Vector((-boxxs,0,0))
      rotationvector=mathutils.Vector((0,0,0))
  elif side == 3: 
      sideoffset = mathutils.Vector((boxxs*width/2,-boxxs*width/2,0.1)) + baseoffset
      runvector = mathutils.Vector((0,boxxs,0))
      rotationvector=mathutils.Vector((0,0,PI/2))
  elif side == 4:
      sideoffset = mathutils.Vector((boxxs*width/2,-boxxs*width/2,0.1)) + baseoffset
      runvector = mathutils.Vector((0,-boxxs,0))
      rotationvector=mathutils.Vector((0,0,0))
  else:
      raise Exception('Invalid Case')
  for h in range(1,height):
      for w in range(1,width):
          source_obj=random.choice(bpy.data.collections['Source-Blocks'].objects)
          new_obj = source_obj.copy()
          new_obj.data=source_obj.data.copy()
          new_obj.animation_data_clear()
          new_obj.location=(0,0,0)
          new_obj.rotation_euler=rotationvector
          ol=sideoffset+w*runvector+h*upvector
          new_obj.location=ol
          bpy.data.collections['Generated-Blocks'].objects.link(new_obj)
          bpy.ops.object.select_all(action='DESELECT')
          new_obj.select_set(state=True)
          bpy.context.view_layer.objects.active=new_obj
          bpy.ops.rigidbody.objects_add()
          bpy.context.object.rigid_body.collision_shape = 'BOX'
          bpy.context.object.rigid_body.use_margin = True
          bpy.context.object.rigid_body.collision_margin = 0.001
Oh well, my bad. The snapshot contained the save from yesterday. Which as you noted, obviously did not work. I must have fixed it without saving when it crashed. Try this one: import bpy import mathutils import random from math import * # bpy.ops.rigidbody.world_add() count=500 width=10 height=10 boxxs=0.8 boxys=0.4 boxzs=0.4 PI=3.141 for obj in bpy.data.collections['Generated-Blocks'].objects: ``` bpy.data.objects.remove(obj) ``` baseoffset = mathutils.Vector((0,0,0)) upvector=mathutils.Vector((0,0,boxzs)) for side in range(1,2): ``` sideoffset=mathutils.Vector((0,0,0)) runvector=mathutils.Vector((0,0,0)) rotationvector=mathutils.Vector((0,0,0)) if side == 1: sideoffset = mathutils.Vector((boxxs*width/2,boxxs*width/2,0.1)) + baseoffset runvector = mathutils.Vector((boxxs,0,0)) rotationvector=mathutils.Vector((0,0,PI/2)) elif side == 2: sideoffset = mathutils.Vector((-boxxs*width/2,boxxs*width/2,0.1)) + baseoffset runvector = mathutils.Vector((-boxxs,0,0)) rotationvector=mathutils.Vector((0,0,0)) elif side == 3: sideoffset = mathutils.Vector((boxxs*width/2,-boxxs*width/2,0.1)) + baseoffset runvector = mathutils.Vector((0,boxxs,0)) rotationvector=mathutils.Vector((0,0,PI/2)) elif side == 4: sideoffset = mathutils.Vector((boxxs*width/2,-boxxs*width/2,0.1)) + baseoffset runvector = mathutils.Vector((0,-boxxs,0)) rotationvector=mathutils.Vector((0,0,0)) else: raise Exception('Invalid Case') ``` ``` for h in range(1,height): for w in range(1,width): source_obj=random.choice(bpy.data.collections['Source-Blocks'].objects) new_obj = source_obj.copy() new_obj.data=source_obj.data.copy() new_obj.animation_data_clear() new_obj.location=(0,0,0) new_obj.rotation_euler=rotationvector ol=sideoffset+w*runvector+h*upvector new_obj.location=ol bpy.data.collections['Generated-Blocks'].objects.link(new_obj) bpy.ops.object.select_all(action='DESELECT') new_obj.select_set(state=True) bpy.context.view_layer.objects.active=new_obj bpy.ops.rigidbody.objects_add() bpy.context.object.rigid_body.collision_shape = 'BOX' bpy.context.object.rigid_body.use_margin = True bpy.context.object.rigid_body.collision_margin = 0.001 ```
Member

@mbabisch: Please bring the script in a form that allows me to easily load it in Blender. Either upload it as .py or preferably use the proper markup to show display code in a post here.
Also please check if you are still experiencing the bug the newest version of Blender.

@mbabisch: Please bring the script in a form that allows me to easily load it in Blender. Either upload it as .py or preferably use the proper markup to show display code in a post here. Also please check if you are still experiencing the bug the newest version of Blender.
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Jacques Lucke self-assigned this 2019-03-07 15:03:15 +01:00
Member

More than a week without reply or activity. Due to the policy of the tracker archiving for until required info/data are provided.

More than a week without reply or activity. Due to the policy of the tracker archiving for until required info/data are provided.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#59607
No description provided.