Blender crashes when using bpy.ops.view3d.view_orbit with a custom context #94471

Open
opened 2021-12-29 20:07:13 +01:00 by Heath Mitchell · 6 comments

System Information
Operating system: Linux-5.15.11-arch2-1-x86_64-with-glibc2.33 64 Bits
Graphics card: AMD RENOIR (DRM 3.42.0, 5.15.11-arch2-1, LLVM 13.0.0) AMD 4.6 (Core Profile) Mesa 21.3.2

Also tested on WIndows:

Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: AMD Radeon(TM) Graphics ATI Technologies Inc. 4.5.14756 Core Profile Context 20.40.32 27.20.14032.8

Blender Version
Broken (Linux): version: 3.0.0, branch: makepkg (modified), commit date: 2021-12-02 18:35, hash: f1cca30557
Broken (Windows): version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: f1cca30557
Worked: Never, the crash happens in 2.7 and 2.6 doesn't seem to support the override thing (I haven't tested subversions)

Short description of error
Blender crashes when using bpy.ops.view3d.view_orbit with a custom context

Exact steps for others to reproduce the error
Run this in the Python console:

area = [n for n in bpy.context.screen.areas if n.type == "VIEW_3D"][0]
override = bpy.context.copy()
override['area'] = area
bpy.ops.view3d.view_orbit(override, type='ORBITLEFT')

blender.crash.txt

**System Information** Operating system: Linux-5.15.11-arch2-1-x86_64-with-glibc2.33 64 Bits Graphics card: AMD RENOIR (DRM 3.42.0, 5.15.11-arch2-1, LLVM 13.0.0) AMD 4.6 (Core Profile) Mesa 21.3.2 Also tested on WIndows: Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: AMD Radeon(TM) Graphics ATI Technologies Inc. 4.5.14756 Core Profile Context 20.40.32 27.20.14032.8 **Blender Version** Broken (Linux): version: 3.0.0, branch: makepkg (modified), commit date: 2021-12-02 18:35, hash: `f1cca30557` Broken (Windows): version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: `f1cca30557` Worked: Never, the crash happens in 2.7 and 2.6 doesn't seem to support the override thing (I haven't tested subversions) **Short description of error** Blender crashes when using `bpy.ops.view3d.view_orbit` with a custom context **Exact steps for others to reproduce the error** Run this in the Python console: ``` area = [n for n in bpy.context.screen.areas if n.type == "VIEW_3D"][0] override = bpy.context.copy() override['area'] = area bpy.ops.view3d.view_orbit(override, type='ORBITLEFT') ``` [blender.crash.txt](https://archive.blender.org/developer/F12780901/blender.crash.txt)
Author

Added subscriber: @circuit10

Added subscriber: @circuit10
Author

I'm not really a C dev, but I assume this is something to do with the pointer in 594f47ecd2/source/blender/editors/space_view3d/view3d_edit.c (L4210) being wrong, I could also have done something wrong in the script (though should you be able to crash Blender from Python without trying?)

I'm not really a C dev, but I assume this is something to do with the pointer in https://github.com/blender/blender/blob/594f47ecd2d5367ca936cf6fc6ec8168c2b360d0/source/blender/editors/space_view3d/view3d_edit.c#L4210 being wrong, I could also have done something wrong in the script (though should you be able to crash Blender from Python without trying?)
Member

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

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123

Added subscriber: @michael64

Added subscriber: @michael64

Thanks @circuit10 for reporting and @PratikPB2123 for confirming.

@circuit10, you are already in the right function that crashes, have a look at rv3d==NULL .
The region looks correct but region->regiondata is NULL so the function crashes here .
If angle would have been M_PI or -M_PI it could have crashed a few lines before.

That is all I can offer right now, there should be no crash but I am not sure if what you are trying to do is supported either.

Thanks @circuit10 for reporting and @PratikPB2123 for confirming. @circuit10, you are already in the right function that crashes, have a look at [rv3d==NULL ](https://github.com/blender/blender/blob/594f47ecd2d5367ca936cf6fc6ec8168c2b360d0/source/blender/editors/space_view3d/view3d_edit.c#L4225;L4232). The region looks correct but region->regiondata is NULL so the function [crashes here ](https://github.com/blender/blender/blob/594f47ecd2d5367ca936cf6fc6ec8168c2b360d0/source/blender/editors/space_view3d/view3d_edit.c#L4232). If angle would have been M_PI or -M_PI it could have crashed a few lines before. That is all I can offer right now, there should be no crash but I am not sure if what you are trying to do is supported either.
Philipp Oeser removed the
Interest
Python API
label 2023-02-10 09:04:28 +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
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#94471
No description provided.