Crash on calling bpy.ops.mesh.loopcut in python script #103710

Open
opened 2023-01-07 05:51:30 +01:00 by Sergey Trifonov · 9 comments

System Information
Operation system: macOS BigSur 11.6 (20G165)
Apple M1

Blender Version
Version 3.4.1 (3.4.1 2022-12-20)

Short description of error
Blender crashes in background mode when you are calling bpy.ops.mesh.loopcut with overridden context

Exact steps for others to reproduce the error
Run Blender from cli with args:
/path/to/bin --background --python bug.py
bug.py

**System Information** Operation system: macOS BigSur 11.6 (20G165) Apple M1 **Blender Version** Version 3.4.1 (3.4.1 2022-12-20) **Short description of error** Blender crashes in background mode when you are calling bpy.ops.mesh.loopcut with overridden context **Exact steps for others to reproduce the error** Run Blender from cli with args: /path/to/bin --background --python bug.py [bug.py](https://archive.blender.org/developer/F14130103/bug.py)

Added subscriber: @keepInDry

Added subscriber: @keepInDry
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

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

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

Thanks for the report. Can confirm the crash

Stack trace:
blender.exe         :0x00007FF7CD0BF1C0  GPU_viewport C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\gpu\intern\gpu_state.cc:195
blender.exe         :0x00007FF7CC152AD0  wmViewport C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\windowmanager\intern\wm_subwindow.c:27
blender.exe         :0x00007FF7CCDE68F0  view3d_operator_needs_opengl C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\editors\space_view3d\view3d_utils.c:181
blender.exe         :0x00007FF7CCB10420  loopcut_init C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\editors\mesh\editmesh_loopcut.c:402
blender.exe         :0x00007FF7CC12F7F0  wm_operator_invoke C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\windowmanager\intern\wm_event_system.cc:1486
blender.exe         :0x00007FF7CC12EE70  wm_operator_call_internal C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\windowmanager\intern\wm_event_system.cc:1707
blender.exe         :0x00007FF7CC131B60  WM_operator_call_py C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\windowmanager\intern\wm_event_system.cc:1782
blender.exe         :0x00007FF7CC875870  pyop_call C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\python\intern\bpy_operator.c:307
python310.dll       :0x00007FF814290130  PyCFunction_GetFlags
python310.dll       :0x00007FF81424BA20  PyObject_MakeTpCall
python310.dll       :0x00007FF814360A50  PyEval_GetFuncDesc
python310.dll       :0x00007FF81435A3A0  PyEval_EvalFrameDefault
python310.dll       :0x00007FF81435A3A0  PyEval_EvalFrameDefault
python310.dll       :0x00007FF81424BED0  PyFunction_Vectorcall
python310.dll       :0x00007FF81424B890  PyObject_FastCallDictTstate
python310.dll       :0x00007FF81424C0E0  PyObject_Call_Prepend
python310.dll       :0x00007FF8142B60A0  PyType_Ready
python310.dll       :0x00007FF81424BA20  PyObject_MakeTpCall
python310.dll       :0x00007FF814360A50  PyEval_GetFuncDesc
python310.dll       :0x00007FF81435A3A0  PyEval_EvalFrameDefault
python310.dll       :0x00007FF81435A3A0  PyEval_EvalFrameDefault
python310.dll       :0x00007FF81435A130  PyEval_EvalCode
python310.dll       :0x00007FF81434B280  PyWarnings_Init
python310.dll       :0x00007FF814290130  PyCFunction_GetFlags
python310.dll       :0x00007FF8143587F0  PyOS_URandomNonblock
python310.dll       :0x00007FF814360A50  PyEval_GetFuncDesc
python310.dll       :0x00007FF81435A3A0  PyEval_EvalFrameDefault
python310.dll       :0x00007FF81435A3A0  PyEval_EvalFrameDefault
python310.dll       :0x00007FF8143D2160  PyRun_FileExFlags
python310.dll       :0x00007FF8143D2160  PyRun_FileExFlags
python310.dll       :0x00007FF8143D1FC0  PyRun_StringFlags
blender.exe         :0x00007FF7CC85C5D0  python_script_exec C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\python\intern\bpy_interface_run.c:183
blender.exe         :0x00007FF7CC85C1A0  BPY_run_filepath C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\python\intern\bpy_interface_run.c:230
blender.exe         :0x00007FF7CC1172F0  arg_handle_python_file_run C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\creator\creator_args.c:1831
blender.exe         :0x00007FF7CD1D2120  BLI_args_parse C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\blenlib\intern\BLI_args.c:295
blender.exe         :0x00007FF7CC115240  main C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\creator\creator.c:557
blender.exe         :0x00007FF7CD32B3D4  __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
KERNEL32.DLL        :0x00007FF87B275590  BaseThreadInitThunk
ntdll.dll           :0x00007FF87C0C4830  RtlUserThreadStart```
Thanks for the report. Can confirm the crash ```lines=10 Stack trace: blender.exe :0x00007FF7CD0BF1C0 GPU_viewport C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\gpu\intern\gpu_state.cc:195 blender.exe :0x00007FF7CC152AD0 wmViewport C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\windowmanager\intern\wm_subwindow.c:27 blender.exe :0x00007FF7CCDE68F0 view3d_operator_needs_opengl C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\editors\space_view3d\view3d_utils.c:181 blender.exe :0x00007FF7CCB10420 loopcut_init C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\editors\mesh\editmesh_loopcut.c:402 blender.exe :0x00007FF7CC12F7F0 wm_operator_invoke C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\windowmanager\intern\wm_event_system.cc:1486 blender.exe :0x00007FF7CC12EE70 wm_operator_call_internal C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\windowmanager\intern\wm_event_system.cc:1707 blender.exe :0x00007FF7CC131B60 WM_operator_call_py C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\windowmanager\intern\wm_event_system.cc:1782 blender.exe :0x00007FF7CC875870 pyop_call C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\python\intern\bpy_operator.c:307 python310.dll :0x00007FF814290130 PyCFunction_GetFlags python310.dll :0x00007FF81424BA20 PyObject_MakeTpCall python310.dll :0x00007FF814360A50 PyEval_GetFuncDesc python310.dll :0x00007FF81435A3A0 PyEval_EvalFrameDefault python310.dll :0x00007FF81435A3A0 PyEval_EvalFrameDefault python310.dll :0x00007FF81424BED0 PyFunction_Vectorcall python310.dll :0x00007FF81424B890 PyObject_FastCallDictTstate python310.dll :0x00007FF81424C0E0 PyObject_Call_Prepend python310.dll :0x00007FF8142B60A0 PyType_Ready python310.dll :0x00007FF81424BA20 PyObject_MakeTpCall python310.dll :0x00007FF814360A50 PyEval_GetFuncDesc python310.dll :0x00007FF81435A3A0 PyEval_EvalFrameDefault python310.dll :0x00007FF81435A3A0 PyEval_EvalFrameDefault python310.dll :0x00007FF81435A130 PyEval_EvalCode python310.dll :0x00007FF81434B280 PyWarnings_Init python310.dll :0x00007FF814290130 PyCFunction_GetFlags python310.dll :0x00007FF8143587F0 PyOS_URandomNonblock python310.dll :0x00007FF814360A50 PyEval_GetFuncDesc python310.dll :0x00007FF81435A3A0 PyEval_EvalFrameDefault python310.dll :0x00007FF81435A3A0 PyEval_EvalFrameDefault python310.dll :0x00007FF8143D2160 PyRun_FileExFlags python310.dll :0x00007FF8143D2160 PyRun_FileExFlags python310.dll :0x00007FF8143D1FC0 PyRun_StringFlags blender.exe :0x00007FF7CC85C5D0 python_script_exec C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\python\intern\bpy_interface_run.c:183 blender.exe :0x00007FF7CC85C1A0 BPY_run_filepath C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\python\intern\bpy_interface_run.c:230 blender.exe :0x00007FF7CC1172F0 arg_handle_python_file_run C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\creator\creator_args.c:1831 blender.exe :0x00007FF7CD1D2120 BLI_args_parse C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\blender\blenlib\intern\BLI_args.c:295 blender.exe :0x00007FF7CC115240 main C:\Users\prati\OneDrive\Desktop\BlenderOSP\blender\source\creator\creator.c:557 blender.exe :0x00007FF7CD32B3D4 __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288 KERNEL32.DLL :0x00007FF87B275590 BaseThreadInitThunk ntdll.dll :0x00007FF87C0C4830 RtlUserThreadStart```
Member

Added subscribers: @mont29, @lichtwerk

Added subscribers: @mont29, @lichtwerk
Member

Changed status from 'Confirmed' to: 'Needs Developer To Reproduce'

Changed status from 'Confirmed' to: 'Needs Developer To Reproduce'
Member

Probably the same as #50160 (loopcut_slide wmSubWindowScissorSet 0: doesn't exist)

In #50160#406927, @mont29 wrote:
This op expects a valid OpenGL context, which does not exists in background mode (or with blender built as a module)…

No bug here, background/module versions of Blender are supposed to be OpenGL-less.

This seems to be no bug, but will leave for module devs to put the final nail in the coffin (or to decide to hand this more gracefully in background mode).

Probably the same as #50160 (loopcut_slide wmSubWindowScissorSet 0: doesn't exist) > In #50160#406927, @mont29 wrote: > This op expects a valid OpenGL context, which does not exists in background mode (or with blender built as a module)… > > No bug here, background/module versions of Blender are supposed to be OpenGL-less. This seems to be no bug, but will leave for module devs to put the final nail in the coffin (or to decide to hand this more gracefully in background mode).

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Reminds me of #84964 (Overriding context crashes when run from command line).
I don't think the drawing functions need to run in background mode in this case.

Reminds me of #84964 (Overriding context crashes when run from command line). I don't think the drawing functions need to run in background mode in this case.
Philipp Oeser removed the
Interest
EEVEE & Viewport
label 2023-02-09 15:11:55 +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
4 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#103710
No description provided.