OSX/Win Blender 2.93.6, 3.0, 3.1 crashes/"breaks" when starting modal operator from a popover if header is hidden #93410

Closed
opened 2021-11-26 19:39:13 +01:00 by jon denning · 11 comments
Member

System Information
Operating system: OSX 11.6 / Windows 10
Graphics card: Apple M1 / Unspecified (running VM on paperspace.com)

Blender Version
Broken: OSX Blender 2.93.6, OSX and Windows builds of Blender 3.0.0 beta (56b068a664, build 2021-11-24) and Blender 3.1.0 alpha (72acce43bc, build 2021-11-24)
Worked: OSX and Windows builds of Blender 2.93.4, Linux builds of Blender 2.93.6, 3.0.0 beta, and 3.1.0 alpha

Short description of error
On OSX and Windows, Blender 3.0.0 will crash and Blender 3.1.0 will crash or "break" when starting a modal operator from a popover once header is hidden. This also happens OSX 2.93.6 (not 2.93.4). This does not happen in Linux 2.93.6, 3.0.0 beta, or 3.1.0 alpha, or OSX 2.93.4.

Exact steps for others to reproduce the error
Run the attached script to register an operator and panel. An operator and popover panel is drawn in 3D view to right of Object.

panelbreak.py

Clicking on the checkmark icon will invoke the operator, and all works as expected. Specifically:

  • the 3d view header is hidden
  • the operator runs modal (text is written to terminal to show nothing is frozen)
  • MMB will pass through, allowing view to rotate
  • RMB or ESC will finish the operator, where header is reshown
  • all other events are absorbed and ignored

Running operator from search works exactly as expected, too.

However, clicking on the Breaking Test operator with X icon under the Break Test popover will cause issues.

  • OSX 3.0.0 beta and Windows 3.0.0 beta will crash immediately after returning {'RUNNING_MODAL'}
  • OSX 3.1.0 alpha and Windows 3.1.0 alpha will either crash (same as previous bullet) or "break"

This "break" is weird to describe. The text of popover is still drawn, but incorrectly. And Blender ignores all events that are passed through (MMB no longer works when operator is still running), and Blender ignores all events when the operator finishes (as if it thinks the operator is still running). Note: the operator will receive event data, and it can do stuff with the events, but Blender does not do anything with any events.

If the bpy.context.space_data.show_region_header = False line is commented out, then OSX and Win 3.0.0 and 3.1.0 mostly work correctly, where MMB is passed through to Blender correctly once the popover disappears (requires an additional click).

**System Information** Operating system: OSX 11.6 / Windows 10 Graphics card: Apple M1 / Unspecified (running VM on paperspace.com) **Blender Version** Broken: OSX Blender 2.93.6, OSX and Windows builds of Blender 3.0.0 beta (56b068a6647f, build 2021-11-24) and Blender 3.1.0 alpha (72acce43bc34, build 2021-11-24) Worked: OSX and Windows builds of Blender 2.93.4, Linux builds of Blender 2.93.6, 3.0.0 beta, and 3.1.0 alpha **Short description of error** On OSX and Windows, Blender 3.0.0 will crash and Blender 3.1.0 will crash or "break" when starting a modal operator from a popover once header is hidden. This also happens OSX 2.93.6 (not 2.93.4). This does not happen in Linux 2.93.6, 3.0.0 beta, or 3.1.0 alpha, or OSX 2.93.4. **Exact steps for others to reproduce the error** Run the attached script to register an operator and panel. An operator and popover panel is drawn in 3D view to right of `Object`. [panelbreak.py](https://archive.blender.org/developer/F12323422/panelbreak.py) Clicking on the checkmark icon will invoke the operator, and all works as expected. Specifically: - the 3d view header is hidden - the operator runs modal (text is written to terminal to show nothing is frozen) - MMB will pass through, allowing view to rotate - RMB or ESC will finish the operator, where header is reshown - all other events are absorbed and ignored Running operator from search works exactly as expected, too. However, clicking on the Breaking Test operator with X icon under the Break Test popover will cause issues. - OSX 3.0.0 beta and Windows 3.0.0 beta will crash immediately after returning `{'RUNNING_MODAL'}` - OSX 3.1.0 alpha and Windows 3.1.0 alpha will either crash (same as previous bullet) or "break" This "break" is weird to describe. The text of popover is still drawn, but incorrectly. And Blender ignores all events that are passed through (MMB no longer works when operator is still running), and Blender ignores all events when the operator finishes (as if it thinks the operator is still running). Note: the operator will receive event data, and it can do stuff with the events, but Blender does not do anything with any events. If the `bpy.context.space_data.show_region_header = False` line is commented out, then OSX and Win 3.0.0 and 3.1.0 mostly work correctly, where MMB is passed through to Blender correctly once the popover disappears (requires an additional click).
Author
Member

Added subscriber: @gfxcoder

Added subscriber: @gfxcoder

Added subscriber: @Memento

Added subscriber: @Memento
Author
Member

Adding to the very last item (commenting out the show_region_header = False line): I did figure out that passing through the MOUSEMOVE events will allow the popover to disappear once the mouse moves off of the panel (does not require an additional click).

Perhaps there are pointers to popover UI stuff that become invalid when hiding the header, but because Blender still thinks the popover is hovered (mouse hasn't yet moved off popover panel) it crashes when it tries to draw / do something with the now invalid pointers?

Adding to the very last item (commenting out the `show_region_header = False` line): I did figure out that passing through the `MOUSEMOVE` events will allow the popover to disappear once the mouse moves off of the panel (does not require an additional click). Perhaps there are pointers to popover UI stuff that become invalid when hiding the header, but because Blender still thinks the popover is hovered (mouse hasn't yet moved off popover panel) it crashes when it tries to draw / do something with the now invalid pointers?
Author
Member

(edited to move OSX report to attached file)

Ok. This version of the code has the following changes:

  • Does not automatically hide header when modal operator is started
  • When modal op is running, pressing H will toggle the visibility of header

panelbreak.py

Here are the ways to run:

If run operator directly either through search or clicking on operator button directly from header (with Checkmark icon; not through the popover panel), all runs as expected. H will show/hide header. MIDDLEMOUSE passes through. ESC/RIGHTMOUSE will end modal. All is good.

If clicking on the operator under the panel (with X icon), the panel continues to be drawn until the mouse moves off panel. If you move mouse away (and panel is hidden), everything works as expected (same as above).

If you start the operator under the panel (with X icon) but press 'H' WITHOUT moving the mouse off panel first, the header hides away and the operator continues as normal, HOWEVER the popover panel continues to be drawn and the MIDDLEMOUSE is not handled by Blender when it is passed through. Furthermore, when you quit the operator (ESC/RIGHTMOUSE), the operator finishes, but Blender is just stuck. No events cause Blender do really do anything. The only exception is when you go to close Blender, the "Save changes before closing" warning shows, and the Blender crashes once you OK through the exit dialog.

Here's the report: osx_report

(edited to move OSX report to attached file) Ok. This version of the code has the following changes: - Does not automatically hide header when modal operator is started - When modal op is running, pressing `H` will toggle the visibility of header [panelbreak.py](https://archive.blender.org/developer/F12662987/panelbreak.py) Here are the ways to run: If run operator directly either through search or clicking on operator button directly from header (with Checkmark icon; not through the popover panel), all runs as expected. `H` will show/hide header. `MIDDLEMOUSE` passes through. `ESC`/`RIGHTMOUSE` will end modal. All is good. If clicking on the operator under the panel (with X icon), the panel continues to be drawn until the mouse moves off panel. If you move mouse away (and panel is hidden), everything works as expected (same as above). If you start the operator under the panel (with X icon) but press 'H' WITHOUT moving the mouse off panel first, the header hides away and the operator continues as normal, HOWEVER the popover panel continues to be drawn and the `MIDDLEMOUSE` is not handled by Blender when it is passed through. Furthermore, when you quit the operator (`ESC`/`RIGHTMOUSE`), the operator finishes, but Blender is just stuck. No events cause Blender do really do anything. The only exception is when you go to close Blender, the "Save changes before closing" warning shows, and the Blender crashes once you OK through the exit dialog. Here's the report: [osx_report](https://archive.blender.org/developer/F12663212/osx_report)

Added subscriber: @JonathanLampel-4

Added subscriber: @JonathanLampel-4

Added subscriber: @dfelinto

Added subscriber: @dfelinto

This issue was referenced by 8f69c91408

This issue was referenced by 8f69c914080a7fe9555f7126362f08c368a8069d

Changed status from 'Needs Triage' to: 'Resolved'

Changed status from 'Needs Triage' to: 'Resolved'
Campbell Barton self-assigned this 2021-12-02 06:09:36 +01:00
Author
Member

Thanks @ideasman42!

Thanks @ideasman42!
Author
Member

@ideasman42: I just tested this again in Blender 4.0.2, Blender 4.1.0 beta (2024.02.24), and Blender 4.2.0 alpha (2024.02.24), and this issue still breaks Blender UI. (tested on linux builds)

To reproduce: follow directions in #93410 (comment)

@ideasman42: I just tested this again in Blender 4.0.2, Blender 4.1.0 beta (2024.02.24), and Blender 4.2.0 alpha (2024.02.24), and this issue still breaks Blender UI. (tested on linux builds) To reproduce: follow directions in https://projects.blender.org/blender/blender/issues/93410#issuecomment-172905
Blender Bot added
Status
Needs Triage
and removed
Status
Resolved
labels 2024-02-24 20:01:49 +01:00

The issue remained with region overlap enabled (animated hide), fixed: 9795c432e1.

The issue remained with region overlap enabled (animated hide), fixed: 9795c432e1cb65bf17e154478252f6d266d79afa.
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2024-02-27 10:52:37 +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
6 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#93410
No description provided.