Page MenuHome

Crash to desktop with creating a new scene with a motion tracking file loaded
Closed, ResolvedPublicBUG


System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 451.48

Blender Version
Broken: version: 2.91.0 Alpha, branch: master, commit date: 2020-08-23 06:32, hash: rBed288a5786d6
Caused by rB263148dbacc4: Depsgraph: refactor tagging after time changes

Short description of error
I have started a motion tracking project. Saved it. Reopened it. Then i tried to create a new scene. And Blender crashed to desktop.

Exact steps for others to reproduce the error
[Please describe the exact steps needed to reproduce the issue]
[Based on the default startup or an attached .blend file (as simple as possible)]

Open the attached motion tracking scene. Add a new scene.

Event Timeline

Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.Aug 24 2020, 10:54 AM
Philipp Oeser (lichtwerk) changed the subtype of this task from "Report" to "Bug".

Confirmed, checking...

Philipp Oeser (lichtwerk) triaged this task as High priority.

Caused by rB263148dbacc4: Depsgraph: refactor tagging after time changes

time_source is NULL here for a depsgraph which hasnt been build all the way (viewlayer not built).
In this example / file, the crash happens not for the new scene (Scene.003 -- this is built and has a timesource node), but for the other scenes Scene and Scene.001 (these dont have their viewplayers built and dont have a timesource node -- which I think is correct)

1   blender::deg::Depsgraph::tag_time_source         107   0x409e7c1 
2   DEG_graph_time_tag_update           775   0x40b2705 
3   DEG_time_tag_update                 768   0x40b26db 
4   ED_update_for_newframe                   screen_edit.c        1569  0x3904cff 
5   ED_scene_change_update                   scene_edit.c         126   0x3bdbddc 
6   WM_window_set_active_scene               wm_window.c          2341  0x3212839 
7   ED_scene_add                             scene_edit.c         73    0x3bdbc55 
8   scene_new_exec                           scene_edit.c         202   0x3bdc10f 
9   WM_menu_invoke_ex                        wm_operators.c       972   0x31fe2a4 
10  WM_menu_invoke                           wm_operators.c       992   0x31fe3d3 
11  wm_operator_invoke                       wm_event_system.c    1300  0x31df586 
12  wm_operator_call_internal                wm_event_system.c    1513  0x31dfcc2 
13  WM_operator_name_call_ptr                wm_event_system.c    1561  0x31dfebf 
14  ui_apply_but_funcs_after                 interface_handlers.c 904   0x3d34b1f 
15  ui_popup_handler                         interface_handlers.c 10930 0x3d4f7a2 
16  wm_handler_ui_call                       wm_event_system.c    638   0x31ddc83 
17  wm_handlers_do_intern                    wm_event_system.c    2754  0x31e30ca 
18  wm_handlers_do                           wm_event_system.c    2865  0x31e34c2 
19  wm_event_do_handlers                     wm_event_system.c    3289  0x31e4783

For the new scene we are switching to (Scene.003), the timesource node gets correctly added here beforehand:

1   blender::deg::DepsgraphNodeBuilder::build_view_layer 98    0x41070d3 
2   blender::deg::ViewLayerBuilderPipeline::build_nodes          36    0x40cf3c7 
3   blender::deg::AbstractBuilderPipeline::build_step_nodes                     78    0x40cb3cf 
4   blender::deg::AbstractBuilderPipeline::build                       57    0x40cb216 
5   DEG_graph_build_from_view_layer                             216   0x40a2b80 
6   DEG_graph_relations_update                                  269   0x40a2e9d 
7   ED_scene_change_update                                  scene_edit.c                    122   0x3bdbda7 
8   WM_window_set_active_scene                              wm_window.c                     2341  0x3212839 
9   rna_Window_scene_update                                 rna_wm.c                        736   0x381892d 
10  rna_property_update                                     rna_access.c                    2274  0x364ed87 
11  RNA_property_update                                     rna_access.c                    2345  0x364ef67 
12  template_ID_set_property_exec_fn                        interface_templates.c           328   0x3d8932d 
13  ui_apply_but_funcs_after                                interface_handlers.c            921   0x3d34bc1 
14  ui_handler_region_menu                                  interface_handlers.c            10840 0x3d4f4d9 
15  wm_handler_ui_call                                      wm_event_system.c               638   0x31ddc83 
16  wm_handlers_do_intern                                   wm_event_system.c               2754  0x31e30ca 
17  wm_handlers_do                                          wm_event_system.c               2865  0x31e34c2 
18  wm_event_do_handlers                                    wm_event_system.c               3289  0x31e4783 
19  WM_main                                                 wm.c                            476   0x31d90b3 
20  main                                                    creator.c                       546   0x2da1baa 
... <More>

So I think a valid solution is to permit depsgraphs which dont have a timesource in DEG_graph_time_tag_update (we are looping over all depsgraphs in DEG_time_tag_update!) and just continue happily?

Will post a patch next.