Page MenuHome

Blender freezes on vertex paint on linked mesh data.
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Ubuntu 20.04 Linux-5.4.0-40-generic-x86_64-with-debian-bullseye-sid 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 435.21

Blender Version
Broken: version: 2.90.0 Alpha, branch: master, commit date: 2020-07-17 07:39, hash: rB0a40c671b0b5
Worked: 2.83
Caused by rBbf34b0c8f4b8: DrawManager: Graph Task Scheduling

Short description of error
Blender freezes on vertex paint on linked mesh data.

Exact steps for others to reproduce the error

  1. In default scene duplicate linked (Alt+D) default cube.
  2. Try to enter vertex paint mode.

p.s. On original cube you can enter, but painting doesn't work.
p.s.s. Sometimes blender crashes.

Event Timeline

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.EditedJul 18 2020, 2:14 AM
Germano Cavalcante (mano-wii) triaged this task as High priority.
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".

Thanks for the report.
I can confirm:

>	blender.exe!GPU_indexbuf_use(GPUIndexBuf * elem) Line 384	C
 	blender.exe!batch_vao_get(GPUBatch * batch) Line 368	C
 	blender.exe!GPU_batch_program_set_no_use(GPUBatch * batch, unsigned int program, const GPUShaderInterface * shaderface) Line 383	C
 	[Inline Frame] blender.exe!draw_geometry_bind(DRWShadingGroup * geom, GPUBatch *) Line 676	C
 	[Inline Frame] blender.exe!draw_indirect_call(DRWShadingGroup *) Line 719	C
 	blender.exe!draw_call_batching_flush(DRWShadingGroup * shgroup, DRWCommandsState * state) Line 969	C
 	blender.exe!draw_call_batching_finish(DRWShadingGroup * shgroup, DRWCommandsState * state) Line 1076	C
 	blender.exe!draw_shgroup(DRWShadingGroup * shgroup, DRWState pass_state) Line 1244	C
 	blender.exe!drw_draw_pass_ex(DRWPass * pass, DRWShadingGroup * start_group, DRWShadingGroup * end_group) Line 1300	C
 	blender.exe!DRW_draw_pass(DRWPass * pass) Line 1339	C
 	blender.exe!workbench_draw_sample(void * ved) Line 511	C
 	blender.exe!workbench_draw_scene(void * ved) Line 587	C
 	blender.exe!drw_engines_draw_scene() Line 1055	C
 	blender.exe!DRW_draw_render_loop_ex(Depsgraph * depsgraph, RenderEngineType * engine_type, ARegion * region, View3D * v3d, GPUViewport * viewport, const bContext * evil_C) Line 1523	C
 	blender.exe!DRW_draw_view(const bContext * C) Line 1405	C
 	blender.exe!view3d_main_region_draw(const bContext * C, ARegion * region) Line 1632	C
 	blender.exe!ED_region_do_draw(bContext * C, ARegion * region) Line 543	C
 	blender.exe!wm_draw_window_offscreen(bContext * C, wmWindow * win, bool stereo) Line 700	C
 	blender.exe!wm_draw_window(bContext * C, wmWindow * win) Line 828	C
 	blender.exe!wm_draw_update(bContext * C) Line 1028	C
 	blender.exe!WM_main(bContext * C) Line 482	C
 	blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 534	C
 	[External Code]

Note: I cannot reproduce in Debug builds, for me, this only happens in Release builds

Not sure it is the same issue as I gt a different stacktrace; but when vertex painting on both objects introduces a threading issue on release builds. To reproduce in debug builds you have to comment out the drw_mesh_batch_cache_check_available function.

MEM_lockfree_allocN_len (vmemh=0x7fff00000002) at /home/jeroen/blender-git/blender/intern/guardedalloc/intern/mallocn_lockfree_impl.c:95
95          return MEMHEAD_FROM_PTR(vmemh)->len & ~((size_t)(MEMHEAD_ALIGN_FLAG));
(gdb) 
(gdb) bt
#0  MEM_lockfree_allocN_len (vmemh=0x7fff00000002) at /home/jeroen/blender-git/blender/intern/guardedalloc/intern/mallocn_lockfree_impl.c:95
#1  0x000000000dbc7b9a in MEM_lockfree_freeN (vmemh=0x7fff00000002) at /home/jeroen/blender-git/blender/intern/guardedalloc/intern/mallocn_lockfree_impl.c:109
#2  0x000000000c76ea2a in GPU_indexbuf_discard (elem=0x7fffc13348a8) at /home/jeroen/blender-git/blender/source/blender/gpu/intern/gpu_element.c:402
#3  0x000000000c757b0e in GPU_batch_clear (batch=0x7fffc0803ac8) at /home/jeroen/blender-git/blender/source/blender/gpu/intern/gpu_batch.c:133
#4  0x000000000c757c25 in GPU_batch_discard (batch=0x7fffc0803ac8) at /home/jeroen/blender-git/blender/source/blender/gpu/intern/gpu_batch.c:159
#5  0x0000000003b01925 in mesh_batch_cache_discard_surface_batches (cache=0x7fffc1db4408) at /home/jeroen/blender-git/blender/source/blender/draw/intern/draw_cache_impl_mesh.c:551
#6  0x0000000003b01ad3 in mesh_batch_cache_discard_shaded_tri (cache=0x7fffc1db4408) at /home/jeroen/blender-git/blender/source/blender/draw/intern/draw_cache_impl_mesh.c:566
#7  0x0000000003b02c1f in mesh_batch_cache_clear (me=0x7fffc822d708) at /home/jeroen/blender-git/blender/source/blender/draw/intern/draw_cache_impl_mesh.c:720
#8  0x0000000003b02c68 in DRW_mesh_batch_cache_free (me=0x7fffc822d708) at /home/jeroen/blender-git/blender/source/blender/draw/intern/draw_cache_impl_mesh.c:731
#9  0x00000000032ea6f5 in BKE_mesh_batch_cache_free (me=0x7fffc822d708) at /home/jeroen/blender-git/blender/source/blender/blenkernel/intern/mesh_runtime.c:264
#10 0x00000000032e9ded in BKE_mesh_runtime_clear_cache (mesh=0x7fffc822d708) at /home/jeroen/blender-git/blender/source/blender/blenkernel/intern/mesh_runtime.c:89
#11 0x00000000032d19e5 in mesh_free_data (id=0x7fffc822d708) at /home/jeroen/blender-git/blender/source/blender/blenkernel/intern/mesh.c:143
#12 0x00000000032b0086 in BKE_libblock_free_datablock (id=0x7fffc822d708, UNUSED_flag=771) at /home/jeroen/blender-git/blender/source/blender/blenkernel/intern/lib_id_delete.c:74
#13 0x00000000032b03d9 in BKE_id_free_ex (bmain=0x0, idv=0x7fffc822d708, flag=771, use_flag_from_idtag=true) at /home/jeroen/blender-git/blender/source/blender/blenkernel/intern/lib_id_delete.c:157
#14 0x00000000032b04f3 in BKE_id_free (bmain=0x0, idv=0x7fffc822d708) at /home/jeroen/blender-git/blender/source/blender/blenkernel/intern/lib_id_delete.c:201
#15 0x00000000032e9dc6 in BKE_mesh_runtime_clear_cache (mesh=0x7fffeb7a9208) at /home/jeroen/blender-git/blender/source/blender/blenkernel/intern/mesh_runtime.c:85
#16 0x00000000032d19e5 in mesh_free_data (id=0x7fffeb7a9208) at /home/jeroen/blender-git/blender/source/blender/blenkernel/intern/mesh.c:143
#17 0x00000000032b0086 in BKE_libblock_free_datablock (id=0x7fffeb7a9208, UNUSED_flag=0) at /home/jeroen/blender-git/blender/source/blender/blenkernel/intern/lib_id_delete.c:74
#18 0x00000000048d14ea in blender::deg::deg_free_copy_on_write_datablock (id_cow=0x7fffeb7a9208) at /home/jeroen/blender-git/blender/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc:1056
#19 0x00000000048d1141 in blender::deg::deg_update_copy_on_write_datablock (depsgraph=0x7fffeb738e08, id_node=0x7fffeb838508) at /home/jeroen/blender-git/blender/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc:935
#20 0x00000000048d1581 in blender::deg::deg_evaluate_copy_on_write (graph=0x7fffeb738e08, id_node=0x7fffeb838508) at /home/jeroen/blender-git/blender/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc:1071
#21 0x00000000048ab293 in std::__invoke_impl<void, void (*&)(Depsgraph*, blender::deg::IDNode const*), Depsgraph*, blender::deg::IDNode*&> (
    __f=@0x7ffff48c7730: 0x48d1508 <blender::deg::deg_evaluate_copy_on_write(Depsgraph*, blender::deg::IDNode const*)>) at /usr/include/c++/9/bits/invoke.h:60
#22 0x00000000048a8983 in std::__invoke<void (*&)(Depsgraph*, blender::deg::IDNode const*), Depsgraph*, blender::deg::IDNode*&> (
    __fn=@0x7ffff48c7730: 0x48d1508 <blender::deg::deg_evaluate_copy_on_write(Depsgraph*, blender::deg::IDNode const*)>) at /usr/include/c++/9/bits/invoke.h:95
#23 0x00000000048a553c in std::_Bind<void (*(std::_Placeholder<1>, blender::deg::IDNode*))(Depsgraph*, blender::deg::IDNode const*)>::__call<void, Depsgraph*&&, 0ul, 1ul>(std::tuple<Depsgraph*&&>&&, std::_Index_tuple<0ul, 1ul>) (
    this=0x7ffff48c7730, __args=...) at /usr/include/c++/9/functional:400
#24 0x00000000048a1cba in std::_Bind<void (*(std::_Placeholder<1>, blender::deg::IDNode*))(Depsgraph*, blender::deg::IDNode const*)>::operator()<Depsgraph*, void>(Depsgraph*&&) (this=0x7ffff48c7730)
    at /usr/include/c++/9/functional:484
#25 0x000000000489e43a in std::_Function_handler<void (Depsgraph*), std::_Bind<void (*(std::_Placeholder<1>, blender::deg::IDNode*))(Depsgraph*, blender::deg::IDNode const*)> >::_M_invoke(std::_Any_data const&, Depsgraph*&&) (
    __functor=..., __args#0=@0x7fffffffd570: 0x7fffeb738e08) at /usr/include/c++/9/bits/std_function.h:300
#26 0x00000000048cf323 in std::function<void (Depsgraph*)>::operator()(Depsgraph*) const (this=0x7fffeb72d5c8, __args#0=0x7fffeb738e08) at /usr/include/c++/9/bits/std_function.h:688
#27 0x00000000048ce474 in blender::deg::(anonymous namespace)::evaluate_node (state=0x7fffffffd910, operation_node=0x7fffeb72d508) at /home/jeroen/blender-git/blender/source/blender/depsgraph/intern/eval/deg_eval.cc:114
#28 0x00000000048ce4ba in blender::deg::(anonymous namespace)::deg_task_run_func (pool=0x7fffc197a108, taskdata=0x7fffeb72d508) at /home/jeroen/blender-git/blender/source/blender/depsgraph/intern/eval/deg_eval.cc:125
#29 0x000000000dbb7d70 in Task::operator()() const::{lambda()#1}::operator()() const (__closure=0x7fffffffd700) at /home/jeroen/blender-git/blender/source/blender/blenlib/intern/task_pool.cc:118
#30 0x000000000dbb819c in tbb::interface7::internal::delegated_function<Task::operator()() const::{lambda()#1} const, void>::operator()() const (this=0x7fffffffd690)
    at /home/jeroen/blender-git/lib/linux_centos7_x86_64/tbb/include/tbb/task_arena.h:93
#31 0x00000000036bc745 in tbb::interface7::internal::isolate_within_arena(tbb::interface7::internal::delegate_base&, long) ()
#32 0x000000000dbb7f4d in tbb::interface7::internal::isolate_impl<void, Task::operator()() const::{lambda()#1} const>(Task::operator()() const::{lambda()#1} const&) (f=...)
    at /home/jeroen/blender-git/lib/linux_centos7_x86_64/tbb/include/tbb/task_arena.h:160
--Type <RET> for more, q to quit, c to continue without paging--
#33 0x000000000dbb7e67 in tbb::interface7::this_task_arena::isolate<Task::operator()() const::{lambda()#1}>(tbb::interface7::internal::return_type_or_void const&) (f=...)
    at /home/jeroen/blender-git/lib/linux_centos7_x86_64/tbb/include/tbb/task_arena.h:395
#34 0x000000000dbb7da3 in Task::operator() (this=0x7fffeb833a48) at /home/jeroen/blender-git/blender/source/blender/blenlib/intern/task_pool.cc:118
#35 0x000000000dbb8178 in tbb::internal::function_task<Task>::execute (this=0x7fffeb833a40) at /home/jeroen/blender-git/lib/linux_centos7_x86_64/tbb/include/tbb/task.h:1048
#36 0x00000000036c9e45 in tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::process_bypass_loop(tbb::internal::context_guard_helper<false>&, tbb::task*, long) ()
#37 0x00000000036ca0fb in tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task&, tbb::task*) ()


#38 0x000000000549fc95 in tbb::task::wait_for_all (this=0x7fffeb833ec0) at /home/jeroen/blender-git/lib/linux_centos7_x86_64/tbb/include/tbb/task.h:809
#39 0x00000000054a61ee in tbb::internal::task_group_base::wait (this=0x7fffc197a140) at /home/jeroen/blender-git/lib/linux_centos7_x86_64/tbb/include/tbb/task_group.h:168
#40 0x000000000dbb74c4 in tbb_task_pool_work_and_wait (pool=0x7fffc197a108) at /home/jeroen/blender-git/blender/source/blender/blenlib/intern/task_pool.cc:250
#41 0x000000000dbb7b26 in BLI_task_pool_work_and_wait (pool=0x7fffc197a108) at /home/jeroen/blender-git/blender/source/blender/blenlib/intern/task_pool.cc:499
#42 0x00000000048ceb49 in blender::deg::deg_evaluate_on_refresh (graph=0x7fffeb738e08) at /home/jeroen/blender-git/blender/source/blender/depsgraph/intern/eval/deg_eval.cc:392
#43 0x000000000487d924 in DEG_evaluate_on_refresh (bmain=0x7ffff4f22b08, graph=0x7fffeb738e08) at /home/jeroen/blender-git/blender/source/blender/depsgraph/intern/depsgraph_eval.cc:63

#44 0x00000000033981a6 in scene_graph_update_tagged (depsgraph=0x7fffeb738e08, bmain=0x7ffff4f22b08, only_if_tagged=false) at /home/jeroen/blender-git/blender/source/blender/blenkernel/intern/scene.c:1501
#45 0x0000000003398273 in BKE_scene_graph_update_tagged (depsgraph=0x7fffeb738e08, bmain=0x7ffff4f22b08) at /home/jeroen/blender-git/blender/source/blender/blenkernel/intern/scene.c:1540
#46 0x00000000036d39bf in wm_event_do_depsgraph (C=0x7ffff4f3e208, is_after_open_file=false) at /home/jeroen/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:359
#47 0x00000000036d3ac5 in wm_event_do_refresh_wm_and_depsgraph (C=0x7ffff4f3e208) at /home/jeroen/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:385
#48 0x00000000036d4305 in wm_event_do_notifiers (C=0x7ffff4f3e208) at /home/jeroen/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:549
#49 0x00000000036cf641 in WM_main (C=0x7ffff4f3e208) at /home/jeroen/blender-git/blender/source/blender/windowmanager/intern/wm.c:478
#50 0x000000000323a37e in main (argc=1, argv=0x7fffffffdcf8) at /home/jeroen/blender-git/blender/source/creator/creator.c:533

Workaround added for 2.90. I keep this ticket open to research a better solution or to make the workaround permanent.