Page MenuHome

Blender 2.8 Beta crashing in Sculpt Mode
Open, ConfirmedPublic

Description

System Information
Operating system: Windows 10 Pro latest updates
Graphics card: GTX 1080

Blender Version
Broken: blender-2.80-4c31bed6b46-win64

(worked in the commit in between)
blender-2.80-baf599610a4-win64

Worked: blender-2.79-45c11c1a1bd-win64

Short description of error
Blender crashes when using the grab tool in sculpt mode after having slightly modified a simple cube

Exact steps for others to reproduce the error

  • Using the default cube.
  • Add a bevel modifier.
  • Go into sculpt mode, choose the grab tool.

As soon as I click on the mesh, blender crashes in 2.8 Beta latest build, but not in 2.7 nightly build.
(Doesn't seem to crash without the bevel modifier and autosmooth)

Details

Type
Bug

Event Timeline

Markus Berg (thebergh) renamed this task from Blender 2.8 Beta crashing to Blender 2.8 Beta crashing in Sculpt Mode.
Philipp Oeser (lichtwerk) triaged this task as Confirmed priority.Fri, Nov 30, 11:06 AM

Confirmed, checking...

Hitting various asserts each time trying... (added file to the task description for convenience)

BLI_assert(pool->flag & BLI_MEMPOOL_ALLOW_ITER);

1   raise						0x7ffff466853f 
2   abort						0x7ffff4652895 
3   BLI_mempool_iternew					BLI_mempool.c            562  0x2e9ba25      
4   bmiter__elem_of_mesh_begin				bmesh_iterators.c        435  0x259981c      
5   BM_iter_init					bmesh_iterators_inline.h 160  0x267a2b9      
6   BM_iter_new						bmesh_iterators_inline.h 177  0x267a2b9      
7   BM_mesh_bevel					bmesh_bevel.c            5694 0x267a2b9      
8   applyModifier					MOD_bevel.c              440  0x250cb4a      
9   modwrap_applyModifier				modifier.c               839  0x2af9bfc      
10  mesh_calc_modifiers					DerivedMesh.c            1446 0x29a2f3c      
11  mesh_build_data					DerivedMesh.c            2010 0x29a52c6      
12  makeDerivedMesh 					DerivedMesh.c            2120 0x29a55e1      
13  BKE_object_handle_data_update			object_update.c          205  0x2b3621f      
14  BKE_object_eval_uber_data				object_update.c          348  0x2b36922

BLI_assert(BM_vert_in_edge(e, v));

1   raise						0x7ffff466853f 
2   abort						0x7ffff4652895 
3   bmesh_disk_edge_link_from_vert			bmesh_structure_inline.h 33   0x26428a9      
4   bmesh_disk_edge_append				bmesh_structure.c        184  0x26428a9      
5   BM_edge_create					bmesh_core.c             193  0x2560772      
6   BM_mesh_bm_from_me					bmesh_mesh_conv.c        350  0x25e5670      
7   BKE_mesh_to_bmesh_ex				mesh.c                   729  0x2ace794      
8   applyModifier					MOD_bevel.c              372  0x2509da3      
9   modwrap_applyModifier				modifier.c               839  0x2af9bfc      
10  mesh_calc_modifiers					DerivedMesh.c            1446 0x29a2f3c      
11  mesh_build_data					DerivedMesh.c            2010 0x29a52c6      
12  makeDerivedMesh					DerivedMesh.c            2120 0x29a55e1      
13  BKE_object_handle_data_update			object_update.c          205  0x2b3621f      
14  BKE_object_eval_uber_data				object_update.c          348  0x2b36922

BLI_assert(pool->chunk_tail->next == NULL);

1   raise						0x7ffff466853f 
2   abort						0x7ffff4652895 
3   BLI_mempool_alloc					BLI_mempool.c     367  0x2e9b303      
4   BM_edge_create					bmesh_core.c      163  0x256068b      
5   BM_edges_from_verts_ensure				bmesh_construct.c 94   0x255b1df      
6   BM_face_create_verts				bmesh_core.c      506  0x256138d      
7   bev_create_ngon					bmesh_bevel.c     473  0x2655272      
8   bevel_build_poly					bmesh_bevel.c     3929 0x2668292      
9   build_vmesh						bmesh_bevel.c     4191 0x266a1b1      
10  BM_mesh_bevel					bmesh_bevel.c     5724 0x267b236      
11  applyModifier					MOD_bevel.c       440  0x250cb4a      
12  modwrap_applyModifier				modifier.c        839  0x2af9bfc      
13  mesh_calc_modifiers					DerivedMesh.c     1446 0x29a2f3c      
14  mesh_build_data					DerivedMesh.c     2010 0x29a52c6      
15  makeDerivedMesh					DerivedMesh.c     2120 0x29a55e1      
16  BKE_object_handle_data_update			object_update.c   205  0x2b3621f      
17  BKE_object_eval_uber_data 				object_update.c   348  0x2b36922

Since this is somewhat bound to the bevel modifier (tried sculpt-grabbing with autosmooth on other modifiers and couldnt get them to crash), I would kindly ask @Howard Trickey (howardt) to have a look?

The problem is that the BKE_mesh_to_bmesh_ex() appears not to have created a bm->epool with the BLI_MEMPOOL_ALLOW_ITER flag set. I'll dig into why...

Somehow the memory allocator data structures got corrupted so that it returned the same value for both the edge pool and the loop pool allocations (!).
I'll have to did deeper to understand which code is doing the corrupting. I tried Valgrind, but no luck.

I downloaded the latest build of Blender 2.8 and it doesn't crash anymore when doing the exact thing I tried before.
Neither will switching brushes.

Howard Trickey (howardt) closed this task as Resolved.Mon, Dec 3, 2:30 PM

Yes, this seems to have been fixed by commit rB18f0618677 (found by bisecting commits). I'll close this bug.

I'm really sorry to say that after downloading the blender-2.80-baf599610a4-win64 commit and testing,
it crashes again! Just like before. Just a simple cube with bevel modifier, and using the grab brush in
sculpt mode.

Markus Berg (thebergh) reopened this task as Open.Wed, Dec 5, 4:10 AM
Markus Berg (thebergh) updated the task description. (Show Details)

Doesn't working for the - 2.80, 1fa527bfa3a, 2018-12-05

Yes, you are correct. I guess the previous CL that I thought fixed things just moved the problem around.
I'll continue to look into this.