Page MenuHome

Crash on Exiting Texture Paint With Multiresolution (Image Editor involved)
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Windows 10 64 bit
Graphics card: Nvidia GTX 750 Ti

Blender Version
Broken: 2.90.1 release, 2.91 alpha ba8233174cd7
Worked: 2.83.7
Introduced by: {1ceb91d1b3947fda67a70a2eff785a964e625ca2}

Short description of error
Switching from Texture Paint mode to Object Mode with an object that has a Multiresolution modifier, after sampling and then painting, crashes every time.
This makes Texture Painting with Multires impossible to use.

Exact steps for others to reproduce the error

  1. Open the file.
  2. Press the "S" key while hovering over the object to sample a color.
  3. Paint one stroke. (Observe that in the Image Editor panel, the wireframe becomes more sparse after the stroke.)
  4. Switch to Object Mode. It crashes immediately.

Event Timeline

Evan Wilson (EAW) changed the task status from Needs Triage to Confirmed.Oct 18 2020, 11:48 AM

Thank you for the report. I can confirm that it crashes using 2.91 77aef03d8ade.
It crashes 2.90.1 when starting Blender normally, or when using blender_factory_startup.cmd. 2.90.1 doesn't crash when using blender_debug_log.cmd or blender_debug_gpu.cmd
2.83.7 doesn't crash.

2.91 MSVC debug build stack trace:

blender.exe!GPU_indexbuf_discard(GPUIndexBuf * elem=0x000002865f711508) Line 356
	at C:\blender-git\blender\source\blender\gpu\intern\gpu_index_buffer.cc(356)
blender.exe!GPU_batch_clear(GPUBatch * batch=0x000002866c84d030) Line 110
	at C:\blender-git\blender\source\blender\gpu\intern\gpu_batch.cc(110)
blender.exe!GPU_batch_discard(GPUBatch * batch=0x000002866c84d030) Line 131
	at C:\blender-git\blender\source\blender\gpu\intern\gpu_batch.cc(131)
blender.exe!mesh_batch_cache_discard_surface_batches(MeshBatchCache * cache=0x000002865fc7e9c8) Line 548
	at C:\blender-git\blender\source\blender\draw\intern\draw_cache_impl_mesh.c(548)
blender.exe!mesh_batch_cache_discard_shaded_tri(MeshBatchCache * cache=0x000002865fc7e9c8) Line 563
	at C:\blender-git\blender\source\blender\draw\intern\draw_cache_impl_mesh.c(563)
blender.exe!mesh_batch_cache_clear(Mesh * me=0x0000028672528418) Line 713
	at C:\blender-git\blender\source\blender\draw\intern\draw_cache_impl_mesh.c(713)
blender.exe!DRW_mesh_batch_cache_free(Mesh * me=0x0000028672528418) Line 724
	at C:\blender-git\blender\source\blender\draw\intern\draw_cache_impl_mesh.c(724)
blender.exe!BKE_mesh_batch_cache_free(Mesh * me=0x0000028672528418) Line 266
	at C:\blender-git\blender\source\blender\blenkernel\intern\mesh_runtime.c(266)
blender.exe!BKE_mesh_runtime_clear_cache(Mesh * mesh=0x0000028672528418) Line 90
	at C:\blender-git\blender\source\blender\blenkernel\intern\mesh_runtime.c(90)
blender.exe!mesh_free_data(ID * id=0x0000028672528418) Line 159
	at C:\blender-git\blender\source\blender\blenkernel\intern\mesh.c(159)
blender.exe!BKE_mesh_free(Mesh * me=0x0000028672528418) Line 809
	at C:\blender-git\blender\source\blender\blenkernel\intern\mesh.c(809)
blender.exe!BKE_mesh_eval_delete(Mesh * mesh_eval=0x0000028672528418) Line 1002
	at C:\blender-git\blender\source\blender\blenkernel\intern\mesh.c(1002)
blender.exe!BKE_object_free_derived_caches(Object * ob=0x000002866243a908) Line 907
	at C:\blender-git\blender\source\blender\blenkernel\intern\object.c(907)
blender.exe!blender::deg::ObjectRuntimeBackup::restore_to_object(Object * object=0x000002866243a908) Line 114
	at C:\blender-git\blender\source\blender\depsgraph\intern\eval\deg_eval_runtime_backup_object.cc(114)
blender.exe!blender::deg::RuntimeBackup::restore_to_id(ID * id=0x000002866243a908) Line 99
	at C:\blender-git\blender\source\blender\depsgraph\intern\eval\deg_eval_runtime_backup.cc(99)
blender.exe!blender::deg::deg_update_copy_on_write_datablock(const blender::deg::Depsgraph * depsgraph=0x000002866ce54058, const blender::deg::IDNode * id_node=0x0000028657ff47b8) Line 955
	at C:\blender-git\blender\source\blender\depsgraph\intern\eval\deg_eval_copy_on_write.cc(955)
blender.exe!blender::deg::deg_evaluate_copy_on_write(Depsgraph * graph=0x000002866ce54058, const blender::deg::IDNode * id_node=0x0000028657ff47b8) Line 1089
	at C:\blender-git\blender\source\blender\depsgraph\intern\eval\deg_eval_copy_on_write.cc(1089)
blender.exe!std::invoke<void (__cdecl*&)(Depsgraph *,blender::deg::IDNode const *),Depsgraph *,blender::deg::IDNode * &>(void(*)(Depsgraph *, const blender::deg::IDNode *) & _Obj=0x00007ff644bb5470, Depsgraph * && _Arg1=0x000002866ce54058, blender::deg::IDNode * & <_Args2_0>=0x0000028657ff47b8) Line 1626
	at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(1626)
blender.exe!std::_Invoker_ret<std::_Unforced,0>::_Call<void (__cdecl*&)(Depsgraph *,blender::deg::IDNode const *),Depsgraph *,blender::deg::IDNode * &>(void(*)(Depsgraph *, const blender::deg::IDNode *) & <_Vals_0>=0x00007ff644bb5470, Depsgraph * && <_Vals_1>=0x000002866ce54058, blender::deg::IDNode * & <_Vals_2>=0x0000028657ff47b8) Line 1658
	at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(1658)
blender.exe!std::_Call_binder<std::_Unforced,0,1,void (__cdecl*)(Depsgraph *,blender::deg::IDNode const *),std::tuple<std::_Ph<1>,blender::deg::IDNode *>,std::tuple<Depsgraph * &&>>(std::_Invoker_ret<std::_Unforced,0> __formal={...}, std::integer_sequence<unsigned __int64,0,1> __formal={...}, void(*)(Depsgraph *, const blender::deg::IDNode *) & _Obj=0x00007ff644bb5470, std::tuple<std::_Ph<1>,blender::deg::IDNode *> & _Tpl={...}, std::tuple<Depsgraph * &&> && _Ut={...}) Line 1388
	at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\functional(1388)
blender.exe!std::_Binder<std::_Unforced,void (__cdecl&)(Depsgraph *,blender::deg::IDNode const *),std::_Ph<1> const &,blender::deg::IDNode * &>::operator()<Depsgraph *>(Depsgraph * && <_Unbargs_0>=0x000002866ce54058) Line 1427
	at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\functional(1427)
blender.exe!std::invoke<std::_Binder<std::_Unforced,void (__cdecl&)(Depsgraph *,blender::deg::IDNode const *),std::_Ph<1> const &,blender::deg::IDNode * &> &,Depsgraph *>(std::_Binder<std::_Unforced,void (__cdecl&)(Depsgraph *,blender::deg::IDNode const *),std::_Ph<1> const &,blender::deg::IDNode * &> & _Obj={...}, Depsgraph * && _Arg1=0x000002866ce54058) Line 1626
	at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(1626)
blender.exe!std::_Invoker_ret<void,1>::_Call<std::_Binder<std::_Unforced,void (__cdecl&)(Depsgraph *,blender::deg::IDNode const *),std::_Ph<1> const &,blender::deg::IDNode * &> &,Depsgraph *>(std::_Binder<std::_Unforced,void (__cdecl&)(Depsgraph *,blender::deg::IDNode const *),std::_Ph<1> const &,blender::deg::IDNode * &> & <_Vals_0>={...}, Depsgraph * && <_Vals_1>=0x000002866ce54058) Line 1641
	at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\type_traits(1641)
blender.exe!std::_Func_impl_no_alloc<std::_Binder<std::_Unforced,void (__cdecl&)(Depsgraph *,blender::deg::IDNode const *),std::_Ph<1> const &,blender::deg::IDNode * &>,void,Depsgraph *>::_Do_call(Depsgraph * && <_Args_0>=0x000002866ce54058) Line 904
	at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\functional(904)
blender.exe!std::_Func_class<void,Depsgraph *>::operator()(Depsgraph * <_Args_0>=0x000002866ce54058) Line 952
	at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\functional(952)
blender.exe!blender::deg::`anonymous namespace'::evaluate_node(const blender::deg::`anonymous-namespace'::DepsgraphEvalState * state=0x000000a990bfe7e8, blender::deg::OperationNode * operation_node=0x000002865f7643d8) Line 116
	at C:\blender-git\blender\source\blender\depsgraph\intern\eval\deg_eval.cc(116)
blender.exe!blender::deg::`anonymous namespace'::deg_task_run_func(TaskPool * pool=0x00000286716c0f88, void * taskdata=0x000002865f7643d8) Line 128
	at C:\blender-git\blender\source\blender\depsgraph\intern\eval\deg_eval.cc(128)
blender.exe!Task::()::__l2::<lambda>() Line 118
	at C:\blender-git\blender\source\blender\blenlib\intern\task_pool.cc(118)
blender.exe!tbb::interface7::internal::delegated_function<void <lambda>(void) const ,void>::operator()() Line 94
	at C:\blender-git\lib\win64_vc15\tbb\include\tbb\task_arena.h(94)
tbb_debug.dll!00007ffd9191cd44()
blender.exe!tbb::interface7::internal::isolate_impl<void,void <lambda>(void) const>(const Task::()::__l2::void <lambda>(void) & f=void <lambda>(void){...}) Line 161
	at C:\blender-git\lib\win64_vc15\tbb\include\tbb\task_arena.h(161)
blender.exe!tbb::interface7::this_task_arena::isolate<void <lambda>(void)>(const Task::()::__l2::void <lambda>(void) & f=void <lambda>(void){...}) Line 396
	at C:\blender-git\lib\win64_vc15\tbb\include\tbb\task_arena.h(396)
blender.exe!Task::operator()() Line 122
	at C:\blender-git\blender\source\blender\blenlib\intern\task_pool.cc(122)
blender.exe!tbb::internal::function_task<Task>::execute() Line 1049
	at C:\blender-git\lib\win64_vc15\tbb\include\tbb\task.h(1049)
tbb_debug.dll!00007ffd9193d21a()
tbb_debug.dll!00007ffd9193aff3()
blender.exe!tbb::task::wait_for_all() Line 810
	at C:\blender-git\lib\win64_vc15\tbb\include\tbb\task.h(810)
blender.exe!tbb::internal::task_group_base::wait() Line 168
	at C:\blender-git\lib\win64_vc15\tbb\include\tbb\task_group.h(168)
blender.exe!tbb_task_pool_work_and_wait(TaskPool * pool=0x00000286716c0f88) Line 253
	at C:\blender-git\blender\source\blender\blenlib\intern\task_pool.cc(253)
blender.exe!BLI_task_pool_work_and_wait(TaskPool * pool=0x00000286716c0f88) Line 500
	at C:\blender-git\blender\source\blender\blenlib\intern\task_pool.cc(500)
blender.exe!blender::deg::deg_evaluate_on_refresh(blender::deg::Depsgraph * graph=0x000002866ce54058) Line 392
	at C:\blender-git\blender\source\blender\depsgraph\intern\eval\deg_eval.cc(392)
blender.exe!deg_flush_updates_and_refresh(blender::deg::Depsgraph * deg_graph=0x000002866ce54058) Line 59
	at C:\blender-git\blender\source\blender\depsgraph\intern\depsgraph_eval.cc(59)
blender.exe!DEG_evaluate_on_refresh(Depsgraph * graph=0x000002866ce54058) Line 74
	at C:\blender-git\blender\source\blender\depsgraph\intern\depsgraph_eval.cc(74)
blender.exe!scene_graph_update_tagged(Depsgraph * depsgraph=0x000002866ce54058, Main * bmain=0x0000028662cab218, bool only_if_tagged=false) Line 1531
	at C:\blender-git\blender\source\blender\blenkernel\intern\scene.c(1531)
blender.exe!BKE_scene_graph_update_tagged(Depsgraph * depsgraph=0x000002866ce54058, Main * bmain=0x0000028662cab218) Line 1569
	at C:\blender-git\blender\source\blender\blenkernel\intern\scene.c(1569)
blender.exe!wm_event_do_depsgraph(bContext * C=0x00000286553829a8, bool is_after_open_file=false) Line 361
	at C:\blender-git\blender\source\blender\windowmanager\intern\wm_event_system.c(361)
blender.exe!wm_event_do_refresh_wm_and_depsgraph(bContext * C=0x00000286553829a8) Line 388
	at C:\blender-git\blender\source\blender\windowmanager\intern\wm_event_system.c(388)
blender.exe!wm_event_do_notifiers(bContext * C=0x00000286553829a8) Line 570
	at C:\blender-git\blender\source\blender\windowmanager\intern\wm_event_system.c(570)
blender.exe!WM_main(bContext * C=0x00000286553829a8) Line 487
	at C:\blender-git\blender\source\blender\windowmanager\intern\wm.c(487)
blender.exe!main(int argc=1, const unsigned char * * UNUSED_argv_c=0x0000028651c500d0) Line 523
	at C:\blender-git\blender\source\creator\creator.c(523)
blender.exe!invoke_main() Line 79
	at D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(79)
blender.exe!__scrt_common_main_seh() Line 288
	at D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288)
blender.exe!__scrt_common_main() Line 331
	at D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(331)
blender.exe!mainCRTStartup() Line 17
	at D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp(17)
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()


Slightly different stack trace when running blender_debug_log.cmd on a Release build:

ExceptionCode         : EXCEPTION_ACCESS_VIOLATION
Exception Address     : 0x00007FF68F34B68D
Exception Module      : blender.exe
Exception Flags       : 0x00000000
Exception Parameters  : 0x2
	Parameters[0] : 0x0000000000000000
	Parameters[1] : 0xFFFFFFFFFFFFFFFF


Stack trace:
blender.exe         :0x00007FF68F34B680  boost::detail::sp_counted_base::destroy C:\blender-git\lib\win64_vc15\boost\include\boost\smart_ptr\detail\sp_counted_base_std_atomic.hpp:91
blender.exe         :0x00007FF692A138E0  GPU_batch_discard C:\blender-git\blender\source\blender\gpu\intern\gpu_batch.cc:129
blender.exe         :0x00007FF68EFF3160  mesh_batch_cache_discard_shaded_tri C:\blender-git\blender\source\blender\draw\intern\draw_cache_impl_mesh.c:562
blender.exe         :0x00007FF68EFF2FA0  mesh_batch_cache_clear C:\blender-git\blender\source\blender\draw\intern\draw_cache_impl_mesh.c:713
blender.exe         :0x00007FF68EFF20B0  DRW_mesh_batch_cache_free C:\blender-git\blender\source\blender\draw\intern\draw_cache_impl_mesh.c:724
blender.exe         :0x00007FF68EE6B360  BKE_mesh_runtime_clear_cache C:\blender-git\blender\source\blender\blenkernel\intern\mesh_runtime.c:90
blender.exe         :0x00007FF68ED9AB70  BKE_mesh_eval_delete C:\blender-git\blender\source\blender\blenkernel\intern\mesh.c:1001
blender.exe         :0x00007FF68ED936B0  BKE_object_free_derived_caches C:\blender-git\blender\source\blender\blenkernel\intern\object.c:907
blender.exe         :0x00007FF692A8AC00  blender::deg::ObjectRuntimeBackup::restore_to_object C:\blender-git\blender\source\blender\depsgraph\intern\eval\deg_eval_runtime_backup_object.cc:114
blender.exe         :0x00007FF692A81140  blender::deg::RuntimeBackup::restore_to_id C:\blender-git\blender\source\blender\depsgraph\intern\eval\deg_eval_runtime_backup.cc:115
blender.exe         :0x00007FF692A6B000  blender::deg::deg_update_copy_on_write_datablock C:\blender-git\blender\source\blender\depsgraph\intern\eval\deg_eval_copy_on_write.cc:954
blender.exe         :0x00007FF692A6AA70  blender::deg::deg_evaluate_copy_on_write C:\blender-git\blender\source\blender\depsgraph\intern\eval\deg_eval_copy_on_write.cc:1089
blender.exe         :0x00007FF692A79440  blender::deg::`anonymous namespace'::evaluate_node C:\blender-git\blender\source\blender\depsgraph\intern\eval\deg_eval.cc:116
blender.exe         :0x00007FF692A793F0  blender::deg::`anonymous namespace'::deg_task_run_func C:\blender-git\blender\source\blender\depsgraph\intern\eval\deg_eval.cc:128
tbb.dll             :0x00007FFDC1AF51D0  tbb::interface7::internal::isolate_within_arena
blender.exe         :0x00007FF692AFE030  tbb::internal::function_task<Task>::execute C:\blender-git\lib\win64_vc15\tbb\include\tbb\task.h:1048
tbb.dll             :0x00007FFDC1B037A0  tbb::recursive_mutex::scoped_lock::internal_try_acquire
tbb.dll             :0x00007FFDC1B037A0  tbb::recursive_mutex::scoped_lock::internal_try_acquire
tbb.dll             :0x00007FFDC1AF51D0  tbb::interface7::internal::isolate_within_arena
tbb.dll             :0x00007FFDC1AFA490  tbb::task_scheduler_init::terminate
tbb.dll             :0x00007FFDC1B019C0  tbb::thread_bound_filter::try_process_item
tbb.dll             :0x00007FFDC1B019C0  tbb::thread_bound_filter::try_process_item
ucrtbase.dll        :0x00007FFDDF7A0F70  beginthreadex
KERNEL32.DLL        :0x00007FFDE1257C10  BaseThreadInitThunk
ntdll.dll           :0x00007FFDE23ACE80  RtlUserThreadStart

Tested using
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 470/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 391.35
version: 2.91.0 Alpha, branch: master, commit date: 2020-10-16 16:06, hash: 77aef03d8ade

Note that the crash doesn't seem to happen if there is not Image Editor open.

And should this perhaps be High priority, considering this is a crash bug? (See https://wiki.blender.org/wiki/Process/Bug_Reports/Triaging_Playbook#Valid_crash_report.2C_can_confirm)

Philipp Oeser (lichtwerk) triaged this task as High priority.Oct 18 2020, 2:07 PM
Philipp Oeser (lichtwerk) changed the subtype of this task from "Report" to "Bug".

I am seeing this as well (not reliably though, still trying to figure out how exactly this can be triggered 100% reproducable)
Also I dont get in a Debug build at all?
For Release builds, this seems to have started between good baf124c753d9 and bad f45f8a7a8985.

So no luck nailing this to a particular commit that caused it, but I also think this deserves High priority.

Philipp Oeser (lichtwerk) renamed this task from Crash on Exiting Texture Paint With Multiresolution to Crash on Exiting Texture Paint With Multiresolution (Image Editor involved).Oct 18 2020, 5:18 PM

I agree that it should have been set to high, I wanted to see if I could narrow down the cause further first. I got caught going down the rabbit hole of the fact that many seemingly unrelated crash reports stack traces all start with the same TBB code (that partially(?) has since been removed from their code base. (Difficult to figure out what is going on there as TBB's commit logs leave much to be desired in the documentation and size department.))

I did try retest this yesterday using 2.91 rBefc2edc47f7a and noticed that it no longer crashes when changing to object mode. However, the sphere now disappears when I click to paint on it.

Running blender_debug_gpu.cmd results in 227 occurrences of:
GPUDebug: Texture state usage warning: Texture 0 is base level inconsistent. Check texture size.
and 8 occurrences of:
GPUDebug: Rasterization usage warning: Blending is enabled, but is not supported for integer framebuffers.

I'd also like to note that the root of the issue seems to be happening at the sampling (pressing S).
You can see that in the image editor the lines from wireframe disappear and it looks like it's drawn with "optimal display".

I will have a look as my name is all over it :-) Not sure what is actually going on. But will investigate starting with the drawing part.

I am not able to crash. It could be that the crash has already been solved. Still left are the glitches.

In Blender 2.83 the uv geometry in the uv editor also changes, will add that as a separate issue. I will keep this issue for the disapearing object.

I can confirm that this no longer crashes, but the object disappears instead.

yes, as evan said

I did try retest this yesterday using 2.91 rBefc2edc47f7a and noticed that it no longer crashes when changing to object mode. However, the sphere now disappears when I click to paint on it.

The disappearing object is introduced by {1ceb91d1b3947fda67a70a2eff785a964e625ca2}

It seems like draw_cache_impl_mesh perfors a save clear

for (int i = 0; i < cache->mat_len; i++) {
  GPU_BATCH_CLEAR_SAFE(cache->surface_per_mat[i]);
}
GPU_BATCH_CLEAR_SAFE(cache->batch.surface);
cache->batch_ready &= ~(MBC_SURFACE);

but the MBC_SURFACE batch isn't picked up by mesh_buffer_cache_create_requested.