Purge Unused crashes if mouse not moved away from popup before confirm delete with enter key #125006

Closed
opened 2024-07-18 19:23:01 +02:00 by Andrea-Lanaro · 6 comments

System Information
Operating system: Windows-10-10.0.17763-SP0 x64
Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 | 4.6.0 NVIDIA 556.12

Blender Version
Broken: 4.2.0 main 2024-06-01 dbc842b21e7d
Broken: 4.2.0, release 2024-07-16 a51f293548ad
Broken: 4.3.0 main 2024-07-17 0b70a9edc56b
Worked: unknown

Change came with 0fd8f29e88

Short description of error
Purge Unused crashes if mouse not moved away from popup before confirm delete with enter key

# Blender 4.2.0, Commit date: 2024-07-16 06:20, Hash a51f293548ad
bpy.data.window_managers["WinMan"]. = False  # Property
No orphaned data-blocks to purge  # Info

# backtrace
Exception Record:

ExceptionCode         : EXCEPTION_ACCESS_VIOLATION
Exception Address     : 0x00007FF76D73AFF6
Exception Module      : blender.exe
Exception Flags       : 0x00000000
Exception Parameters  : 0x2
	Parameters[0] : 0x0000000000000000
	Parameters[1] : 0x0000000000000010

Not fluent in Python but isn't there supposed to be something after dot at bpy.data.window_managers["WinMan"]. ?

Exact steps for others to reproduce the error
Default startup

  1. Access Purge Unused menu with mouse
  2. Keep mouse inside popup
  3. Confirm delete with Enter
    Using D key does not cause a crash.
**System Information** Operating system: Windows-10-10.0.17763-SP0 x64 Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 | 4.6.0 NVIDIA 556.12 **Blender Version** Broken: 4.2.0 `main` 2024-06-01 `dbc842b21e7d` Broken: 4.2.0, `release` 2024-07-16 `a51f293548ad` Broken: 4.3.0 `main` 2024-07-17 `0b70a9edc56b` Worked: unknown Change came with 0fd8f29e883de93dc38282f96a8c3dc04c222866 **Short description of error** Purge Unused crashes if mouse not moved away from popup before confirm delete with enter key ``` # Blender 4.2.0, Commit date: 2024-07-16 06:20, Hash a51f293548ad bpy.data.window_managers["WinMan"]. = False # Property No orphaned data-blocks to purge # Info # backtrace Exception Record: ExceptionCode : EXCEPTION_ACCESS_VIOLATION Exception Address : 0x00007FF76D73AFF6 Exception Module : blender.exe Exception Flags : 0x00000000 Exception Parameters : 0x2 Parameters[0] : 0x0000000000000000 Parameters[1] : 0x0000000000000010 ``` Not fluent in Python but isn't there supposed to be something after dot at `bpy.data.window_managers["WinMan"].` ? **Exact steps for others to reproduce the error** Default startup 1. Access **Purge Unused** menu with mouse 2. Keep mouse inside popup 3. Confirm delete with `Enter` Using `D` key does not cause a crash.
Andrea-Lanaro added the
Type
Report
Severity
Normal
Status
Needs Triage
labels 2024-07-18 19:23:02 +02:00
Iliya Katushenock added the
Interest
User Interface
label 2024-07-18 20:19:32 +02:00
YimingWu added
Module
User Interface
Status
Confirmed
and removed
Status
Needs Triage
labels 2024-07-19 05:48:33 +02:00
Member

Crashed in ui_apply_but_funcs_after. Looks like after.popup_op is invalid when pressing enter. Seems that it should be assigned an operator, but if there's no extra event, the previously assigned operator is deleted after initial invoking (I think) and the address is still referencing the old operator instance.

Crashed in `ui_apply_but_funcs_after`. Looks like `after.popup_op` is invalid when pressing enter. Seems that it should be assigned an operator, but if there's no extra event, the previously assigned operator is deleted after initial invoking (I think) and the address is still referencing the old operator instance.
Andrea-Lanaro changed title from Purge Unused crashes if mouse not moved before confirm delete with enter key to Purge Unused crashes if mouse not moved away from popup before confirm delete with enter key 2024-07-19 07:47:01 +02:00
Member

Prefer if crashes are always set to High priority

Prefer if crashes are always set to High priority
Philipp Oeser added
Severity
High
and removed
Severity
Normal
labels 2024-07-19 09:27:31 +02:00
Member

Change came with 0fd8f29e88

CC @mont29 (even though I assume this is more for #UserInterface to fix)

Seems to be a problem with the rare combination of WM_operator_props_dialog_popup with an operator that has a check callback ?

Change came with 0fd8f29e883de93dc38282f96a8c3dc04c222866 CC @mont29 (even though I assume this is more for #UserInterface to fix) Seems to be a problem with the rare combination of `WM_operator_props_dialog_popup` with an operator that has a `check` callback ?
Member

Some further inspection: we are actually handling two buttons here : the operator button as well as the toggle button for one of the options (if the mouse happens to be over that button as well)

Some further inspection: we are actually handling two buttons here : the operator button as well as the toggle button for one of the options (if the mouse happens to be over that button as well)
Member

In order to not handle other buttons (in case we are executing the UI_BUT_ACTIVE_DEFAULT one via ENTER), we could simply do the following

diff --git a/source/blender/editors/interface/interface_handlers.cc b/source/blender/editors/interface/interface_handlers.cc
index 2ae97c181cf..3e78798c647 100644
--- a/source/blender/editors/interface/interface_handlers.cc
+++ b/source/blender/editors/interface/interface_handlers.cc
@@ -11105,6 +11105,7 @@ static int ui_handle_menu_event(bContext *C,
         if ((but_default != nullptr) && (but_default->active == nullptr)) {
           if (but_default->type == UI_BTYPE_BUT) {
             UI_but_execute(C, region, but_default);
+            retval = WM_UI_HANDLER_BREAK;
           }
           else {
             ui_handle_button_activate_by_type(C, region, but_default);

That would prevent us going into the operator check callback with an operator that has been (at least partially) been freed

In order to not handle other buttons (in case we are executing the `UI_BUT_ACTIVE_DEFAULT` one via ENTER), we could simply do the following ```C diff --git a/source/blender/editors/interface/interface_handlers.cc b/source/blender/editors/interface/interface_handlers.cc index 2ae97c181cf..3e78798c647 100644 --- a/source/blender/editors/interface/interface_handlers.cc +++ b/source/blender/editors/interface/interface_handlers.cc @@ -11105,6 +11105,7 @@ static int ui_handle_menu_event(bContext *C, if ((but_default != nullptr) && (but_default->active == nullptr)) { if (but_default->type == UI_BTYPE_BUT) { UI_but_execute(C, region, but_default); + retval = WM_UI_HANDLER_BREAK; } else { ui_handle_button_activate_by_type(C, region, but_default); ``` That would prevent us going into the operator `check` callback with an operator that has been (at least partially) been freed
Member

Possible fix is up, see !125085

Possible fix is up, see !125085
Philipp Oeser self-assigned this 2024-07-22 09:04:49 +02:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-07-22 11:43:30 +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
Code Documentation
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#125006
No description provided.