Page MenuHome

Blender shuts down when playing a Rigid Body animation in a linked scene
Open, Confirmed, LowPublic

Description

System Information
Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: AMD Radeon R7 200 Series ATI Technologies Inc. 4.5.13492 Core Profile Context 22.19.677.257

Blender Version
Broken: version: 2.80 (sub 74), branch: master, commit date: 2019-07-10 23:46, hash: rB676543d91f5c
Worked: (optional)

Short description of error
Blender shuts down when playin the animation of a rigid body object in a linked scene

Exact steps for others to reproduce the error
Load Factory Settings
Add the cube as Rigid Body
Create a new scene, Linked Copy
Play the animation in any of the two scenes
When switching to the other scene, Blender shuts down

Event Timeline

Backtrace:

Thread 1 "blender" received signal SIGSEGV, Segmentation fault.
0x000055555c7deccd in removeleaf (pdbvt=0x7fffd0810a88, leaf=0x7fffd29dc1b0)
    at /home/zed/prog/blender/extern/bullet2/src/BulletCollision/BroadphaseCollision/btDbvt.cpp:185
185			btDbvtNode*	prev=parent->parent;
(gdb) bt
#0  0x000055555c7deccd in removeleaf (pdbvt=0x7fffd0810a88, leaf=0x7fffd29dc1b0)
    at /home/zed/prog/blender/extern/bullet2/src/BulletCollision/BroadphaseCollision/btDbvt.cpp:185
#1  0x000055555c7e035b in btDbvt::remove (this=0x7fffd0810a88, leaf=0x7fffd29dc1b0)
    at /home/zed/prog/blender/extern/bullet2/src/BulletCollision/BroadphaseCollision/btDbvt.cpp:559
#2  0x000055555c75744c in btDbvtBroadphase::destroyProxy (this=0x7fffd0810a80, absproxy=0x7fffcff19410, dispatcher=0x7fffcffd3000)
    at /home/zed/prog/blender/extern/bullet2/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp:199
#3  0x000055555c760c6c in btCollisionWorld::removeCollisionObject (this=0x7fffd087e010, collisionObject=0x7fffd2bb6d10)
    at /home/zed/prog/blender/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp:250
#4  0x000055555c7c28dd in btDiscreteDynamicsWorld::removeRigidBody (this=0x7fffd087e010, body=0x7fffd2bb6d10)
    at /home/zed/prog/blender/extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:559
#5  0x00005555595f3dc9 in RB_dworld_remove_body (world=0x7fffd0a60790, object=0x7fffd0a70d30)
    at /home/zed/prog/blender/intern/rigidbody/rb_bullet_api.cpp:259
#6  0x0000555557d60731 in rigidbody_validate_sim_object (rbw=0x7fffdbb1dee8, ob=0x7fffe57aee08, rebuild=true)
    at /home/zed/prog/blender/source/blender/blenkernel/intern/rigidbody.c:746
#7  0x0000555557d632eb in rigidbody_update_simulation (depsgraph=0x7fffe56e7788, scene=0x7fffdb841008, rbw=0x7fffdbb1dee8, rebuild=true)
    at /home/zed/prog/blender/source/blender/blenkernel/intern/rigidbody.c:1715
#8  0x0000555557d63ec8 in BKE_rigidbody_rebuild_world (depsgraph=0x7fffe56e7788, scene=0x7fffdb841008, ctime=2)
    at /home/zed/prog/blender/source/blender/blenkernel/intern/rigidbody.c:1943
#9  0x0000555557d643c1 in BKE_rigidbody_rebuild_sim (depsgraph=0x7fffe56e7788, scene=0x7fffdb841008)
    at /home/zed/prog/blender/source/blender/blenkernel/intern/rigidbody.c:2140
#10 0x0000555557f49935 in std::__invoke_impl<void, void (*&)(Depsgraph*, Scene*), Depsgraph*, Scene*&> (__f=
    @0x7fffeb90cad0: 0x555557d6434c <BKE_rigidbody_rebuild_sim>, __args#0=@0x7fffffffd4e0: 0x7fffe56e7788, __args#1=@0x7fffeb90cad8: 0x7fffdb841008)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/g++-v8/bits/invoke.h:60
#11 0x0000555557f48234 in std::__invoke<void (*&)(Depsgraph*, Scene*), Depsgraph*, Scene*&> (__fn=
    @0x7fffeb90cad0: 0x555557d6434c <BKE_rigidbody_rebuild_sim>, __args#0=@0x7fffffffd4e0: 0x7fffe56e7788, __args#1=@0x7fffeb90cad8: 0x7fffdb841008)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/g++-v8/bits/invoke.h:95
#12 0x0000555557f467f4 in std::_Bind<void (*(std::_Placeholder<1>, Scene*))(Depsgraph*, Scene*)>::__call<void, Depsgraph*&&, 0ul, 1ul>(std::tuple<Depsgraph*&&>&&, std::_Index_tuple<0ul, 1ul>) (this=0x7fffeb90cad0, __args=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/g++-v8/functional:400
#13 0x0000555557f44542 in std::_Bind<void (*(std::_Placeholder<1>, Scene*))(Depsgraph*, Scene*)>::operator()<Depsgraph*, void>(Depsgraph*&&) (
    this=0x7fffeb90cad0, __args#0=@0x7fffffffd4e0: 0x7fffe56e7788) at /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/g++-v8/functional:484
#14 0x0000555557f4111a in std::_Function_handler<void (Depsgraph*), std::_Bind<void (*(std::_Placeholder<1>, Scene*))(Depsgraph*, Scene*)> >::_M_invoke(std::_Any_data const&, Depsgraph*&&) (__functor=..., __args#0=@0x7fffffffd4e0: 0x7fffe56e7788)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/g++-v8/bits/std_function.h:297
#15 0x0000555557f5ec79 in std::function<void (Depsgraph*)>::operator()(Depsgraph*) const (this=0x7fffd3009680, __args#0=0x7fffe56e7788)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/g++-v8/bits/std_function.h:687
#16 0x0000555557f5e215 in DEG::deg_task_run_func (pool=0x7fffcffeb008, taskdata=0x7fffd3009608, thread_id=0)
    at /home/zed/prog/blender/source/blender/depsgraph/intern/eval/deg_eval.cc:86
#17 0x0000555557f1ec7c in BLI_task_pool_work_and_wait (pool=0x7fffcffeb008) at /home/zed/prog/blender/source/blender/blenlib/intern/task.c:939
#18 0x0000555557f5eb6d in DEG::deg_evaluate_on_refresh (graph=0x7fffe56e7788) at /home/zed/prog/blender/source/blender/depsgraph/intern/eval/deg_eval.cc:301
#19 0x0000555557f2cb5c in DEG_evaluate_on_framechange (bmain=0x7fffeb8cbd08, graph=0x7fffe56e7788, ctime=2)
    at /home/zed/prog/blender/source/blender/depsgraph/intern/depsgraph_eval.cc:81
--Type <RET> for more, q to quit, c to continue without paging--
#20 0x0000555557d68990 in BKE_scene_graph_update_for_newframe (depsgraph=0x7fffe56e7788, bmain=0x7fffeb8cbd08)
    at /home/zed/prog/blender/source/blender/blenkernel/intern/scene.c:1614
#21 0x0000555558cdf019 in ED_update_for_newframe (bmain=0x7fffeb8cbd08, depsgraph=0x7fffe56e7788)
    at /home/zed/prog/blender/source/blender/editors/screen/screen_edit.c:1476
#22 0x0000555558cea58e in screen_animation_step (C=0x7fffeb891208, UNUSED_op=0x7fffd0a84a48, event=0x7fffe57fe008)
    at /home/zed/prog/blender/source/blender/editors/screen/screen_ops.c:4352
#23 0x000055555822c21d in wm_operator_invoke (C=0x7fffeb891208, ot=0x7fffe651b568, event=0x7fffe57fe008, properties=0x7fffd2b8dc68, reports=0x0,
    poll_only=false, use_last_properties=true) at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:1438
#24 0x000055555822e275 in wm_handler_operator_call (C=0x7fffeb891208, handlers=0x7fffe6640608, handler_base=0x7fffe5668288, event=0x7fffe57fe008,
    properties=0x7fffd2b8dc68) at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:2275
#25 0x000055555822eb63 in wm_handlers_do_keymap_with_keymap_handler (C=0x7fffeb891208, event=0x7fffe57fe008, handlers=0x7fffe6640608,
    handler=0x7fffe5668288, keymap=0x7fffd2ab2948, do_debug_handler=false)
    at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:2555
#26 0x000055555822f1bc in wm_handlers_do_intern (C=0x7fffeb891208, event=0x7fffe57fe008, handlers=0x7fffe6640608)
    at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:2692
#27 0x0000555558230055 in wm_handlers_do (C=0x7fffeb891208, event=0x7fffe57fe008, handlers=0x7fffe6640608)
    at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:2945
#28 0x00005555582317d4 in wm_event_do_handlers (C=0x7fffeb891208) at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:3431
#29 0x00005555582244f0 in WM_main (C=0x7fffeb891208) at /home/zed/prog/blender/source/blender/windowmanager/intern/wm.c:417
#30 0x0000555557b7ba19 in main (argc=1, argv=0x7fffffffdff8) at /home/zed/prog/blender/source/creator/creator.c:500

@Bastien Montagne (mont29) I'm unsure if this is for you (linked data), so feel free to reassign.

Sebastian Parborg (zeddb) triaged this task as Confirmed, Medium priority.Jul 17 2019, 4:31 PM

@zedb This has absolutely nothing to do with lib linking (Linked Copy of a scene just shares the objects with both old and new scene, totally unrelated ;) ).

That’s most likely a depsgraph/update issue, though I'll have a look first to check if some weird collection/rigidbody mess is not going on here…

That’s a real can of worms… After a painful investigation, that patch fixes the first part of the issue (trying to remove an RB object from an new RB world which is currently empty - that is presumably a bug in Bullet library actually, but we can fairly easily work around it in the end: D5315: Partial fix for crash with RigidBody objects whared in several scenes..

Now we have a depsgraph/CoW issue for which I am summoning @Sergey Sharybin (sergey) here. With above patch, first switch between scene now works, but second one fails on a new issue, which seems to be that original and evaluated objects/scenes share some RB data, which get freed in from some DEG evaluation thread, but does not seem to be back-ported to orig object.

Am not sure what’s supposed to happen here, not even sure sharing some RB sim data between orig and eval IDs is a good idea (means we cannot have two different sims with same object in two different scenes at the same time?)…

We could also go the simple way and just forbid an object to be part of more than one RB world/sim.

Uh, forgot to paste the ASAN backtrace of the new issue:

=================================================================
==28051==ERROR: AddressSanitizer: heap-use-after-free on address 0x61700010ffd0 at pc 0x55578704eb6b bp 0x7fffbd612f90 sp 0x7fffbd612f88
READ of size 8 at 0x61700010ffd0 thread T0
    #0 0x55578704eb6a in btCollisionObject::getBroadphaseHandle() /home/i74700deb64/blender/__work__/src/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h:346
    #1 0x555787032382 in btCollisionWorld::~btCollisionWorld() /home/i74700deb64/blender/__work__/src/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp:87
    #2 0x555787220dd2 in btDynamicsWorld::~btDynamicsWorld() /home/i74700deb64/blender/__work__/src/extern/bullet2/src/BulletDynamics/Dynamics/btDynamicsWorld.h:60
    #3 0x555787206d59 in btDiscreteDynamicsWorld::~btDiscreteDynamicsWorld() /home/i74700deb64/blender/__work__/src/extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:241
    #4 0x555787206d93 in btDiscreteDynamicsWorld::~btDiscreteDynamicsWorld() /home/i74700deb64/blender/__work__/src/extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:260
    #5 0x55578291cb4b in RB_dworld_delete /home/i74700deb64/blender/__work__/src/intern/rigidbody/rb_bullet_api.cpp:167
    #6 0x55577c7d899f in BKE_rigidbody_validate_sim_world /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/rigidbody.c:1061
    #7 0x55577c7e19cc in rigidbody_update_simulation /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/rigidbody.c:1698
    #8 0x55577c7e5c75 in BKE_rigidbody_rebuild_world /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/rigidbody.c:1980
    #9 0x55577c7e7264 in BKE_rigidbody_rebuild_sim /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/rigidbody.c:2177
    #10 0x55577d048236 in void std::__invoke_impl<void, void (*&)(Depsgraph*, Scene*), Depsgraph*, Scene*&>(std::__invoke_other, void (*&)(Depsgraph*, Scene*), Depsgraph*&&, Scene*&) /usr/include/c++/8/bits/invoke.h:60
    #11 0x55577d043b5f in std::__invoke_result<void (*&)(Depsgraph*, Scene*), Depsgraph*, Scene*&>::type std::__invoke<void (*&)(Depsgraph*, Scene*), Depsgraph*, Scene*&>(void (*&)(Depsgraph*, Scene*), Depsgraph*&&, Scene*&) /usr/include/c++/8/bits/invoke.h:95
    #12 0x55577d03e104 in void std::_Bind<void (*(std::_Placeholder<1>, Scene*))(Depsgraph*, Scene*)>::__call<void, Depsgraph*&&, 0ul, 1ul>(std::tuple<Depsgraph*&&>&&, std::_Index_tuple<0ul, 1ul>) /usr/include/c++/8/functional:400
    #13 0x55577d03655d in void std::_Bind<void (*(std::_Placeholder<1>, Scene*))(Depsgraph*, Scene*)>::operator()<Depsgraph*, void>(Depsgraph*&&) /usr/include/c++/8/functional:484
    #14 0x55577d02bd07 in std::_Function_handler<void (Depsgraph*), std::_Bind<void (*(std::_Placeholder<1>, Scene*))(Depsgraph*, Scene*)> >::_M_invoke(std::_Any_data const&, Depsgraph*&&) /usr/include/c++/8/bits/std_function.h:297
    #15 0x55577d0994d7 in std::function<void (Depsgraph*)>::operator()(Depsgraph*) const /usr/include/c++/8/bits/std_function.h:687
    #16 0x55577d096770 in deg_task_run_func /home/i74700deb64/blender/__work__/src/source/blender/depsgraph/intern/eval/deg_eval.cc:86
    #17 0x55577cfaab40 in BLI_task_pool_work_and_wait /home/i74700deb64/blender/__work__/src/source/blender/blenlib/intern/task.c:939
    #18 0x55577d098fdc in DEG::deg_evaluate_on_refresh(DEG::Depsgraph*) /home/i74700deb64/blender/__work__/src/source/blender/depsgraph/intern/eval/deg_eval.cc:301
    #19 0x55577cfde4a0 in DEG_evaluate_on_framechange /home/i74700deb64/blender/__work__/src/source/blender/depsgraph/intern/depsgraph_eval.cc:81
    #20 0x55577c80062f in BKE_scene_graph_update_for_newframe /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/scene.c:1614
    #21 0x555780961b42 in ED_update_for_newframe /home/i74700deb64/blender/__work__/src/source/blender/editors/screen/screen_edit.c:1476
    #22 0x55578099bfc4 in screen_animation_step /home/i74700deb64/blender/__work__/src/source/blender/editors/screen/screen_ops.c:4352
    #23 0x55577dc6540c in wm_operator_invoke /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:1438
    #24 0x55577dc6d57f in wm_handler_operator_call /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2275
    #25 0x55577dc6ffc6 in wm_handlers_do_keymap_with_keymap_handler /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2555
    #26 0x55577dc71836 in wm_handlers_do_intern /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2692
    #27 0x55577dc74736 in wm_handlers_do /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:2945
    #28 0x55577dc7a69e in wm_event_do_handlers /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:3431
    #29 0x55577dc4161a in WM_main /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm.c:417
    #30 0x55577bee60c9 in main /home/i74700deb64/blender/__work__/src/source/creator/creator.c:500
    #31 0x7f4a0674709a in __libc_start_main ../csu/libc-start.c:308
    #32 0x55577bee5259 in _start (/home/i74700deb64/blender/__work__/build_master_debug/bin/blender+0x1b711259)

0x61700010ffd0 is located 208 bytes inside of 727-byte region [0x61700010ff00,0x6170001101d7)
freed by thread T20 here:
    #0 0x7f4a0c75efb0 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe8fb0)
    #1 0x55578723ee1f in btFreeDefault /home/i74700deb64/blender/__work__/src/extern/bullet2/src/LinearMath/btAlignedAllocator.cpp:29
    #2 0x55578723efcc in btAlignedFreeDefault /home/i74700deb64/blender/__work__/src/extern/bullet2/src/LinearMath/btAlignedAllocator.cpp:86
    #3 0x55578723f113 in btAlignedFreeInternal(void*) /home/i74700deb64/blender/__work__/src/extern/bullet2/src/LinearMath/btAlignedAllocator.cpp:177
    #4 0x555782938546 in btCollisionObject::operator delete(void*) /home/i74700deb64/blender/__work__/src/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h:120
    #5 0x5557871fd877 in btRigidBody::~btRigidBody() /home/i74700deb64/blender/__work__/src/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.h:187
    #6 0x5557829207d5 in RB_body_delete /home/i74700deb64/blender/__work__/src/intern/rigidbody/rb_bullet_api.cpp:371
    #7 0x55577c7d9183 in BKE_rigidbody_validate_sim_world /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/rigidbody.c:1087
    #8 0x55577c7e19cc in rigidbody_update_simulation /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/rigidbody.c:1698
    #9 0x55577c7e5c75 in BKE_rigidbody_rebuild_world /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/rigidbody.c:1980
    #10 0x55577c7e7264 in BKE_rigidbody_rebuild_sim /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/rigidbody.c:2177
    #11 0x55577d048236 in void std::__invoke_impl<void, void (*&)(Depsgraph*, Scene*), Depsgraph*, Scene*&>(std::__invoke_other, void (*&)(Depsgraph*, Scene*), Depsgraph*&&, Scene*&) /usr/include/c++/8/bits/invoke.h:60
    #12 0x55577d043b5f in std::__invoke_result<void (*&)(Depsgraph*, Scene*), Depsgraph*, Scene*&>::type std::__invoke<void (*&)(Depsgraph*, Scene*), Depsgraph*, Scene*&>(void (*&)(Depsgraph*, Scene*), Depsgraph*&&, Scene*&) /usr/include/c++/8/bits/invoke.h:95
    #13 0x55577d03e104 in void std::_Bind<void (*(std::_Placeholder<1>, Scene*))(Depsgraph*, Scene*)>::__call<void, Depsgraph*&&, 0ul, 1ul>(std::tuple<Depsgraph*&&>&&, std::_Index_tuple<0ul, 1ul>) /usr/include/c++/8/functional:400
    #14 0x55577d03655d in void std::_Bind<void (*(std::_Placeholder<1>, Scene*))(Depsgraph*, Scene*)>::operator()<Depsgraph*, void>(Depsgraph*&&) /usr/include/c++/8/functional:484
    #15 0x55577d02bd07 in std::_Function_handler<void (Depsgraph*), std::_Bind<void (*(std::_Placeholder<1>, Scene*))(Depsgraph*, Scene*)> >::_M_invoke(std::_Any_data const&, Depsgraph*&&) /usr/include/c++/8/bits/std_function.h:297
    #16 0x55577d0994d7 in std::function<void (Depsgraph*)>::operator()(Depsgraph*) const /usr/include/c++/8/bits/std_function.h:687
    #17 0x55577d096770 in deg_task_run_func /home/i74700deb64/blender/__work__/src/source/blender/depsgraph/intern/eval/deg_eval.cc:86
    #18 0x55577cfa343c in task_scheduler_thread_run /home/i74700deb64/blender/__work__/src/source/blender/blenlib/intern/task.c:450
    #19 0x7f4a0a31cfa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486

previously allocated by thread T19 here:
    #0 0x7f4a0c75f330 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
    #1 0x55578723ee05 in btAllocDefault /home/i74700deb64/blender/__work__/src/extern/bullet2/src/LinearMath/btAlignedAllocator.cpp:24
    #2 0x55578723ee75 in btAlignedAllocDefault /home/i74700deb64/blender/__work__/src/extern/bullet2/src/LinearMath/btAlignedAllocator.cpp:70
    #3 0x55578723f0af in btAlignedAllocInternal(unsigned long, int) /home/i74700deb64/blender/__work__/src/extern/bullet2/src/LinearMath/btAlignedAllocator.cpp:163
    #4 0x55578293852c in btCollisionObject::operator new(unsigned long) /home/i74700deb64/blender/__work__/src/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h:120
    #5 0x555782920310 in RB_body_new /home/i74700deb64/blender/__work__/src/intern/rigidbody/rb_bullet_api.cpp:343
    #6 0x55577c7d2049 in rigidbody_validate_sim_object /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/rigidbody.c:756
    #7 0x55577c7e2398 in rigidbody_update_simulation /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/rigidbody.c:1752
    #8 0x55577c7e5c75 in BKE_rigidbody_rebuild_world /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/rigidbody.c:1980
    #9 0x55577c7e7264 in BKE_rigidbody_rebuild_sim /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/rigidbody.c:2177
    #10 0x55577d048236 in void std::__invoke_impl<void, void (*&)(Depsgraph*, Scene*), Depsgraph*, Scene*&>(std::__invoke_other, void (*&)(Depsgraph*, Scene*), Depsgraph*&&, Scene*&) /usr/include/c++/8/bits/invoke.h:60
    #11 0x55577d043b5f in std::__invoke_result<void (*&)(Depsgraph*, Scene*), Depsgraph*, Scene*&>::type std::__invoke<void (*&)(Depsgraph*, Scene*), Depsgraph*, Scene*&>(void (*&)(Depsgraph*, Scene*), Depsgraph*&&, Scene*&) /usr/include/c++/8/bits/invoke.h:95
    #12 0x55577d03e104 in void std::_Bind<void (*(std::_Placeholder<1>, Scene*))(Depsgraph*, Scene*)>::__call<void, Depsgraph*&&, 0ul, 1ul>(std::tuple<Depsgraph*&&>&&, std::_Index_tuple<0ul, 1ul>) /usr/include/c++/8/functional:400
    #13 0x55577d03655d in void std::_Bind<void (*(std::_Placeholder<1>, Scene*))(Depsgraph*, Scene*)>::operator()<Depsgraph*, void>(Depsgraph*&&) /usr/include/c++/8/functional:484
    #14 0x55577d02bd07 in std::_Function_handler<void (Depsgraph*), std::_Bind<void (*(std::_Placeholder<1>, Scene*))(Depsgraph*, Scene*)> >::_M_invoke(std::_Any_data const&, Depsgraph*&&) /usr/include/c++/8/bits/std_function.h:297
    #15 0x55577d0994d7 in std::function<void (Depsgraph*)>::operator()(Depsgraph*) const /usr/include/c++/8/bits/std_function.h:687
    #16 0x55577d096770 in deg_task_run_func /home/i74700deb64/blender/__work__/src/source/blender/depsgraph/intern/eval/deg_eval.cc:86
    #17 0x55577cfa343c in task_scheduler_thread_run /home/i74700deb64/blender/__work__/src/source/blender/blenlib/intern/task.c:450
    #18 0x7f4a0a31cfa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486

Thread T20 created by T0 here:
    #0 0x7f4a0c6c6db0 in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x50db0)
    #1 0x55577cfa4709 in BLI_task_scheduler_create /home/i74700deb64/blender/__work__/src/source/blender/blenlib/intern/task.c:517
    #2 0x55577cfb0fdf in BLI_task_scheduler_get /home/i74700deb64/blender/__work__/src/source/blender/blenlib/intern/threads.c:177
    #3 0x55577cfaed7c in BLI_task_parallel_range /home/i74700deb64/blender/__work__/src/source/blender/blenlib/intern/task.c:1151
    #4 0x55577d0b98a7 in flush_prepare /home/i74700deb64/blender/__work__/src/source/blender/depsgraph/intern/eval/deg_eval_flush.cc:115
    #5 0x55577d0b98a7 in DEG::deg_graph_flush_updates(Main*, DEG::Depsgraph*) /home/i74700deb64/blender/__work__/src/source/blender/depsgraph/intern/eval/deg_eval_flush.cc:355
    #6 0x55577cfeb48f in DEG_graph_flush_update /home/i74700deb64/blender/__work__/src/source/blender/depsgraph/intern/depsgraph_tag.cc:734
    #7 0x55577c800389 in scene_graph_update_tagged /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/scene.c:1563
    #8 0x55577c80043c in BKE_scene_graph_update_tagged /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/scene.c:1582
    #9 0x55577dc58a17 in wm_event_do_depsgraph /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:369
    #10 0x55577dc94b51 in wm_file_read_post /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_files.c:560
    #11 0x55577dc977e4 in wm_homefile_read /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_files.c:1075
    #12 0x55577dcc17c1 in WM_init /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_init_exit.c:289
    #13 0x55577bee5ec6 in main /home/i74700deb64/blender/__work__/src/source/creator/creator.c:423
    #14 0x7f4a0674709a in __libc_start_main ../csu/libc-start.c:308

Thread T19 created by T0 here:
    #0 0x7f4a0c6c6db0 in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x50db0)
    #1 0x55577cfa4709 in BLI_task_scheduler_create /home/i74700deb64/blender/__work__/src/source/blender/blenlib/intern/task.c:517
    #2 0x55577cfb0fdf in BLI_task_scheduler_get /home/i74700deb64/blender/__work__/src/source/blender/blenlib/intern/threads.c:177
    #3 0x55577cfaed7c in BLI_task_parallel_range /home/i74700deb64/blender/__work__/src/source/blender/blenlib/intern/task.c:1151
    #4 0x55577d0b98a7 in flush_prepare /home/i74700deb64/blender/__work__/src/source/blender/depsgraph/intern/eval/deg_eval_flush.cc:115
    #5 0x55577d0b98a7 in DEG::deg_graph_flush_updates(Main*, DEG::Depsgraph*) /home/i74700deb64/blender/__work__/src/source/blender/depsgraph/intern/eval/deg_eval_flush.cc:355
    #6 0x55577cfeb48f in DEG_graph_flush_update /home/i74700deb64/blender/__work__/src/source/blender/depsgraph/intern/depsgraph_tag.cc:734
    #7 0x55577c800389 in scene_graph_update_tagged /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/scene.c:1563
    #8 0x55577c80043c in BKE_scene_graph_update_tagged /home/i74700deb64/blender/__work__/src/source/blender/blenkernel/intern/scene.c:1582
    #9 0x55577dc58a17 in wm_event_do_depsgraph /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_event_system.c:369
    #10 0x55577dc94b51 in wm_file_read_post /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_files.c:560
    #11 0x55577dc977e4 in wm_homefile_read /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_files.c:1075
    #12 0x55577dcc17c1 in WM_init /home/i74700deb64/blender/__work__/src/source/blender/windowmanager/intern/wm_init_exit.c:289
    #13 0x55577bee5ec6 in main /home/i74700deb64/blender/__work__/src/source/creator/creator.c:423
    #14 0x7f4a0674709a in __libc_start_main ../csu/libc-start.c:308

SUMMARY: AddressSanitizer: heap-use-after-free /home/i74700deb64/blender/__work__/src/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h:346 in btCollisionObject::getBroadphaseHandle()
Shadow bytes around the buggy address:
  0x0c2e80019fa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2e80019fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2e80019fc0: 00 00 fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2e80019fd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2e80019fe0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c2e80019ff0: fd fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd
  0x0c2e8001a000: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2e8001a010: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2e8001a020: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2e8001a030: fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa
  0x0c2e8001a040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==28051==ABORTING
Sergey Sharybin (sergey) lowered the priority of this task from Confirmed, Medium to Confirmed, Low.

This roots into a wrong data layout decision in rB98a0bcd4252e: while it's fine to share some of the rigid body descriptors between original object and single evaluated dependency graph, this can not work when there are two dependency graphs involved.

Sharing just a pointcache itself will not cause an issue. An example of this can be found at around usages of PSYS_SHARED_CACHES.

This area needs deeper refactor, to make fully compatible with the new designs.