[Bf-blender-cvs] [106ff2632c1] usd-importer-T81257: USD Importer: dependency graph update crash.

makowalski noreply at git.blender.org
Tue Dec 29 21:43:13 CET 2020


Commit: 106ff2632c1d4e0b882215cdb0337f50221823ca
Author: makowalski
Date:   Tue Dec 29 15:39:03 2020 -0500
Branches: usd-importer-T81257
https://developer.blender.org/rB106ff2632c1d4e0b882215cdb0337f50221823ca

USD Importer: dependency graph update crash.

Fixed occasional random crash due to simultaneous update
to the dependency graph from multiple threads. A typical
collision might happen when the USD import job thread
is creating a material while the window manager in the
main thread is processing event notifiers.  Specifically,
invoking BKE_object_material_slot_add() in the import
thread would crash in the call Depsgraph::find_id_node(),
presumably because the call to BKE_scene_graph_update_for_newframe()
from the main thread is invalidating Depsgraph::id_hash.
The current fix is to remove the ND_FRAME flag from the call
to WM_jobs_timer(), which prevents ED_update_for_newframe()
from being called in wm_event_system.c, line 506.
We should look into whether we can skip invoking WM_jobs_timer()
from the import thread altogether.

===================================================================

M	source/blender/io/usd/intern/usd_capi.cc

===================================================================

diff --git a/source/blender/io/usd/intern/usd_capi.cc b/source/blender/io/usd/intern/usd_capi.cc
index 17101e670b7..5c65b59cedd 100644
--- a/source/blender/io/usd/intern/usd_capi.cc
+++ b/source/blender/io/usd/intern/usd_capi.cc
@@ -567,7 +567,7 @@ bool USD_import(bContext *C,
 
     /* setup job */
     WM_jobs_customdata_set(wm_job, job, blender::io::usd::import_freejob);
-    WM_jobs_timer(wm_job, 0.1, NC_SCENE | ND_FRAME, NC_SCENE | ND_FRAME);
+    WM_jobs_timer(wm_job, 0.1, NC_SCENE, NC_SCENE);
     WM_jobs_callbacks(wm_job,
                       blender::io::usd::import_startjob,
                       nullptr,



More information about the Bf-blender-cvs mailing list