Page MenuHome

Bmesh Crash on opening a file
Closed, DuplicatePublic

Description

System Information
Windows 10
Intel HD 4600

Blender Version
Broken: Latest Master
Worked: (optional)

Short description of error
Upon opening https://cloud.blender.org/p/gallery/57e5084f0fcf294119c5055c

you get the following backtrace with a debug build:

20: BLI_system_backtrace - 0x28B81040
19: mesh_vert_canon - 0x280E4F00
18: interp_vmesh - 0x280E5C00
17: adj_vmesh - 0x280E7DD0
16: bevel_build_rings - 0x280E8B30
15: build_vmesh - 0x280EC120
14: BM_mesh_bevel - 0x280DD510
13: applyModifier - 0x27FDE120
12: modwrap_applyModifier - 0x283585B0
11: mesh_calc_modifiers - 0x28535C80
10: mesh_build_data - 0x28538310
9: makeDerivedMesh - 0x2852DE50
8: BKE_object_handle_data_update - 0x286C4F80
7: BKE_object_handle_update_ex - 0x284AED00
6: scene_update_object_func - 0x283B4160
5: task_scheduler_thread_run - 0x28BDE9B0
4: sched_get_priority_max - 0x5E2D12FD
3: sched_get_priority_max - 0x5E2D12FD
2: sched_get_priority_max - 0x5E2D12FD
1: BaseThreadInitThunk - 0x824A80E0
0: RtlUserThreadStart - 0x8378C580
BLI_assert failed: C:UsersAaronBlenderDevblender-gitblendersourceblenderbmeshtoolsbmesh_bevel.c:2079, mesh_vert_canon(), at '0 <= i && i <= n && 0 <= j && j <= ns && 0 <= k && k <= ns'

Exact steps for others to reproduce the error
Open https://cloud.blender.org/p/gallery/57e5084f0fcf294119c5055c

Event Timeline

Bastien Montagne (mont29) lowered the priority of this task from 90 to Normal.

@Howard Trickey (howardt) backtrace seems to point to Bevel issue?

Yes, it is triggering a "shouldn't happen" assert in Bevel. I fixed a similar problem to this recently. Will try to fix this soon.

The Blenderman file is still crashing all the Buildbot builds on opening while official 2.78c can open it. Is this a regression of some sort?

All 2.8 Buildbot builds also crash.

Looking at this again now. For reference, here's a simpler file that causes the assert failure (in mesh_vert_canon):

Fixed this now. Sorry for the long delay. Fixed in master; the 2.8 branch should update in a day or two when merge from 2.78 to 2.8 happens.

Thanks for taking care of this. I just compiled the very latest master and the Blenderman.blend still crashes Blender here.

Hmm. Can you see if the code you compiled includes commit rB8be9d68dd42d ? (git log in the blender source directory should show it).

According to the build number in the splashscreen, yes.
And the bmesh_bevel.c source also contains the latest changes.

Aaron Carlisle (Blendify) changed the task status from Resolved to Unknown Status.May 16 2017, 3:48 PM

I am going to re-open this then... I can recompile later today and test as long as my render finishes.

I cannot reproduce a crash. Maybe I don't have all the same build settings. Can someone who gets a crash paste a stack backtrace? I am wondering if the crash is still in bevel, or whether it is somewhere else now.

I justed tested it again and found that my own VS2015 builds and the official Buildbot VS2015 builds crash while the VS2013 builds from the Buildbot don't.

Thanks. Do you have a stack backtrace? At any rate, I will try with VS2017 which I have at home and see what happens with that.

No, sorry, no backtrace. I'm not a coder, I'm just glad I can compile Blender myself ;)

@Steffen Dünner (SteffenD) to make a debug build on windows just run make 2015 full debug this will give a backtrace after crashing. I would test but my machine is busy rendering still.

for what it's worth, i can't repro on win7, with either the buildbot or my own builds....

for what it's worth, i can't repro on win7, with either the buildbot or my own builds....

Did you also try the VS2015 builds? The VS2013 builds don't crash for me.

Yes, used a 2015/x64 buildbot from yesterday, and and build (2015/x64/debug) from master today.

After some more testing, i got the buildbot and my local release version to crash, but not my debug build... :(

I could not get it to crash with my vs2017 release or debug builds. I did try the buildbot 2015/x64/release build, and it crashed, but I don't know how to get a symbol file for this so couldn't get a meaningful stack trace. I have a strong suspicion that the problem now is not with bevel, but somewhere else.

after some convincing i had the release build put out a stracktrace

>	blender.exe!carve::geom3d::fitPlane<carve::mesh::detail::list_iter_t<carve::mesh::Edge<3> >,carve::mesh::Face<3>::vector_mapping>(carve::mesh::detail::list_iter_t<carve::mesh::Edge<3> > begin, carve::mesh::detail::list_iter_t<carve::mesh::Edge<3> > end, carve::mesh::Face<3>::vector_mapping adapt, carve::geom::plane<3> & plane) Line 60	C++
 	blender.exe!carve::mesh::Face<3>::recalc() Line 279	C++
 	blender.exe!carve_addMesh(ImportMeshData * import_data, CarveMeshImporter * mesh_importer) Line 640	C++
 	blender.exe!carve_mesh_from_dm(Object * object, DerivedMesh * dm, const DMArrays * dm_arrays) Line 699	C
 	blender.exe!NewBooleanDerivedMesh(DerivedMesh * dm, Object * ob, DerivedMesh * dm_select, Object * ob_select, int int_op_type) Line 758	C
 	blender.exe!applyModifier_carve(ModifierData * md, Object * ob, DerivedMesh * derivedData, ModifierApplyFlag flag) Line 394	C
 	blender.exe!mesh_calc_modifiers(Scene * scene, Object * ob, float[3] * inputVertexCos, const bool useRenderParams, int useDeform, const bool need_mapping, unsigned __int64 dataMask, const int index, const bool useCache, const bool build_shapekey_layers, const bool allow_gpu, DerivedMesh * * r_deform, DerivedMesh * * r_final) Line 2060	C
 	blender.exe!mesh_build_data(Scene * scene, Object * ob, unsigned __int64 dataMask, const bool build_shapekey_layers, const bool need_mapping) Line 2633	C
 	blender.exe!makeDerivedMesh(Scene * scene, Object * ob, BMEditMesh * em, unsigned __int64 dataMask, const bool build_shapekey_layers) Line 2727	C
 	blender.exe!BKE_object_handle_data_update(EvaluationContext * eval_ctx, Scene * scene, Object * ob) Line 204	C
 	blender.exe!BKE_object_handle_update_ex(EvaluationContext * eval_ctx, Scene * scene, Object * ob, RigidBodyWorld * rbw, const bool do_proxy_update) Line 2650	C
 	blender.exe!scene_update_object_func(TaskPool * pool, void * taskdata, int threadid) Line 1517	C
 	blender.exe!task_scheduler_thread_run(void * thread_p) Line 414	C
 	pthreadVC2.dll!000007feeabb627b()	Unknown
 	pthreadVC2.dll!000007feeabb8eb7()	Unknown
 	pthreadVC2.dll!000007feeabb9102()	Unknown
 	[External Code]

@Ray molenkamp (LazyDodo), do you mind testing this patch

1diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c
2index f86d8b99f3c..3a0b19fac87 100644
3--- a/source/blender/modifiers/intern/MOD_boolean.c
4+++ b/source/blender/modifiers/intern/MOD_boolean.c
5@@ -368,8 +368,17 @@ static DerivedMesh *applyModifier_carve(
6 return derivedData;
7
8 dm = get_dm_for_modifier(bmd->object, flag);
9+ if (!DM_is_valid(derivedData)) {
10+ printf("Invalid DerivedData!\n");
11+ return derivedData;
12+ }
13
14 if (dm) {
15+ if (!DM_is_valid(dm)) {
16+ printf("Invalid dm!\n");
17+ return derivedData;
18+ }
19+
20 DerivedMesh *result;
21
22 /* when one of objects is empty (has got no faces) we could speed up
and see if both DM are valid?