Asset shelf crash when opening a file #125466

Closed
opened 2024-07-26 03:03:23 +02:00 by Colin Basnett · 3 comments
Member

System Information
Operating system: Windows 11
Graphics card: NVIDIA RTX 3060 Ti

Blender Version
Broken: 4.2.0
Worked: Unknown

Caused by d4fc167db1

Short description
Crash opening a file with enabled Asset Shelf

Steps to reproduce

  • enable View > Asset Shelf in either the 3D view or the Image Editor
  • save the file
  • revert > crash

Original Report

The program will crash when re-opening a file previously saved in the same version.

Exception:

Unhandled exception thrown: read access violation.
shelf_regiondata was nullptr.

Stack trace:

 	blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, const wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1578	C++
 	blender.exe!wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const wmOperatorCallContext context, const bool poll_only, const wmEvent * event) Line 1810	C++
 	[Inline Frame] blender.exe!WM_operator_name_call_ptr(bContext *) Line 1824	C++
 	blender.exe!WM_operator_name_call_ptr_with_depends_on_cursor(bContext * C, wmOperatorType * ot, wmOperatorCallContext opcontext, PointerRNA * properties, const wmEvent * event, const char * drawstr) Line 2015	C++
 	blender.exe!ui_apply_but_funcs_after(bContext * C) Line 1031	C++
 	blender.exe!ui_popup_handler(bContext * C, const wmEvent * event, void * userdata) Line 11809	C++
 	[Inline Frame] blender.exe!wm_handler_ui_call(bContext *) Line 857	C++
 	blender.exe!wm_handlers_do_intern(bContext * C, wmWindow * win, wmEvent * event, ListBase * handlers) Line 3384	C++
 	blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 3506	C++
 	blender.exe!wm_event_do_handlers(bContext * C) Line 4133	C++
 	blender.exe!WM_main(bContext * C) Line 639	C++
 	blender.exe!main(int argc, const char * * __formal) Line 599	C++
 	[External Code]	

Exact steps for others to reproduce the error

I've attached the .blend file that causes the crash for me, but I get the feeling it requires a specific asset library configuration. For what it's worth, my asset libraries are quite large.

**System Information** Operating system: Windows 11 Graphics card: NVIDIA RTX 3060 Ti **Blender Version** Broken: 4.2.0 Worked: Unknown Caused by d4fc167db1 **Short description** Crash opening a file with enabled Asset Shelf **Steps to reproduce** - enable `View` > `Asset Shelf` in either the 3D view or the Image Editor - save the file - revert > crash **Original Report** The program will crash when re-opening a file previously saved in the same version. Exception: ``` Unhandled exception thrown: read access violation. shelf_regiondata was nullptr. ``` Stack trace: ``` blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, const wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1578 C++ blender.exe!wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const wmOperatorCallContext context, const bool poll_only, const wmEvent * event) Line 1810 C++ [Inline Frame] blender.exe!WM_operator_name_call_ptr(bContext *) Line 1824 C++ blender.exe!WM_operator_name_call_ptr_with_depends_on_cursor(bContext * C, wmOperatorType * ot, wmOperatorCallContext opcontext, PointerRNA * properties, const wmEvent * event, const char * drawstr) Line 2015 C++ blender.exe!ui_apply_but_funcs_after(bContext * C) Line 1031 C++ blender.exe!ui_popup_handler(bContext * C, const wmEvent * event, void * userdata) Line 11809 C++ [Inline Frame] blender.exe!wm_handler_ui_call(bContext *) Line 857 C++ blender.exe!wm_handlers_do_intern(bContext * C, wmWindow * win, wmEvent * event, ListBase * handlers) Line 3384 C++ blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 3506 C++ blender.exe!wm_event_do_handlers(bContext * C) Line 4133 C++ blender.exe!WM_main(bContext * C) Line 639 C++ blender.exe!main(int argc, const char * * __formal) Line 599 C++ [External Code] ``` **Exact steps for others to reproduce the error** I've attached the .blend file that causes the crash for me, but I get the feeling it requires a specific asset library configuration. For what it's worth, my asset libraries are quite large.
Colin Basnett added the
Type
Report
Status
Needs Triage
Severity
Normal
labels 2024-07-26 03:03:23 +02:00
Member

Getting a crash here, too, will check...

Getting a crash here, too, will check...
Philipp Oeser added
Status
Confirmed
and removed
Status
Needs Triage
labels 2024-07-26 09:05:10 +02:00
Member

Caused by d4fc167db1

Easy to repro from scratch:

  • enable View > Asset Shelf in either the 3D view or the Image Editor
  • save the file
  • revert > crash

CC @JulianEisel @HooglyBoogly

Caused by d4fc167db11b30da373d59643335c93bf80ac4f4 Easy to repro from scratch: - enable `View` > `Asset Shelf` in either the 3D view or the Image Editor - save the file - revert > crash CC @JulianEisel @HooglyBoogly
Philipp Oeser added
Module
User Interface
Interest
Asset System
Severity
High
and removed
Severity
Normal
labels 2024-07-26 14:57:08 +02:00
Member

Most likely fixed by #123385. However I find this a bit too risky for backporting to 4.2, so I'd suggest this workaround for the 4.2 branch:

diff --git a/source/blender/editors/asset/intern/asset_shelf.cc b/source/blender/editors/asset/intern/asset_shelf.cc
index e1c12abd607..82f2155782c 100644
--- a/source/blender/editors/asset/intern/asset_shelf.cc
+++ b/source/blender/editors/asset/intern/asset_shelf.cc
@@ -349,7 +349,7 @@ void region_message_subscribe(const wmRegionMessageSubscribeParams *params)
 void region_init(wmWindowManager *wm, ARegion *region)
 {
   /* Region-data should've been created by a previously called #region_on_poll_success(). */
-  RegionAssetShelf *shelf_regiondata = RegionAssetShelf::get_from_asset_shelf_region(*region);
+  RegionAssetShelf *shelf_regiondata = RegionAssetShelf::ensure_from_asset_shelf_region(*region);
   BLI_assert_msg(
       shelf_regiondata,
       "Region-data should've been created by a previously called `region_on_poll_success()`.");

Most likely fixed by #123385. However I find this a bit too risky for backporting to 4.2, so I'd suggest this workaround for the 4.2 branch: ```diff diff --git a/source/blender/editors/asset/intern/asset_shelf.cc b/source/blender/editors/asset/intern/asset_shelf.cc index e1c12abd607..82f2155782c 100644 --- a/source/blender/editors/asset/intern/asset_shelf.cc +++ b/source/blender/editors/asset/intern/asset_shelf.cc @@ -349,7 +349,7 @@ void region_message_subscribe(const wmRegionMessageSubscribeParams *params) void region_init(wmWindowManager *wm, ARegion *region) { /* Region-data should've been created by a previously called #region_on_poll_success(). */ - RegionAssetShelf *shelf_regiondata = RegionAssetShelf::get_from_asset_shelf_region(*region); + RegionAssetShelf *shelf_regiondata = RegionAssetShelf::ensure_from_asset_shelf_region(*region); BLI_assert_msg( shelf_regiondata, "Region-data should've been created by a previously called `region_on_poll_success()`."); ```
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-08-05 15:25:09 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#125466
No description provided.