Blender crashes because of python #50190

Closed
opened 2016-12-06 22:49:57 +01:00 by paul geraskin · 13 comments
Member

System Information
Linux

Blender Version
2.78

Short description of error
If I run these lines in the blender's console - blender will crash.
http://pastebin.com/a14wcYPg

LOG:
mifth@mifth:~/Documents/repositories/mifthtools/blender/addons/mifth_tools$ /home/mifth/Documents/soft/blender/blender
Read new prefs: /home/mifth/.config/blender/2.78/config/userpref.blend
found bundled python: /home/mifth/Documents/soft/blender/2.78/python
read blend: /home/mifth/Desktop/tmp/temp1.blend
Writing: /tmp/temp1.crash.txt
Segmentation fault (core dumped)

LOG File:
temp1.crash.txt

Exact steps for others to reproduce the error

  • Open Blender's console
  • Copy and Paste my lines
  • Press Enter in Console
  • Crash
**System Information** Linux **Blender Version** 2.78 **Short description of error** If I run these lines in the blender's console - blender will crash. http://pastebin.com/a14wcYPg LOG: mifth@mifth:~/Documents/repositories/mifthtools/blender/addons/mifth_tools$ /home/mifth/Documents/soft/blender/blender Read new prefs: /home/mifth/.config/blender/2.78/config/userpref.blend found bundled python: /home/mifth/Documents/soft/blender/2.78/python read blend: /home/mifth/Desktop/tmp/temp1.blend Writing: /tmp/temp1.crash.txt Segmentation fault (core dumped) LOG File: [temp1.crash.txt](https://archive.blender.org/developer/F415056/temp1.crash.txt) **Exact steps for others to reproduce the error** - Open Blender's console - Copy and Paste my lines - Press Enter in Console - Crash
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @PaulGeraskin

Added subscriber: @PaulGeraskin

Added subscriber: @VukGardasevic

Added subscriber: @VukGardasevic

For keeping future reference, the code from pastebin is:

new_mesh = bpy.data.meshes.new('wrap')
new_obj = bpy.data.objects.new('wrap', new_mesh)
bpy.context.scene.objects.link(new_obj)
new_obj.data.polygons.add(1)
new_obj.data.update()

I can confirm the issue on win7 64 bit, build 8ce6de3.

Running from the Text Editor also crashes Blender with the EXCEPTION_ACCESS_VIOLATION.

The line that crashes is:

new_obj.data.polygons.add(1)
For keeping future reference, the code from pastebin is: ``` new_mesh = bpy.data.meshes.new('wrap') new_obj = bpy.data.objects.new('wrap', new_mesh) bpy.context.scene.objects.link(new_obj) new_obj.data.polygons.add(1) new_obj.data.update() ``` I can confirm the issue on win7 64 bit, build `8ce6de3`. Running from the Text Editor also crashes Blender with the `EXCEPTION_ACCESS_VIOLATION`. The line that crashes is: ``` new_obj.data.polygons.add(1) ```
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Member

Here's a stack trace

# Blender 2.78 (sub 4), Commit date: 2016-12-05 10:36, Hash 60dae91
bpy.context.area.type = 'TEXT_EDITOR'  # Property
bpy.ops.text.run_script()  # Operator
Python script fail, look in the console for now...  # Error
bpy.context.area.type = 'CONSOLE'  # Property

# backtrace
56: BLI_system_backtrace - 0x4094AF80
55: sig_handle_crash_backtrace - 0x3F5EAF00
54: sig_handle_crash - 0x3F5EAF50
53: windows_exception_handler - 0x3F5EB1D0
52: UnhandledExceptionFilter - 0x77A6B870
51: EtwEventSetInformation - 0x77B78344
50: _C_specific_handler - 0x77B07F6C
49: RtlDecodePointer - 0x77B18FB0
48: RtlUnwindEx - 0x77B08050
47: KiUserExceptionDispatcher - 0x77B3D91A
46: BKE_mesh_calc_edges - 0x404D4DA0
45: ED_mesh_update - 0x3F9F0D80
44: Mesh_update_call - 0x40747210
43: RNA_function_call - 0x4061C700
42: pyrna_func_call - 0x3FD17A40
41: PyObject_Call - 0x1D8BD6B0
40: do_call - 0x1DAAFB10
39: call_function - 0x1DAAEE70
38: PyEval_EvalFrameEx - 0x1DAA3900
37: _PyEval_EvalCodeWithName - 0x1DAADE90
36: PyEval_EvalCodeEx - 0x1DAA3860
35: PyEval_EvalCode - 0x1DAA3820
34: builtin_exec_impl - 0x1DA9ED00
33: builtin_exec - 0x1DA989B0
32: PyCFunction_Call - 0x1D96E540
31: call_function - 0x1DAAEE70
30: PyEval_EvalFrameEx - 0x1DAA3900
29: fast_function - 0x1DAB08F0
28: call_function - 0x1DAAEE70
27: PyEval_EvalFrameEx - 0x1DAA3900
26: _PyEval_EvalCodeWithName - 0x1DAADE90
25: fast_function - 0x1DAB08F0
24: call_function - 0x1DAAEE70
23: PyEval_EvalFrameEx - 0x1DAA3900
22: fast_function - 0x1DAB08F0
21: call_function - 0x1DAAEE70
20: PyEval_EvalFrameEx - 0x1DAA3900
19: fast_function - 0x1DAB08F0
18: call_function - 0x1DAAEE70
17: PyEval_EvalFrameEx - 0x1DAA3900
16: _PyEval_EvalCodeWithName - 0x1DAADE90
15: PyEval_EvalCodeEx - 0x1DAA3860
14: function_call - 0x1D936D90
13: PyObject_Call - 0x1D8BD6B0
12: bpy_class_call - 0x3FD1AF00
11: operator_execute - 0x40634D60
10: wm_operator_invoke - 0x3F606FA0
9: wm_handler_operator_call - 0x3F608090
8: wm_handlers_do_intern - 0x3F608DF0
7: wm_handlers_do - 0x3F609480
6: wm_event_do_handlers - 0x3F603A50
5: WM_main - 0x3F5EBC30
4: main - 0x3F5E47C0
3: __tmainCRTStartup - 0x442F0440
2: mainCRTStartup - 0x442F0660
1: BaseThreadInitThunk - 0x779E59E0
0: RtlUserThreadStart - 0x77B1B810 
Here's a stack trace ``` # Blender 2.78 (sub 4), Commit date: 2016-12-05 10:36, Hash 60dae91 bpy.context.area.type = 'TEXT_EDITOR' # Property bpy.ops.text.run_script() # Operator Python script fail, look in the console for now... # Error bpy.context.area.type = 'CONSOLE' # Property # backtrace 56: BLI_system_backtrace - 0x4094AF80 55: sig_handle_crash_backtrace - 0x3F5EAF00 54: sig_handle_crash - 0x3F5EAF50 53: windows_exception_handler - 0x3F5EB1D0 52: UnhandledExceptionFilter - 0x77A6B870 51: EtwEventSetInformation - 0x77B78344 50: _C_specific_handler - 0x77B07F6C 49: RtlDecodePointer - 0x77B18FB0 48: RtlUnwindEx - 0x77B08050 47: KiUserExceptionDispatcher - 0x77B3D91A 46: BKE_mesh_calc_edges - 0x404D4DA0 45: ED_mesh_update - 0x3F9F0D80 44: Mesh_update_call - 0x40747210 43: RNA_function_call - 0x4061C700 42: pyrna_func_call - 0x3FD17A40 41: PyObject_Call - 0x1D8BD6B0 40: do_call - 0x1DAAFB10 39: call_function - 0x1DAAEE70 38: PyEval_EvalFrameEx - 0x1DAA3900 37: _PyEval_EvalCodeWithName - 0x1DAADE90 36: PyEval_EvalCodeEx - 0x1DAA3860 35: PyEval_EvalCode - 0x1DAA3820 34: builtin_exec_impl - 0x1DA9ED00 33: builtin_exec - 0x1DA989B0 32: PyCFunction_Call - 0x1D96E540 31: call_function - 0x1DAAEE70 30: PyEval_EvalFrameEx - 0x1DAA3900 29: fast_function - 0x1DAB08F0 28: call_function - 0x1DAAEE70 27: PyEval_EvalFrameEx - 0x1DAA3900 26: _PyEval_EvalCodeWithName - 0x1DAADE90 25: fast_function - 0x1DAB08F0 24: call_function - 0x1DAAEE70 23: PyEval_EvalFrameEx - 0x1DAA3900 22: fast_function - 0x1DAB08F0 21: call_function - 0x1DAAEE70 20: PyEval_EvalFrameEx - 0x1DAA3900 19: fast_function - 0x1DAB08F0 18: call_function - 0x1DAAEE70 17: PyEval_EvalFrameEx - 0x1DAA3900 16: _PyEval_EvalCodeWithName - 0x1DAADE90 15: PyEval_EvalCodeEx - 0x1DAA3860 14: function_call - 0x1D936D90 13: PyObject_Call - 0x1D8BD6B0 12: bpy_class_call - 0x3FD1AF00 11: operator_execute - 0x40634D60 10: wm_operator_invoke - 0x3F606FA0 9: wm_handler_operator_call - 0x3F608090 8: wm_handlers_do_intern - 0x3F608DF0 7: wm_handlers_do - 0x3F609480 6: wm_event_do_handlers - 0x3F603A50 5: WM_main - 0x3F5EBC30 4: main - 0x3F5E47C0 3: __tmainCRTStartup - 0x442F0440 2: mainCRTStartup - 0x442F0660 1: BaseThreadInitThunk - 0x779E59E0 0: RtlUserThreadStart - 0x77B1B810 ```

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2016-12-07 16:47:04 +01:00

Sure enough it will crash, you are creating a fully invalid mesh (one polygon without any vert/edge/loop… come on!).

We do not seek to fully prevent API users to create broken data, this would add way too much overweight to the whole py scripting, coders are responsible to write valid code.

Sure enough it will crash, you are creating a fully invalid mesh (one polygon without any vert/edge/loop… come on!). We do not seek to fully prevent API users to create broken data, this would add way too much overweight to the whole py scripting, coders are responsible to write valid code.
Author
Member

I found this bug when I tried to create po0ints and then add a polygon. This code was crashed.
0a5365f142/blender/addons/mira_tools/mi_wrap_master.py (L54-L72)

Is this code incorrect too?
I used this site as reference http://blenderscripting.blogspot.ru/2011/07/adding-faces-to-existing-mesh.html

I found this bug when I tried to create po0ints and then add a polygon. This code was crashed. https://github.com/mifth/mifthtools/blob/0a5365f14202ce4984be84e1e89ac036da757b18/blender/addons/mira_tools/mi_wrap_master.py#L54-L72 Is this code incorrect too? I used this site as reference http://blenderscripting.blogspot.ru/2011/07/adding-faces-to-existing-mesh.html
Author
Member

If I do it wron then give me please correct example to this:

  • create an object
  • add 4 points
  • add a face to these points
  • update object's data without crash.

Thanks.

If I do it wron then give me please correct example to this: - create an object - add 4 points - add a face to these points - update object's data without crash. Thanks.

Suggest you look at Operator Mesh Add python template (embedded in Blender, in Text editor).

Note that you do not have to use BMesh here, but if you stick to regular mesh then you'll have to handle loops yourself when creating polygons (you can also have a look at any import script handling geometry, they also all create meshes…).

Also, please seek user support on user forums like blenderartists.org or blender.stackexchange.com.

Suggest you look at Operator Mesh Add python template (embedded in Blender, in Text editor). Note that you do not *have to* use BMesh here, but if you stick to regular mesh then you'll have to handle loops yourself when creating polygons (you can also have a look at any import script handling geometry, they also all create meshes…). Also, please seek user support on user forums like [blenderartists.org](http:*blenderartists.org/) or [blender.stackexchange.com](http:*blender.stackexchange.com/).
Author
Member

Thanks a lot. Sorry for bothering.

Thanks a lot. Sorry for bothering.
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#50190
No description provided.