bmesh.ops.triangulate causes crash #51730

Closed
opened 2017-06-07 01:55:47 +02:00 by Matthew Trescott · 11 comments

System Information
Arch Linux 64-bit
GPU: Radeon HD 3200
(Triple buffering enabled to work around flickering for Linux versions)

Blender Version
Broken:

  • 2.78c—Date: 2017-02-24 14:33—Hash: e92f2352830—Branch: mkpkg (distribution package)
  • 2.78—Date: 2017-06-05 06:09—Hash: 81d7ff8476 (from builder.blender.org with & without software GL)
  • 2.78c—Date: 2017-02-24 14:33—Hash: e92f235283 (Windows x64 via Wine Compatibility Layer)

Using bmesh.ops.triangulate seems to cause a crash (see instructions below).
Here is the backtrace from the builder.blender.org version:

(gdb) run
Starting program: /home/matthewtrescott/Downloads/blender-2.78-81d7ff84769-linux-glibc219-x86_64/blender 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff38e2700 (LWP 5951)]
[New Thread 0x7ffff30e1700 (LWP 5952)]
[New Thread 0x7ffff28e0700 (LWP 5953)]
[New Thread 0x7ffff20df700 (LWP 5954)]
Read prefs: /home/matthewtrescott/.config/blender/2.78/config/userpref.blend
[New Thread 0x7fffee984700 (LWP 5957)]
[Thread 0x7fffee984700 (LWP 5957) exited]
[New Thread 0x7fffee984700 (LWP 5958)]
[New Thread 0x7ffff4d33700 (LWP 5959)]
[New Thread 0x7fffddbff700 (LWP 5961)]
[Thread 0x7fffddbff700 (LWP 5961) exited]
[New Thread 0x7fffd5ba5700 (LWP 5963)]
[New Thread 0x7fffd4b66700 (LWP 5964)]
found bundled python: /home/matthewtrescott/Downloads/blender-2.78-81d7ff84769-linux-glibc219-x86_64/2.78/python
[New Thread 0x7fffd1bae700 (LWP 5965)]
[New Thread 0x7fffd13ad700 (LWP 5966)]
[New Thread 0x7fffd0bac700 (LWP 5967)]
[New Thread 0x7fffcf69f700 (LWP 5985)]
[Thread 0x7fffcf69f700 (LWP 5985) exited]
Info: Total files 0 | Changed 0 | Failed 0

Thread 1 "blender" received signal SIGSEGV, Segmentation fault.
0x00000000012d1a17 in BM_face_at_index ()
(gdb) bt
- 0  0x00000000012d1a17 in BM_face_at_index ()
- 1  0x0000000000e06edd in draw_dm_faces_sel__setDrawOptions ()
- 2  0x0000000001448011 in emDM_drawMappedFaces ()
- 3  0x0000000000e088d3 in draw_dm_faces_sel.isra ()
- 4  0x0000000000e110bf in draw_em_fancy ()
- 5  0x0000000000e194fc in draw_object ()
- 6  0x0000000000de655f in ED_view3d_draw_depth ()
- 7  0x0000000000deefdd in ED_view3d_autodist ()
- 8  0x0000000000def392 in ED_view3d_cursor3d_position ()
- 9  0x0000000000def463 in ED_view3d_cursor3d_update ()
- 10 0x0000000000def58d in view3d_cursor3d_invoke ()
- 11 0x0000000000d13951 in wm_operator_invoke ()
- 12 0x0000000000d14ced in wm_handler_operator_call ()
- 13 0x0000000000d15178 in wm_handlers_do_intern ()
- 14 0x0000000000d15608 in wm_handlers_do ()
- 15 0x0000000000d15af5 in wm_event_do_handlers ()
- 16 0x0000000000d0cd08 in WM_main ()
- 17 0x0000000000cccfa0 in main ()

Exact steps for others to reproduce the error
Running the following commands in the Python console in the attached .blend will cause Blender to crash as soon as you click on the window:

import bmesh;
cur_mesh = bmesh.from_edit_mesh(bpy.context.active_object.data);
cur_face = cur_mesh.faces[0];
bmesh.ops.triangulate(cur_mesh, faces = [cur_face]);

bug.blend

**System Information** Arch Linux 64-bit GPU: Radeon HD 3200 (Triple buffering enabled to work around flickering for Linux versions) **Blender Version** Broken: - 2.78c—Date: 2017-02-24 14:33—Hash: e92f2352830—Branch: mkpkg (distribution package) - 2.78—Date: 2017-06-05 06:09—Hash: 81d7ff84769 (from builder.blender.org with & without software GL) - 2.78c—Date: 2017-02-24 14:33—Hash: e92f235283 (Windows x64 via Wine Compatibility Layer) Using bmesh.ops.triangulate seems to cause a crash (see instructions below). Here is the backtrace from the builder.blender.org version: ``` (gdb) run Starting program: /home/matthewtrescott/Downloads/blender-2.78-81d7ff84769-linux-glibc219-x86_64/blender [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". [New Thread 0x7ffff38e2700 (LWP 5951)] [New Thread 0x7ffff30e1700 (LWP 5952)] [New Thread 0x7ffff28e0700 (LWP 5953)] [New Thread 0x7ffff20df700 (LWP 5954)] Read prefs: /home/matthewtrescott/.config/blender/2.78/config/userpref.blend [New Thread 0x7fffee984700 (LWP 5957)] [Thread 0x7fffee984700 (LWP 5957) exited] [New Thread 0x7fffee984700 (LWP 5958)] [New Thread 0x7ffff4d33700 (LWP 5959)] [New Thread 0x7fffddbff700 (LWP 5961)] [Thread 0x7fffddbff700 (LWP 5961) exited] [New Thread 0x7fffd5ba5700 (LWP 5963)] [New Thread 0x7fffd4b66700 (LWP 5964)] found bundled python: /home/matthewtrescott/Downloads/blender-2.78-81d7ff84769-linux-glibc219-x86_64/2.78/python [New Thread 0x7fffd1bae700 (LWP 5965)] [New Thread 0x7fffd13ad700 (LWP 5966)] [New Thread 0x7fffd0bac700 (LWP 5967)] [New Thread 0x7fffcf69f700 (LWP 5985)] [Thread 0x7fffcf69f700 (LWP 5985) exited] Info: Total files 0 | Changed 0 | Failed 0 Thread 1 "blender" received signal SIGSEGV, Segmentation fault. 0x00000000012d1a17 in BM_face_at_index () (gdb) bt - 0 0x00000000012d1a17 in BM_face_at_index () - 1 0x0000000000e06edd in draw_dm_faces_sel__setDrawOptions () - 2 0x0000000001448011 in emDM_drawMappedFaces () - 3 0x0000000000e088d3 in draw_dm_faces_sel.isra () - 4 0x0000000000e110bf in draw_em_fancy () - 5 0x0000000000e194fc in draw_object () - 6 0x0000000000de655f in ED_view3d_draw_depth () - 7 0x0000000000deefdd in ED_view3d_autodist () - 8 0x0000000000def392 in ED_view3d_cursor3d_position () - 9 0x0000000000def463 in ED_view3d_cursor3d_update () - 10 0x0000000000def58d in view3d_cursor3d_invoke () - 11 0x0000000000d13951 in wm_operator_invoke () - 12 0x0000000000d14ced in wm_handler_operator_call () - 13 0x0000000000d15178 in wm_handlers_do_intern () - 14 0x0000000000d15608 in wm_handlers_do () - 15 0x0000000000d15af5 in wm_event_do_handlers () - 16 0x0000000000d0cd08 in WM_main () - 17 0x0000000000cccfa0 in main () ``` **Exact steps for others to reproduce the error** Running the following commands in the Python console in the attached .blend will cause Blender to crash as soon as you click on the window: ``` import bmesh; cur_mesh = bmesh.from_edit_mesh(bpy.context.active_object.data); cur_face = cur_mesh.faces[0]; bmesh.ops.triangulate(cur_mesh, faces = [cur_face]); ``` [bug.blend](https://archive.blender.org/developer/F624393/bug.blend)

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @MTres19

Added subscriber: @MTres19

Added subscriber: @FloridaJo

Added subscriber: @FloridaJo

crash file from osx.

bug.crash.txt

crash file from osx. [bug.crash.txt](https://archive.blender.org/developer/F623667/bug.crash.txt)

Added subscriber: @matali23

Added subscriber: @matali23

I can confirm the crash on Windows 7 x64 with latest master, but please reatach the .blend with the script in text editor. And add "import bpy" at the top for other to test out without manual work.

I can confirm the crash on Windows 7 x64 with latest master, but please reatach the .blend with the script in text editor. And add "import bpy" at the top for other to test out without manual work.

I updated the .blend as you requested.

I updated the .blend as you requested.

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2017-06-08 09:41:12 +02:00

No bug here, you need to update edit mesh after you changed it in bmesh, correct and working script:

import bpy
import bmesh
cur_mesh = bmesh.from_edit_mesh(bpy.context.active_object.data)
cur_face = cur_mesh.faces[0]
bmesh.ops.triangulate(cur_mesh, faces = [cur_face])
bmesh.update_edit_mesh(bpy.context.active_object.data, tessface=True, destructive=True)
No bug here, you need to update edit mesh after you changed it in bmesh, correct and working script: ```lang=python import bpy import bmesh cur_mesh = bmesh.from_edit_mesh(bpy.context.active_object.data) cur_face = cur_mesh.faces[0] bmesh.ops.triangulate(cur_mesh, faces = [cur_face]) bmesh.update_edit_mesh(bpy.context.active_object.data, tessface=True, destructive=True) ```

@mont29 Ah, thank you, and sorry for the inconvenience.

@mont29 Ah, thank you, and sorry for the inconvenience.
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#51730
No description provided.