Page MenuHome

Rebuilding the Depsgraph crashes Blender after linking objects.
Closed, ResolvedPublic

Description

Blender Version
Working: rBa41bbfb7^
Broken: 2.8 since the commit above

Short description of error

Rebuilding the Depsgraph crashes Blender after linking objects (in some cases).

Exact steps for others to reproduce the error

blender -b --python-expr "import bpy;bpy.context.scene.master_collection.objects.link(bpy.data.objects.new('empty', None));bpy.context.scene.depsgraph.debug_rebuild()"

Or just run the render_layer_object_link_c unittest. (note, the unittest is not calling depsgraph.debug_rebuild() but bpy.ops.wm.read_factory_settings() instead.

Full Backtrace

1=================================================================
2==20540==ERROR: AddressSanitizer: heap-use-after-free on address 0x60300013c0fc at pc 0x557e9855c12b bp 0x7ffdcb612290 sp 0x7ffdcb612288
3READ of size 2 at 0x60300013c0fc thread T0
4 #0 0x557e9855c12a in DEG::DepsgraphNodeBuilder::build_object(Scene*, Object*) /home/guest/src/blender/blender/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc:390
5 #1 0x557e9856db77 in DEG::DepsgraphNodeBuilder::build_scene(Main*, Scene*) /home/guest/src/blender/blender/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc:86
6 #2 0x557e9854e302 in DEG_graph_build_from_scene /home/guest/src/blender/blender/source/blender/depsgraph/intern/depsgraph_build.cc:214
7 #3 0x557e9854e6fc in DEG_scene_relations_update /home/guest/src/blender/blender/source/blender/depsgraph/intern/depsgraph_build.cc:307
8 #4 0x557e9854e7a9 in DEG_scene_relations_rebuild /home/guest/src/blender/blender/source/blender/depsgraph/intern/depsgraph_build.cc:318
9 #5 0x557e97943db8 in DAG_scene_relations_rebuild /home/guest/src/blender/blender/source/blender/blenkernel/intern/depsgraph.c:269
10 #6 0x557e97fa2120 in rna_Depsgraph_debug_rebuild /home/guest/src/blender/blender/source/blender/makesrna/intern/rna_depsgraph.c:63
11 #7 0x557e97fa2869 in Depsgraph_debug_rebuild_call /home/guest/src/blender/release/blender2.8/source/blender/makesrna/intern/rna_depsgraph_gen.c:117
12 #8 0x557e97eed714 in RNA_function_call /home/guest/src/blender/blender/source/blender/makesrna/intern/rna_access.c:6230
13 #9 0x557e96b13d3f in pyrna_func_call /home/guest/src/blender/blender/source/blender/python/intern/bpy_rna.c:5551
14 #10 0x7f3f3f9a29a6 in PyObject_Call (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x1d39a6)
15 #11 0x7f3f3f96d25c in PyEval_EvalFrameEx (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x19e25c)
16 #12 0x7f3f3fa32f93 (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x263f93)
17 #13 0x7f3f3fa33072 in PyEval_EvalCodeEx (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x264072)
18 #14 0x7f3f3f9693ca in PyEval_EvalCode (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x19a3ca)
19 #15 0x7f3f3f986a9e in PyRun_StringFlags (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0x1b7a9e)
20 #16 0x557e96af84bf in BPY_execute_string_ex /home/guest/src/blender/blender/source/blender/python/intern/bpy_interface.c:628
21 #17 0x557e95916cf2 in arg_handle_python_expr_run /home/guest/src/blender/blender/source/creator/creator_args.c:1608
22 #18 0x557e98404f56 in BLI_argsParse /home/guest/src/blender/blender/source/blender/blenlib/intern/BLI_args.c:282
23 #19 0x557e95918953 in main_args_setup_post /home/guest/src/blender/blender/source/creator/creator_args.c:1890
24 #20 0x557e9591160b in main /home/guest/src/blender/blender/source/creator/creator.c:471
25 #21 0x7f3f37e572b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
26 #22 0x557e95910dd9 in _start (/home/guest/src/blender/release/blender2.8/bin/blender+0x202add9)
27
280x60300013c0fc is located 12 bytes inside of 32-byte region [0x60300013c0f0,0x60300013c110)
29freed by thread T0 here:
30 #0 0x7f3f4061ba10 in free (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1a10)
31 #1 0x7f3f3f8c43ec (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0xf53ec)
32
33previously allocated by thread T0 here:
34 #0 0x7f3f4061c090 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc2090)
35 #1 0x7f3f3f8c4f21 in PyList_Append (/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0+0xf5f21)
36
37SUMMARY: AddressSanitizer: heap-use-after-free /home/guest/src/blender/blender/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc:390 in DEG::DepsgraphNodeBuilder::build_object(Scene*, Object*)

Event Timeline

Sergey Sharybin (sergey) changed the task status from Unknown Status to Resolved.Mar 6 2017, 5:59 PM