Blender crashes when dissolving vertices in some situations #37559

Closed
opened 2013-11-21 01:49:17 +01:00 by Voyager Voyager · 12 comments

System Information
Windows 7, 64bit, GeForce GT 555M

Blender Version
Broken: Blender 2.69 r60995
Worked: Blender 2.69 r61240

Short description of error
Blender crashes in some unexpected situations

Exact steps for others to reproduce the error
Open the attached file and

  • click X then Dissolve Vertices - crash (not always)
    if not then
  • pan and rotate view then click X then Dissolve - crash (not always)

I've encountered that it's possible to avoid crash in first situation. Open the file and before dissolving rotate/pan view. It helps in some situations. Vertices leading to crash are red marked.
On the Grease Pencil panel there is second, green marked layer. Try to dissolve marked vertices one by one (order of dissolving is not important). To make things more complicated it works in r60995 and is broken in r61240.bugdissolve.blend

**System Information** Windows 7, 64bit, GeForce GT 555M **Blender Version** Broken: Blender 2.69 r60995 Worked: Blender 2.69 r61240 **Short description of error** Blender crashes in some unexpected situations **Exact steps for others to reproduce the error** Open the attached file and - click X then Dissolve Vertices - crash (not always) if not then - pan and rotate view then click X then Dissolve - crash (not always) I've encountered that it's possible to avoid crash in first situation. Open the file and before dissolving rotate/pan view. It helps in some situations. Vertices leading to crash are red marked. On the Grease Pencil panel there is second, green marked layer. Try to dissolve marked vertices one by one (order of dissolving is not important). To make things more complicated it works in r60995 and is broken in r61240.[bugdissolve.blend](https://archive.blender.org/developer/F29766/bugdissolve.blend)

Changed status to: 'Open'

Changed status to: 'Open'
Howard Trickey was assigned by Voyager Voyager 2013-11-21 01:49:17 +01:00

Added subscriber: @voyagercgi

Added subscriber: @voyagercgi
Member

I wasn't able to reproduce. Sounds like it is something like uninitialized variables; I'll try with a memory debugger tomorrow.

I wasn't able to reproduce. Sounds like it is something like uninitialized variables; I'll try with a memory debugger tomorrow.

I've confirmed the bug on another machine. Below is the link to show the steps when Blender doesn't crash immediately. After rotating/panning the view Blender crashes.
https://vimeo.com/79977071

I've confirmed the bug on another machine. Below is the link to show the steps when Blender doesn't crash immediately. After rotating/panning the view Blender crashes. https://vimeo.com/79977071
Howard Trickey removed their assignment 2013-11-21 16:13:02 +01:00
Member

Added subscriber: @howardt

Added subscriber: @howardt
Member

I still had a hard time recreating this.
When I ran with valgrind, on linux, I eventually provoked some problems, but it was doing more than your video. I think I deselected all the verts, then selected them again, then dissolved.

The valgrind problem was then in the undo pushing code (after a couple of double frees, which may or may not be relevant):

read blend: bugdissolve.blend
BLI_assert failed: blender/source/blender/blenlib/intern/BLI_mempool.c:359, BLI_mempool_free(), at 'newhead->freeword != ( (int)('e') << 24 | (int)('e') << 16 | ('r') << 8 | ('f') )'
BLI_assert failed: blender/source/blender/blenlib/intern/BLI_mempool.c:359, BLI_mempool_free(), at 'newhead->freeword != ( (int)('e') << 24 | (int)('e') << 16 | ('r') << 8 | ('f') )'
Invalid write of size 4

  at 0x213FA92: copy_v3_v3 (math_vector_inline.c:66)
  by 0x2143538: BM_mesh_bm_to_me (bmesh_mesh_conv.c:655)
  by 0x1C85948: editbtMesh_to_undoMesh (editmesh_utils.c:522)
  by 0x1B1E649: undo_editmode_push (editmode_undo.c:165)
  by 0x1C85C0D: undo_push_mesh (editmesh_utils.c:579)
  by 0x1B1FC0C: ED_undo_push (undo.c:94)
  by 0x1B201AB: ED_undo_push_op (undo.c:227)
  by 0x19444D3: wm_operator_finished (wm_event_system.c:659)
  by 0x1945440: wm_operator_invoke (wm_event_system.c:1031)
  by 0x19458D0: wm_operator_call_internal (wm_event_system.c:1185)
  by 0x1945A88: WM_operator_name_call (wm_event_system.c:1234)
  by 0x1BF5C84: ui_apply_but_funcs_after (interface_handlers.c:521)
Address 0x1b408040 is 0 bytes after a block of size 208 alloc'd
  at 0x7C11DB4: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  by 0x27791E0: MEM_lockfree_callocN (mallocn_lockfree_impl.c:220)
  by 0x2142865: BM_mesh_bm_to_me (bmesh_mesh_conv.c:598)
  by 0x1C85948: editbtMesh_to_undoMesh (editmesh_utils.c:522)
  by 0x1B1E649: undo_editmode_push (editmode_undo.c:165)
  by 0x1C85C0D: undo_push_mesh (editmesh_utils.c:579)
  by 0x1B1FC0C: ED_undo_push (undo.c:94)
  by 0x1B201AB: ED_undo_push_op (undo.c:227)
  by 0x19444D3: wm_operator_finished (wm_event_system.c:659)
  by 0x1945440: wm_operator_invoke (wm_event_system.c:1031)
  by 0x19458D0: wm_operator_call_internal (wm_event_system.c:1185)
  by 0x1945A88: WM_operator_name_call (wm_event_system.c:1234)

Line numbers are from build at commit 1158c1f7c0 ; the line
in BM_mesh_bm_to_me() is first line in the loop over BM_VERTS_OF_MESH
in that function.
This looks like the BM_bmesh_bm_to_me code, while iterating over the BM_VERTS_OF_MESH,
is perhaps going too far (past the vertices just dissolved?).

I could try to look at this more but maybe Campbell knows this code better and has a better idea of
what might be going on here, so I'm reassigning to him. (Hope that's OK, Campbell.)

I still had a hard time recreating this. When I ran with valgrind, on linux, I eventually provoked some problems, but it was doing more than your video. I think I deselected all the verts, then selected them again, then dissolved. The valgrind problem was then in the undo pushing code (after a couple of double frees, which may or may not be relevant): read blend: bugdissolve.blend BLI_assert failed: blender/source/blender/blenlib/intern/BLI_mempool.c:359, BLI_mempool_free(), at 'newhead->freeword != ( (int)('e') << 24 | (int)('e') << 16 | ('r') << 8 | ('f') )' BLI_assert failed: blender/source/blender/blenlib/intern/BLI_mempool.c:359, BLI_mempool_free(), at 'newhead->freeword != ( (int)('e') << 24 | (int)('e') << 16 | ('r') << 8 | ('f') )' Invalid write of size 4 ``` at 0x213FA92: copy_v3_v3 (math_vector_inline.c:66) by 0x2143538: BM_mesh_bm_to_me (bmesh_mesh_conv.c:655) by 0x1C85948: editbtMesh_to_undoMesh (editmesh_utils.c:522) by 0x1B1E649: undo_editmode_push (editmode_undo.c:165) by 0x1C85C0D: undo_push_mesh (editmesh_utils.c:579) by 0x1B1FC0C: ED_undo_push (undo.c:94) by 0x1B201AB: ED_undo_push_op (undo.c:227) by 0x19444D3: wm_operator_finished (wm_event_system.c:659) by 0x1945440: wm_operator_invoke (wm_event_system.c:1031) by 0x19458D0: wm_operator_call_internal (wm_event_system.c:1185) by 0x1945A88: WM_operator_name_call (wm_event_system.c:1234) by 0x1BF5C84: ui_apply_but_funcs_after (interface_handlers.c:521) Address 0x1b408040 is 0 bytes after a block of size 208 alloc'd at 0x7C11DB4: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x27791E0: MEM_lockfree_callocN (mallocn_lockfree_impl.c:220) by 0x2142865: BM_mesh_bm_to_me (bmesh_mesh_conv.c:598) by 0x1C85948: editbtMesh_to_undoMesh (editmesh_utils.c:522) by 0x1B1E649: undo_editmode_push (editmode_undo.c:165) by 0x1C85C0D: undo_push_mesh (editmesh_utils.c:579) by 0x1B1FC0C: ED_undo_push (undo.c:94) by 0x1B201AB: ED_undo_push_op (undo.c:227) by 0x19444D3: wm_operator_finished (wm_event_system.c:659) by 0x1945440: wm_operator_invoke (wm_event_system.c:1031) by 0x19458D0: wm_operator_call_internal (wm_event_system.c:1185) by 0x1945A88: WM_operator_name_call (wm_event_system.c:1234) ``` Line numbers are from build at commit 1158c1f7c0 ; the line in BM_mesh_bm_to_me() is first line in the loop over BM_VERTS_OF_MESH in that function. This looks like the BM_bmesh_bm_to_me code, while iterating over the BM_VERTS_OF_MESH, is perhaps going too far (past the vertices just dissolved?). I could try to look at this more but maybe Campbell knows this code better and has a better idea of what might be going on here, so I'm reassigning to him. (Hope that's OK, Campbell.)

This issue was referenced by blender/blender-addons-contrib@283f43d31a

This issue was referenced by blender/blender-addons-contrib@283f43d31a602c88e4dd7123973689cca84b3f7f

This issue was referenced by 283f43d31a

This issue was referenced by 283f43d31a602c88e4dd7123973689cca84b3f7f

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 283f43d31a.

Closed by commit 283f43d31a.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

The problem is (afaics) that dissolve is removing vertices other then the one we're looping over.

I checked on having the ability to tell dissolve only to remove the vertex passed, this may still be useful to do, but it isnt so simple since dissolve handles so many cases.

It turns out that simply not using BM_ITER_MESH_MUTABLE fixes this (which is my bad! - since BM_ITER_MESH_MUTABLE only handles removing the data thats being looped on).

The problem is (afaics) that dissolve is removing vertices other then the one we're looping over. I checked on having the ability to tell dissolve only to remove the vertex passed, this may still be useful to do, but it isnt so simple since dissolve handles so many cases. It turns out that simply not using BM_ITER_MESH_MUTABLE fixes this (which is my bad! - since BM_ITER_MESH_MUTABLE only handles removing the data thats being looped on).
Campbell Barton was assigned by Brecht Van Lommel 2013-11-25 17:58:49 +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#37559
No description provided.