Segfault when hitting tab #48666

Closed
opened 2016-06-17 11:28:24 +02:00 by Jaggz H · 9 comments

System Information
Debian Jessie (Stable)
Nvidia GTX 970

Blender Version
Broken: Blender 2.77 (sub 0), Commit date: 2016-03-07 00:28, Hash 42e8660
Worked: (optional)

Load .blend, tab into edit mode, tab back out

Exact steps for others to reproduce the error
Load .blend, tab into edit mode, tab back out.

The object is boolean union target (one of many) on another object.
That other object is a boolean difference target of the large object in the scene.

tray-mouth-01-taperingback.blend
tray-mouth-01-taperingback.crash.txt

**System Information** Debian Jessie (Stable) Nvidia GTX 970 **Blender Version** Broken: Blender 2.77 (sub 0), Commit date: 2016-03-07 00:28, Hash 42e8660 Worked: (optional) Load .blend, tab into edit mode, tab back out **Exact steps for others to reproduce the error** Load .blend, tab into edit mode, tab back out. The object is boolean union target (one of many) on another object. That other object is a boolean difference target of the large object in the scene. [tray-mouth-01-taperingback.blend](https://archive.blender.org/developer/F317414/tray-mouth-01-taperingback.blend) [tray-mouth-01-taperingback.crash.txt](https://archive.blender.org/developer/F317415/tray-mouth-01-taperingback.crash.txt)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @jaggz

Added subscriber: @jaggz

Added subscriber: @NikoLeopold

Added subscriber: @NikoLeopold

There are dependency graph cycles: The children of Slot-0-LEADER depend on it as a parent, and Slot-0-LEADER depends on its children via Boolean Modifiers.
This alone should not be a reason for a crash though. Crash only happens for Slot-0-LEADER with Slot-2 or Slot-3 which all use the same mesh.

Clearing the parent relationship or making single-user copies of that mesh avoids the crash.

There are dependency graph cycles: The children of Slot-0-LEADER depend on it as a parent, and Slot-0-LEADER depends on its children via Boolean Modifiers. This alone should not be a reason for a crash though. Crash only happens for Slot-0-LEADER with Slot-2 or Slot-3 which all use the same mesh. Clearing the parent relationship or making single-user copies of that mesh avoids the crash.
Member

Added subscribers: @Sergey, @ideasman42

Added subscribers: @Sergey, @ideasman42
Bastien Montagne self-assigned this 2016-06-21 17:19:13 +02:00
Bastien Montagne removed their assignment 2016-06-21 19:09:02 +02:00
Campbell Barton was assigned by Sergey Sharybin 2016-06-30 14:19:24 +02:00

This is nothing to do with the dependency graph. You can easily rule that out using -t 1 command line argument.

Actual issue is that after toggling edit mode mloop array of some of the operand gets invalid vertex indices. That's easy to see with this patch:

P371: Snippet for #48666

diff --git a/source/blender/modifiers/intern/MOD_boolean_util.c b/source/blender/modifiers/intern/MOD_boolean_util.c
index 061b119..53f3d0c 100644
--- a/source/blender/modifiers/intern/MOD_boolean_util.c
+++ b/source/blender/modifiers/intern/MOD_boolean_util.c
@@ -105,6 +105,9 @@ static void dm_arrays_get(DerivedMesh *dm, DMArrays *arrays)
 	arrays->mvert = DM_get_vert_array(dm, &arrays->mvert_allocated);
 	arrays->medge = DM_get_edge_array(dm, &arrays->medge_allocated);
 	arrays->mloop = DM_get_loop_array(dm, &arrays->mloop_allocated);
+	for (int i = 0; i < dm->getNumLoops(dm); ++i) {
+		BLI_assert(arrays->mloop- [x].v < dm->getNumVerts(dm));
+	}
 	arrays->mpoly = DM_get_poly_array(dm, &arrays->mpoly_allocated);
 }
 
@@ -197,11 +200,18 @@ static int importer_GetPolyNumVerts(ImportMeshData *import_data, int poly_index)
 /* Get list of adjucent vertices to the poly specified by it's index. */
 static void importer_GetPolyVerts(ImportMeshData *import_data, int poly_index, int *verts)
 {
+	BLI_assert(poly_index >= 0);
+	BLI_assert(poly_index < import_data->dm->getNumPolys(import_data->dm));
 	MPoly *mpoly = &import_data->mpoly[poly_index];
+	BLI_assert(mpoly->loopstart >= 0);
+	BLI_assert(mpoly->loopstart < import_data->dm->getNumLoops(import_data->dm));
 	MLoop *mloop = import_data->mloop + mpoly->loopstart;
 	int i;
 	BLI_assert(poly_index >= 0 && poly_index < import_data->dm->getNumPolys(import_data->dm));
 	for (i = 0; i < mpoly->totloop; i++, mloop++) {
+		BLI_assert(mpoly->loopstart + i < import_data->dm->getNumLoops(import_data->dm));
+		BLI_assert(mloop->v >= 0);
+		BLI_assert(mloop->v < import_data->dm->getNumVerts(import_data->dm));
 		verts- [x] = mloop->v;
 	}
 }

@ideasman42, mind giving some help troubleshooting where exactly index gets corrupted?

This is nothing to do with the dependency graph. You can easily rule that out using `-t 1` command line argument. Actual issue is that after toggling edit mode mloop array of some of the operand gets invalid vertex indices. That's easy to see with this patch: [P371: Snippet for #48666](https://archive.blender.org/developer/P371.txt) ``` diff --git a/source/blender/modifiers/intern/MOD_boolean_util.c b/source/blender/modifiers/intern/MOD_boolean_util.c index 061b119..53f3d0c 100644 --- a/source/blender/modifiers/intern/MOD_boolean_util.c +++ b/source/blender/modifiers/intern/MOD_boolean_util.c @@ -105,6 +105,9 @@ static void dm_arrays_get(DerivedMesh *dm, DMArrays *arrays) arrays->mvert = DM_get_vert_array(dm, &arrays->mvert_allocated); arrays->medge = DM_get_edge_array(dm, &arrays->medge_allocated); arrays->mloop = DM_get_loop_array(dm, &arrays->mloop_allocated); + for (int i = 0; i < dm->getNumLoops(dm); ++i) { + BLI_assert(arrays->mloop- [x].v < dm->getNumVerts(dm)); + } arrays->mpoly = DM_get_poly_array(dm, &arrays->mpoly_allocated); } @@ -197,11 +200,18 @@ static int importer_GetPolyNumVerts(ImportMeshData *import_data, int poly_index) /* Get list of adjucent vertices to the poly specified by it's index. */ static void importer_GetPolyVerts(ImportMeshData *import_data, int poly_index, int *verts) { + BLI_assert(poly_index >= 0); + BLI_assert(poly_index < import_data->dm->getNumPolys(import_data->dm)); MPoly *mpoly = &import_data->mpoly[poly_index]; + BLI_assert(mpoly->loopstart >= 0); + BLI_assert(mpoly->loopstart < import_data->dm->getNumLoops(import_data->dm)); MLoop *mloop = import_data->mloop + mpoly->loopstart; int i; BLI_assert(poly_index >= 0 && poly_index < import_data->dm->getNumPolys(import_data->dm)); for (i = 0; i < mpoly->totloop; i++, mloop++) { + BLI_assert(mpoly->loopstart + i < import_data->dm->getNumLoops(import_data->dm)); + BLI_assert(mloop->v >= 0); + BLI_assert(mloop->v < import_data->dm->getNumVerts(import_data->dm)); verts- [x] = mloop->v; } } ``` @ideasman42, mind giving some help troubleshooting where exactly index gets corrupted?
Campbell Barton was unassigned by Sergey Sharybin 2016-07-01 13:47:07 +02:00
Sergey Sharybin self-assigned this 2016-07-01 13:47:07 +02:00

Actually, the issue does not happen with boolean modifier disabled, so afraid it's bug in Carve or in glue API which goes to my desk.

Actually, the issue does not happen with boolean modifier disabled, so afraid it's bug in Carve or in glue API which goes to my desk.

This issue was referenced by 158679c9cc

This issue was referenced by 158679c9cc0f024fd54874f48e82cc00072caab4

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
5 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#48666
No description provided.