Assert: When loading asset libraries from within a large asset library #108703

Closed
opened 2023-06-07 14:42:22 +02:00 by Lukas Tönne · 5 comments
Member

System Information
Operating system: Linux-6.3.5-gentoo-x86_64-AMD_Ryzen_7_5700G_with_Radeon_Graphics-with-glibc2.36
Graphics card: AMD Radeon Graphics (renoir, LLVM 15.0.7, DRM 3.52, 6.3.5-gentoo)

Blender Version
Broken: 4.0.0 Alpha, branch: main, commit date: 2023-06-07 10:40, hash: eb7ae2fb82, type: Debug
Worked: ?

Short description of error
Loading asset libraries (by dragging a node socket link) inside an asset library file causes a crash.

Exact steps for others to reproduce the error
Unfortunately the error seems to depend on how long the libraries take to load. I could not repro with a simpler asset library, so the attached file contains my fairly large actual library.

  1. Unzip the attached asset library into a folder
  2. Add the folder to the Asset Libraries file paths in user preferences
  3. Restart Blender (not sure if necessary but we want to force loading from a clean slate)
  4. Open the race_condition_test.blend file
  5. In the node editor press shift+A, or drag a link to open the search menu. It should crash in asset_system::copy_catalog_map_into_existing.

Callstack for comparison: callstack.txt

**System Information** Operating system: Linux-6.3.5-gentoo-x86_64-AMD_Ryzen_7_5700G_with_Radeon_Graphics-with-glibc2.36 Graphics card: AMD Radeon Graphics (renoir, LLVM 15.0.7, DRM 3.52, 6.3.5-gentoo) **Blender Version** Broken: 4.0.0 Alpha, branch: main, commit date: 2023-06-07 10:40, hash: eb7ae2fb82de, type: Debug Worked: ? **Short description of error** Loading asset libraries (by dragging a node socket link) inside an asset library file causes a crash. **Exact steps for others to reproduce the error** Unfortunately the error seems to depend on how long the libraries take to load. I could not repro with a simpler asset library, so the attached file contains my fairly large actual library. 1. Unzip the attached asset library into a folder 1. Add the folder to the Asset Libraries file paths in user preferences 1. Restart Blender (not sure if necessary but we want to force loading from a clean slate) 1. Open the race_condition_test.blend file 1. In the node editor press shift+A, or drag a link to open the search menu. It should crash in `asset_system::copy_catalog_map_into_existing`. Callstack for comparison: [callstack.txt](/attachments/f7f3e3b2-4d2c-4b6b-9f22-189ef9a7e88c)
Lukas Tönne added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-06-07 14:42:22 +02:00
Iliya Katushenock added the
Interest
Asset Browser
label 2023-06-07 14:45:56 +02:00

Can't confirm here.

Can't confirm here.
Member

Can not replicate either in current master.

**System Information**
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3050 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 532.03
Can not replicate either in current master. ``` **System Information** Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3050 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 532.03 ```
Member

From attached call-stack, this appears to be an assert-hit (not crash)
Can confirm in debug build.

From attached call-stack, this appears to be an assert-hit (not crash) Can confirm in debug build.
Pratik Borhade added
Module
Pipeline, Assets & IO
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-06-08 05:55:16 +02:00
Pratik Borhade changed title from Crash when loading asset libraries from within a large asset library to Assert: When loading asset libraries from within a large asset library 2023-06-08 06:14:10 +02:00
Author
Member

I keep running into this whenever i work on asset libraries in debug mode. It happens because an asset library can be loaded twice: first as part of the asset libraries path config, then a second time as a "local" library when opening its file.

Repro steps:

  1. (optional) Load Factory Preferences to clear custom asset library paths.
  2. In asset browser, switch to Current File, add a new catalog to the local asset library.
  3. Mark the default cube as asset. Move the cube asset into the new catalog.
  4. Save file in a new folder. Add the folder to the asset library paths in preferences.
  5. Start Blender in Debug mode, open the file again.

Not sure what the best way to prevent this would be. Generally seems like a good idea to assert we're not unnecessarily loading libraries twice, but in this case it is expected.

I keep running into this whenever i work on asset libraries in debug mode. It happens because an asset library can be loaded twice: first as part of the asset libraries path config, then a second time as a "local" library when opening its file. Repro steps: 1. (optional) _Load Factory Preferences_ to clear custom asset library paths. 2. In asset browser, switch to _Current File_, add a new catalog to the local asset library. 3. Mark the default cube as asset. Move the cube asset into the new catalog. 4. Save file in a new folder. Add the folder to the asset library paths in preferences. 5. Start Blender in __Debug mode__, open the file again. Not sure what the best way to prevent this would be. Generally seems like a good idea to assert we're not unnecessarily loading libraries twice, but in this case it is expected.
Member

Let me clarify this a bit: Issue here is not a race condition, it's simply that when building the "All" asset library, multiple catalogs with the same UUID are found, which code assumes to be unique. I think this can easily happen when loading the "All" library in some way (e.g. when displaying the node add menu) while the current file is part of an asset library. Then you have two asset libraries loading the same asset library catalogs (same blender_assets.cats.txt).

Let me clarify this a bit: Issue here is not a race condition, it's simply that when building the "All" asset library, multiple catalogs with the same UUID are found, which code assumes to be unique. I think this can easily happen when loading the "All" library in some way (e.g. when displaying the node add menu) while the current file is part of an asset library. Then you have two asset libraries loading the same asset library catalogs (same `blender_assets.cats.txt`).
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-02-20 16:49:41 +01: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
4 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#108703
No description provided.