Page MenuHome

Crash in frame_change_pre handler when deleting and creating a new object in Python
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Linux-5.4.0-42-generic-x86_64-with-debian-bullseye-sid 64 Bits
Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.100

Blender Version
Broken: version: 2.91.0 Alpha, branch: master, commit date: 2020-07-31 21:27, hash: rB106e7654e857
Broken: 2.83.0
Worked: No idea

Short description of error
Blender crashes on seg fault every time when

  1. frame_change_pre handler is used to delete an existing Cube object and add a new Cube object in Python
  2. frame is changed
  3. frame is rendered

Exact steps for others to reproduce the error

  1. Open attached blend file
  2. Click Run Script
  3. Go to another time point in Timeline editor
  4. Render image
  5. Close render window or click on viewport --> crash

Enabling "Lock Interface" does not help (reference: T60094, also T73530)

Event Timeline

Additional notes:

  • Blender seems to fail in deleting existing object in the rendering image (F12) step.
  • Same issue happens in rendering animation (that's where I first noticed this).
Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.Aug 4 2020, 2:47 PM
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".

I can confirm a crash in step 4 (Render Image)

Unhandled exception at 0x00007FF702CEC4C2 in blender.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF
>	blender.exe!extract_tris_iter_looptri_bm(const MeshRenderData * mr, const ExtractTriBMesh_Params * params, void * _data) Line 856	C
 	blender.exe!mesh_extract_iter(const MeshRenderData * mr, const eMRIterType iter_type, int start, int end, const MeshExtract * extract, void * user_data) Line 5093	C
 	blender.exe!extract_run(void * taskdata) Line 5173	C
 	blender.exe!extract_init_and_run(void * taskdata) Line 5187	C
 	blender.exe!extract_single_threaded_task_node_exec(void * task_data) Line 5262	C
 	blender.exe!TaskNode::run::__l2::<lambda>() Line 97	C++
 	blender.exe!tbb::interface7::internal::delegated_function<void <lambda>(void) const ,void>::operator()() Line 94	C++
 	[External Code]	
 	blender.exe!tbb::interface7::internal::isolate_impl<void,void <lambda>(void) const>(const TaskNode::run::__l2::void <lambda>(void) & f) Line 161	C++
 	blender.exe!tbb::interface7::this_task_arena::isolate<void <lambda>(void)>(const TaskNode::run::__l2::void <lambda>(void) & f) Line 396	C++
 	blender.exe!TaskNode::run(const tbb::flow::interface11::continue_msg UNUSED_input) Line 98	C++
 	[External Code]	
 	blender.exe!tbb::flow::interface11::internal::function_body_leaf<tbb::flow::interface11::continue_msg,tbb::flow::interface11::continue_msg,std::_Binder<std::_Unforced,tbb::flow::interface11::continue_msg (__cdecl TaskNode::*)(tbb::flow::interface11::continue_msg),TaskNode *,std::_Ph<1> const &>>::operator()(const tbb::flow::interface11::continue_msg & i) Line 147	C++
 	blender.exe!tbb::flow::interface11::internal::continue_input<tbb::flow::interface11::continue_msg,tbb::flow::interface11::internal::Policy<void>>::apply_body_bypass(tbb::flow::interface11::continue_msg __formal) Line 822	C++
 	blender.exe!tbb::flow::interface11::internal::apply_body_task_bypass<tbb::flow::interface11::internal::continue_input<tbb::flow::interface11::continue_msg,tbb::flow::interface11::internal::Policy<void>>,tbb::flow::interface11::continue_msg>::execute() Line 312	C++
 	[External Code]	
 	blender.exe!tbb::task::wait_for_all() Line 810	C++
 	blender.exe!tbb::flow::interface10::graph::wait_functor::operator()() Line 252	C++
 	blender.exe!tbb::interface7::internal::delegated_function<tbb::flow::interface10::graph::wait_functor const ,void>::operator()() Line 94	C++
 	[External Code]	
 	blender.exe!tbb::interface7::task_arena::execute_impl<void,tbb::flow::interface10::graph::wait_functor const>(const tbb::flow::interface10::graph::wait_functor & f) Line 217	C++
 	blender.exe!tbb::interface7::task_arena::execute<tbb::flow::interface10::graph::wait_functor>(const tbb::flow::interface10::graph::wait_functor & f) Line 357	C++
 	blender.exe!tbb::flow::interface10::graph::wait_for_all() Line 347	C++
 	blender.exe!BLI_task_graph_work_and_wait(TaskGraph * task_graph) Line 132	C++
 	blender.exe!drw_mesh_batch_cache_check_available(TaskGraph * task_graph, Mesh * me) Line 1136	C
 	blender.exe!DRW_mesh_batch_cache_create_requested(TaskGraph * task_graph, Object * ob, Mesh * me, const Scene * scene, const bool is_paint_mode, const bool use_hide) Line 1555	C
 	blender.exe!drw_batch_cache_generate_requested(Object * ob) Line 3578	C
 	blender.exe!DRW_render_object_iter(void * vedata, RenderEngine * engine, Depsgraph * depsgraph, void(*)(void *, Object *, RenderEngine *, Depsgraph *) callback) Line 1834	C
 	blender.exe!eevee_render_to_image(void * vedata, RenderEngine * engine, RenderLayer * render_layer, const rcti * rect) Line 525	C
 	blender.exe!DRW_render_to_image(RenderEngine * engine, Depsgraph * depsgraph) Line 1786	C
 	blender.exe!RE_engine_render(Render * re, int do_all) Line 872	C
 	blender.exe!do_render_3d(Render * re) Line 1138	C
 	blender.exe!do_render(Render * re) Line 1217	C
 	blender.exe!do_render_composite(Render * re) Line 1355	C
 	blender.exe!do_render_all_options(Render * re) Line 1617	C
 	blender.exe!RE_RenderFrame(Render * re, Main * bmain, Scene * scene, ViewLayer * single_layer, Object * camera_override, int frame, const bool write_still) Line 2017	C
 	blender.exe!render_startjob(void * rjv, short * stop, short * do_update, float * progress) Line 651	C
 	blender.exe!do_job_thread(void * job_v) Line 398	C
 	blender.exe!tslot_thread_start(void * tslot_p) Line 227	C++
 	[External Code]