Regression: Crash with assertion after delete scene when some 3D Views have Local Collection enabled #111970

Closed
opened 2023-09-05 12:59:08 +02:00 by SophonHuang · 8 comments

System Information
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

Blender Version
Broken: version: 3.6.0 Alpha, branch: main, commit date: 2023-04-19 00:18, hash: 6d2351d26bd6
Worked: version: 3.6.0 Alpha, branch: main, commit date: 2023-04-15 01:59, hash: b601ae87d064

Short description of error
See attached assert.

Exact steps for others to reproduce the error

  1. Open attached bled. file.
  2. If not loading UI, ensure the 3DView has its 'Local Collections' enabled.
  3. Delete any scene
    Blender will crash.
**System Information** 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 **Blender Version** Broken: version: 3.6.0 Alpha, branch: main, commit date: 2023-04-19 00:18, hash: `6d2351d26bd6` Worked: version: 3.6.0 Alpha, branch: main, commit date: 2023-04-15 01:59, hash: `b601ae87d064` **Short description of error** See attached assert. **Exact steps for others to reproduce the error** 1. Open attached bled. file. 2. If not loading UI, ensure the 3DView has its 'Local Collections' enabled. 3. Delete any scene Blender will crash.
SophonHuang added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-09-05 12:59:09 +02:00
Iliya Katushenock changed title from Crash after delete scene. to Regression: Crash with assertion after delete scene 2023-09-05 20:17:29 +02:00
Iliya Katushenock added this to the 3.6 LTS milestone 2023-09-05 20:22:20 +02:00
Pratik Borhade self-assigned this 2023-09-06 05:40:21 +02:00
Member

Git bisect points to a16bcb6576 🤔
@mont29 ^

Git bisect points to a16bcb6576f436149d815e300e76a1056304cf83 🤔 @mont29 ^
Pratik Borhade removed their assignment 2023-09-06 06:11:20 +02:00

I cannot seem to be able to reproduce any assert deleting scenes from given file, neither in main nor in current 3.6 branch?

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?

How are you deleting scenes? using the `X` icon next to their names at the top-right part of the screen?
Member

using the X icon next to their names at the top-right part of the screen?

Right, X button

> using the X icon next to their names at the top-right part of the screen? Right, X button
Bastien Montagne added
Status
Needs Information from User
and removed
Status
Confirmed
labels 2023-09-06 14:11:08 +02:00

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...

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:

  • In BKE_lib_id_free_ex(), the freed ID usages are remapped to nullptr (call to BKE_libblock_relink_ex).
  • 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

hrrrrmmm.... Actually I think I know what is happening here: * In `BKE_lib_id_free_ex()`, the freed ID usages are remapped to `nullptr` (call to `BKE_libblock_relink_ex`). * 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. ;( ).

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.

Which led to actually reproducing the issue here, one key info was missing: There must be at least one view3d in 'local' mode.
Bastien Montagne changed title from Regression: Crash with assertion after delete scene to Regression: Crash with assertion after delete scene when some 3D Views have Local Collection enabled 2023-09-06 14:56:53 +02:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-09-06 16:23:02 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#111970
No description provided.