Regression: Crash with assertion after delete scene when some 3D Views have Local Collection enabled #111970
Operating system: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 536.19
Broken: version: 3.6.0 Alpha, branch: main, commit date: 2023-04-19 00:18, hash:
Worked: version: 3.6.0 Alpha, branch: main, commit date: 2023-04-15 01:59, hash:
Short description of error
See attached assert.
Exact steps for others to reproduce the error
- Open attached bled. file.
- If not loading UI, ensure the 3DView has its 'Local Collections' enabled.
- Delete any scene
Blender will crash.
I cannot seem to be able to reproduce any assert deleting scenes from given file, neither in main nor in current 3.6 branch?
How are you deleting scenes? using the
X icon next to their names at the top-right part of the screen?
using the X icon next to their names at the top-right part of the screen?
Right, X button
note that the assert 'looks like' the viewlayer syncing code is trying to access the just-freed scenes' master collection... But I cannot imagine how that would be possible. 16bcb6576f4361 will make the
viewlayer_collection->collection pointer be processed, even when the collection is the embedded scene's master one... but I cannot see how that would connect to the viewlayer resync code. Viewlayer is private data of a scene, so when the scene is deleted, its viewlayers are freed...
hrrrrmmm.... Actually I think I know what is happening here:
BKE_lib_id_free_ex(), the freed ID usages are remapped to
- This remapping triggers a resync of viewlayers in its post-process steps.
- At this points, the 'collection' pointer of the first viewlayer_collection has been remapped to
null, and is therefore not the same as the scene's master collection anymore.
What I cannot fathom is.... why isn't this asserting for me? o_O
Hrrrmmmm actually no, still do not understand the issue here. The Scene pointer is remapped, not its master collection's pointer...
Can someone actually reproduce this issue with current 3.6 branch build? And current main build?
(This backtrace actually exhibits some other issue with current viewlayer resync code and the local viewlayer handling btw, since the later code path, starting from
BKE_layer_collection_local_sync_all call in
BKE_main_collection_sync, ends up calling
BKE_view_layer_synced_ensure, effectively nullifying the effects of deferred viewlayers update. ;( ).
Which led to actually reproducing the issue here, one key info was missing: There must be at least one view3d in 'local' mode.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?