Segfault when applying modifier to object copy from python #82555

Closed
opened 2020-11-10 01:05:15 +01:00 by Josef Vanzura · 5 comments

System Information
Operating system: Ubuntu
Graphics card: not relevant

Blender Version
Broken: i tried 2.83.5, 2.83.8, 2.90.1 and 2.92alpha
Worked: 2.81

Short description of error
Crash when trying to apply modifier to mesh

Exact steps for others to reproduce the error

  1. Open blender with default scene.
  2. Add modifier to Cube (tested with bevel, subsurf)
  3. Run this script:
o = bpy.data.objects['Cube']
copy =  o.copy()
mcopy = copy.to_mesh(preserve_all_data_layers=True).copy()
copy.data = mcopy
bpy.context.collection.objects.link(copy)
bpy.context.view_layer.objects.active = copy
for m in copy.modifiers:
    bpy.ops.object.modifier_apply(modifier=m.name)
  1. Crash
**System Information** Operating system: Ubuntu Graphics card: not relevant **Blender Version** Broken: i tried 2.83.5, 2.83.8, 2.90.1 and 2.92alpha Worked: 2.81 **Short description of error** Crash when trying to apply modifier to mesh **Exact steps for others to reproduce the error** 1. Open blender with default scene. 2. Add <you favourite> modifier to Cube (tested with bevel, subsurf) 3. Run this script: ``` o = bpy.data.objects['Cube'] copy = o.copy() mcopy = copy.to_mesh(preserve_all_data_layers=True).copy() copy.data = mcopy bpy.context.collection.objects.link(copy) bpy.context.view_layer.objects.active = copy for m in copy.modifiers: bpy.ops.object.modifier_apply(modifier=m.name) ``` 4. Crash
Author

Added subscriber: @gindar

Added subscriber: @gindar
Author

Here is backtrace (whole crash originally happend in my addon - io_scene_model ...)

# Blender 2.92.0, Commit date: 2020-11-08 15:12, Hash 39012146e142
bpy.ops.object.modifier_apply(modifier="Bevel")  # Operator

# backtrace
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(BLI_system_backtrace+0x20) [0x8500110]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe68d0a]
/lib/x86_64-linux-gnu/libc.so.6(+0x41950) [0x7f8379919950]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(BKE_main_id_tag_listbase+0x30) [0xeb1770]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(BKE_main_id_tag_all+0x52) [0xeb1802]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(BKE_id_delete+0x18) [0xeb3d98]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0x15c9340]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(RNA_function_call+0x12) [0x157d5e2]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0x16a73ff]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyObject_FastCallKeywords+0xd7) [0x71923e7]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5ce93]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalFrameDefault+0x67d1) [0xe63a41]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5bc4b]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5cee5]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalFrameDefault+0x1cb1) [0xe5ef21]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5bc4b]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5cee5]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalFrameDefault+0x4344) [0xe615b4]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5bc4b]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5cee5]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalFrameDefault+0x4344) [0xe615b4]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5bc4b]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5cee5]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalFrameDefault+0x1cb1) [0xe5ef21]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5bc4b]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5cee5]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalFrameDefault+0x1cb1) [0xe5ef21]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalCodeWithName+0x92d) [0x723319d]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyFunction_FastCallDict+0x12f) [0x7191b0f]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyObject_Call_Prepend+0xcd) [0x7192d8d]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(PyObject_Call+0x75) [0x7193f85]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalFrameDefault+0x4e5c) [0xe620cc]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5bc4b]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyFunction_FastCallDict+0x2c8) [0x7191ca8]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0x16a806d]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0x1676715]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0x11e1fcf]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0x11e52f8]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0x11e570c]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(wm_event_do_handlers+0x416) [0x11e5ef6]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(WM_main+0x20) [0x11dcc80]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender(main+0x31e) [0xda372e]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf2) [0x7f8379900cb2]
/home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe656f3]

# Python backtrace
  File "/home/gindar/.config/blender/2.92/scripts/addons/io_scene_model/__init__.py", line 562 in import_data
  File "/home/gindar/.config/blender/2.92/scripts/addons/io_scene_model/__init__.py", line 1124 in export_mesh
  File "/home/gindar/.config/blender/2.92/scripts/addons/io_scene_model/utils.py", line 113 in do_dict_export
  File "/home/gindar/.config/blender/2.92/scripts/addons/io_scene_model/__init__.py", line 952 in do_export
  File "/home/gindar/.config/blender/2.92/scripts/addons/io_scene_model/__init__.py", line 860 in export
  File "/home/gindar/.config/blender/2.92/scripts/addons/io_scene_model/__init__.py", line 780 in save
  File "/home/gindar/.config/blender/2.92/scripts/addons/io_scene_model/__init__.py", line 788 in execute
Here is backtrace (whole crash originally happend in my addon - io_scene_model ...) ``` # Blender 2.92.0, Commit date: 2020-11-08 15:12, Hash 39012146e142 bpy.ops.object.modifier_apply(modifier="Bevel") # Operator # backtrace /home/gindar/blender-2.92.0-39012146e142-linux64/blender(BLI_system_backtrace+0x20) [0x8500110] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe68d0a] /lib/x86_64-linux-gnu/libc.so.6(+0x41950) [0x7f8379919950] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(BKE_main_id_tag_listbase+0x30) [0xeb1770] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(BKE_main_id_tag_all+0x52) [0xeb1802] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(BKE_id_delete+0x18) [0xeb3d98] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0x15c9340] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(RNA_function_call+0x12) [0x157d5e2] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0x16a73ff] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyObject_FastCallKeywords+0xd7) [0x71923e7] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5ce93] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalFrameDefault+0x67d1) [0xe63a41] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5bc4b] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5cee5] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalFrameDefault+0x1cb1) [0xe5ef21] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5bc4b] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5cee5] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalFrameDefault+0x4344) [0xe615b4] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5bc4b] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5cee5] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalFrameDefault+0x4344) [0xe615b4] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5bc4b] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5cee5] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalFrameDefault+0x1cb1) [0xe5ef21] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5bc4b] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5cee5] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalFrameDefault+0x1cb1) [0xe5ef21] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalCodeWithName+0x92d) [0x723319d] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyFunction_FastCallDict+0x12f) [0x7191b0f] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyObject_Call_Prepend+0xcd) [0x7192d8d] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(PyObject_Call+0x75) [0x7193f85] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyEval_EvalFrameDefault+0x4e5c) [0xe620cc] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe5bc4b] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(_PyFunction_FastCallDict+0x2c8) [0x7191ca8] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0x16a806d] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0x1676715] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0x11e1fcf] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0x11e52f8] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0x11e570c] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(wm_event_do_handlers+0x416) [0x11e5ef6] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(WM_main+0x20) [0x11dcc80] /home/gindar/blender-2.92.0-39012146e142-linux64/blender(main+0x31e) [0xda372e] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf2) [0x7f8379900cb2] /home/gindar/blender-2.92.0-39012146e142-linux64/blender() [0xe656f3] # Python backtrace File "/home/gindar/.config/blender/2.92/scripts/addons/io_scene_model/__init__.py", line 562 in import_data File "/home/gindar/.config/blender/2.92/scripts/addons/io_scene_model/__init__.py", line 1124 in export_mesh File "/home/gindar/.config/blender/2.92/scripts/addons/io_scene_model/utils.py", line 113 in do_dict_export File "/home/gindar/.config/blender/2.92/scripts/addons/io_scene_model/__init__.py", line 952 in do_export File "/home/gindar/.config/blender/2.92/scripts/addons/io_scene_model/__init__.py", line 860 in export File "/home/gindar/.config/blender/2.92/scripts/addons/io_scene_model/__init__.py", line 780 in save File "/home/gindar/.config/blender/2.92/scripts/addons/io_scene_model/__init__.py", line 788 in execute ```
Josef Vanzura changed title from Segfault when applying modifier from script to Segfault when applying modifier on object copy from python 2020-11-10 01:07:19 +01:00
Josef Vanzura changed title from Segfault when applying modifier on object copy from python to Segfault when applying modifier to object copy from python 2020-11-10 01:07:46 +01:00

This issue was referenced by 8b59119e10

This issue was referenced by 8b59119e10211da4f9d1dd2aa95c3132cb65e609

This issue was referenced by 476a0d2311

This issue was referenced by 476a0d2311d530d9590cae807ee07fb98b11c6dd

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

Changed status from 'Needs Triage' to: 'Resolved'
Campbell Barton self-assigned this 2020-11-10 07:48:39 +01: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
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
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 & 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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & 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#82555
No description provided.