bmesh.types.Bmesh.faces.sort() crashes blender on windows only #51072
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#51072
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Windows 7 Enterprise 64 bit
Blender Version
Works Blender 2.75a 64 bit official windows build
Broken Blender 2.78c 64 bit official windows build
Short description of error
According to blender python documentation you can assign the index of each face in a bmesh a value and then later use those values to sort the faces.
See
https:*docs.blender.org/api/2.78b/bmesh.types.html#bmesh.types.BMFace.index And https:*docs.blender.org/api/2.78b/bmesh.types.html#bmesh.types.BMFaceSeq.sort
In the file this_file_crashes.blend is a script, run_me. It assigns each face in a subdivided cube a unique, non-negative index. After calling bmesh.types.Bmesh.faces.sort() blender crashes with the message:
This error has been reproduced on 4 separate windows systems. Several linux machines have been tested but the error does not occur there.
Steps to reproduce
Also
Finally
this_file_crashes.blend
this_file_does_not_crash.blend
The only difference between the scripts in the two blend files is the call to bmesh.types.Bmesh.faces.sort()
Changed status to: 'Open'
Added subscriber: @gbantle-3
Added subscriber: @mano-wii
Interesting that when putting
del(face)
beforebm.faces.sort()
, the crash does not occur.This implies that bm.free() does not invalidate the previously referenced faces. And the dealloc tries to read a self->bm that no longer exists.
That makes sense. Could this be the source of the problem?
in bmesh_mesh.c at line 1636.
It looks to me like that might be where the python face is copied over to a new one after the sort and left dangling.
Yes you are right. And it seems to be related to
9304df5182
The reference of a pyobject may be being overwritten in
bm_mesh_remap_cd_update
and set to NULL :\@ideasman42 Here is a possible solution -> D2587
Added subscriber: @SteffenD
This issue was referenced by
d097c2a1b3
Changed status from 'Open' to: 'Resolved'