Certain operators (relying on context region) crash when called with INVOKE_AREA
/ EXEC_AREA
#98491
Labels
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#98491
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2080 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.96
Blender Version
Broken: version: 3.2.0 Beta, branch: master, commit date: 2022-05-26 13:12, hash:
bf53956914
Worked: --
Short description of the error
Certain operators (relying on context region) crash when called with
INVOKE_AREA
/EXEC_AREA
Steps to reproduce
execute this in blenders python console
So the reason for the crash is that an operator is invoked with INVOKE_AREA here (it does not crash with INVOKE_DEFAULT or any other Execution Context -- except for EXEC_AREA, same thing applies for that one, see below)
If
INVOKE_AREA
orEXEC_AREA
is used, the region gets removed from context, seeOperators relying on / using region (e.g. via CTX_wm_region) can easily crash then.
Of course we could guard against this with a simple check (and this is done in a couple of places), not sure though if this is the smartest thing to do -- since there are many, many operators that would need the extra treatment...)
Original report
This script is use to check the active material, it can be run correct in the main window, but not popup window(change the pref window to node editor)
Exact steps for others to reproduce the error
#98491.blend
Added subscriber: @1029910278
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Needs User Info'
I am getting the wrong context, but no crash.
To avoid the context error, I think you need to set the nodetree explicitly?
So:
This comment was removed by @1029910278
setting the node tree will be directly crash
area.spaces- [x].node_tree = bpy.context.object.active_material.node_tree
test1.crash.txt
previous crash
blender.crash.txt
Changed status from 'Needs User Info' to: 'Needs Triage'
Changed status from 'Needs Triage' to: 'Confirmed'
So the reason for the crash is that
bpy.ops.node.view_all
is invoked withINVOKE_AREA
here (it does not crash withINVOKE_DEFAULT
or any other Execution Context -- except forEXEC_AREA
, same thing applies for that one, see below)@1029910278 : is there any particular reason you are using
INVOKE_AREA
here?If
INVOKE_AREA
orEXEC_AREA
is used, the region gets removed from context, seeOperators relying on / using region (e.g. via
CTX_wm_region
) cn easily crash then.Of course we could guard against this with a simple check (and this is done in a couple of places), not sure though if this is the smartest thing to do -- since there are many, many operators that would need the extra treatment...)
popup window call operator will crash blenderto Certain operators (relying on context region) crash when called with `INVOKE_AREA` / `EXEC_AREA`Will raise prio (for @ideasman42 to consider lowering again) since it is a crasher
Probably these should just not exist, I can't think of a good purpose for them. They could probably be made to behave like
EXEC_REGION_WIN
andINVOKE_REGION_WIN
and deprecated. But someone needs to check the few places we do use them and see if that change would cause any problems.Even if
INVOKE_AREA
/EXEC_AREA
are removed, the crashes will still exist since it's possible for the context's region to be null.Another issue is the region might be set but not the desired type, so an operator may expect the window region but have a toolbar region, while it might not crash it's not going to work properly.
So AFAICS the operators poll function or the operators internal logic should be fixed either way.