Exact boolean modifier causes assert when adding existing item to set #83630

Closed
opened 2020-12-10 14:29:47 +01:00 by Robert Guetzkow · 5 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 457.30

Blender Version
Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-10 09:23, hash: e795ba1529
Worked: ?

Short description of error
The Boolean modifier may attempt to add duplicate keys to a set in a way that triggers an assert in debug builds of Blender. The function blender::meshintersect::Cell::add_patch uses add_new, which in turn call add_new__impl that expects the key to be new and not previously added to the set. In case the key already exists in the set an assert is triggered.

Exact steps for others to reproduce the error

  • Open the attached file.
  • Render it.

boolean-set-assert.blend

_BLI_assert_abort() Line 51	C
blender::Set<int,4,blender::PythonProbingStrategy<1,0>,blender::DefaultHash<int>,blender::DefaultEquality,blender::SimpleSetSlot<int>,blender::GuardedAllocator>::add_new__impl<int const &>(const int & key, const unsigned __int64 hash) Line 693	C++
blender::Set<int,4,blender::PythonProbingStrategy<1,0>,blender::DefaultHash<int>,blender::DefaultEquality,blender::SimpleSetSlot<int>,blender::GuardedAllocator>::add_new(const int & key) Line 245	C++
blender::meshintersect::Cell::add_patch(int p) Line 405	C++
blender::meshintersect::find_cells_from_edge(const blender::meshintersect::IMesh & tm, const blender::meshintersect::TriMeshTopology & tmtopo, blender::meshintersect::PatchesInfo & pinfo, blender::meshintersect::CellsInfo & cinfo, const blender::meshintersect::Edge e) Line 1141	C++
blender::meshintersect::find_cells(const blender::meshintersect::IMesh & tm, const blender::meshintersect::TriMeshTopology & tmtopo, blender::meshintersect::PatchesInfo & pinfo) Line 1193	C++
blender::meshintersect::boolean_trimesh(blender::meshintersect::IMesh & tm_in, blender::meshintersect::BoolOpType op, int nshapes, std::function<int __cdecl(int)> shape_fn, bool use_self, blender::meshintersect::IMeshArena * arena) Line 3372	C++
blender::meshintersect::boolean_mesh(blender::meshintersect::IMesh & imesh, blender::meshintersect::BoolOpType op, int nshapes, std::function<int __cdecl(int)> shape_fn, bool use_self, blender::meshintersect::IMesh * imesh_triangulated, blender::meshintersect::IMeshArena * arena) Line 3488	C++
blender::meshintersect::bmesh_boolean(BMesh * bm, BMLoop *- [x] * looptris, const int looptris_tot, int(*)(BMFace *, void *) test_fn, void * user_data, int nshapes, const bool use_self, const bool use_separate_all, const bool keep_hidden, const blender::meshintersect::BoolOpType boolean_mode) Line 391	C++
BM_mesh_boolean(BMesh * bm, BMLoop *- [x] * looptris, const int looptris_tot, int(*)(BMFace *, void *) test_fn, void * user_data, const int nshapes, const bool use_self, const bool keep_hidden, const int boolean_mode) Line 453	C++
BMD_mesh_intersection(BMesh * bm, ModifierData * md, const ModifierEvalContext * ctx, Mesh * mesh_operand_ob, Object * object, Object * operand_ob, bool is_flip) Line 420	C
modifyMesh(ModifierData * md, const ModifierEvalContext * ctx, Mesh * mesh) Line 677	C
BKE_modifier_modify_mesh(ModifierData * md, const ModifierEvalContext * ctx, Mesh * me) Line 1055	C
mesh_calc_modifiers(Depsgraph * depsgraph, Scene * scene, Object * ob, int useDeform, const bool need_mapping, const CustomData_MeshMasks * dataMask, const int index, const bool use_cache, const bool allow_shared_mesh, Mesh * * r_deform, Mesh * * r_final) Line 1183	C
mesh_build_data(Depsgraph * depsgraph, Scene * scene, Object * ob, const CustomData_MeshMasks * dataMask, const bool need_mapping) Line 1806	C
makeDerivedMesh(Depsgraph * depsgraph, Scene * scene, Object * ob, BMEditMesh * em, const CustomData_MeshMasks * dataMask) Line 1927	C
BKE_object_handle_data_update(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 194	C
BKE_object_eval_uber_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 385	C
 	[External Code]	
blender::deg::`anonymous namespace'::evaluate_node(const blender::deg::`anonymous-namespace'::DepsgraphEvalState * state, blender::deg::OperationNode * operation_node) Line 115	C++
blender::deg::`anonymous namespace'::deg_task_run_func(TaskPool * pool, void * taskdata) Line 127	C++
Task::()::__l2::<Lambdafunktion>() Line 118	C++
tbb::interface7::internal::delegated_function<void <Lambdafunktion>(void) const ,void>::operator()() Line 94	C++
 	[External Code]	
tbb::interface7::internal::isolate_impl<void,void <Lambdafunktion>(void) const>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Line 161	C++
tbb::interface7::this_task_arena::isolate<void <Lambdafunktion>(void)>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Line 396	C++
Task::operator()() Line 122	C++
tbb::internal::function_task<Task>::execute() Line 1049	C++
 	[External Code]	
**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 457.30 **Blender Version** Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-10 09:23, hash: `e795ba1529` Worked: ? **Short description of error** The Boolean modifier may attempt to add duplicate keys to a set in a way that triggers an assert in debug builds of Blender. The function `blender::meshintersect::Cell::add_patch` uses `add_new`, which in turn call `add_new__impl` that expects the key to be new and not previously added to the set. In case the key already exists in the set an assert is triggered. **Exact steps for others to reproduce the error** - Open the attached file. - Render it. [boolean-set-assert.blend](https://archive.blender.org/developer/F9500167/boolean-set-assert.blend) ```lines _BLI_assert_abort() Line 51 C blender::Set<int,4,blender::PythonProbingStrategy<1,0>,blender::DefaultHash<int>,blender::DefaultEquality,blender::SimpleSetSlot<int>,blender::GuardedAllocator>::add_new__impl<int const &>(const int & key, const unsigned __int64 hash) Line 693 C++ blender::Set<int,4,blender::PythonProbingStrategy<1,0>,blender::DefaultHash<int>,blender::DefaultEquality,blender::SimpleSetSlot<int>,blender::GuardedAllocator>::add_new(const int & key) Line 245 C++ blender::meshintersect::Cell::add_patch(int p) Line 405 C++ blender::meshintersect::find_cells_from_edge(const blender::meshintersect::IMesh & tm, const blender::meshintersect::TriMeshTopology & tmtopo, blender::meshintersect::PatchesInfo & pinfo, blender::meshintersect::CellsInfo & cinfo, const blender::meshintersect::Edge e) Line 1141 C++ blender::meshintersect::find_cells(const blender::meshintersect::IMesh & tm, const blender::meshintersect::TriMeshTopology & tmtopo, blender::meshintersect::PatchesInfo & pinfo) Line 1193 C++ blender::meshintersect::boolean_trimesh(blender::meshintersect::IMesh & tm_in, blender::meshintersect::BoolOpType op, int nshapes, std::function<int __cdecl(int)> shape_fn, bool use_self, blender::meshintersect::IMeshArena * arena) Line 3372 C++ blender::meshintersect::boolean_mesh(blender::meshintersect::IMesh & imesh, blender::meshintersect::BoolOpType op, int nshapes, std::function<int __cdecl(int)> shape_fn, bool use_self, blender::meshintersect::IMesh * imesh_triangulated, blender::meshintersect::IMeshArena * arena) Line 3488 C++ blender::meshintersect::bmesh_boolean(BMesh * bm, BMLoop *- [x] * looptris, const int looptris_tot, int(*)(BMFace *, void *) test_fn, void * user_data, int nshapes, const bool use_self, const bool use_separate_all, const bool keep_hidden, const blender::meshintersect::BoolOpType boolean_mode) Line 391 C++ BM_mesh_boolean(BMesh * bm, BMLoop *- [x] * looptris, const int looptris_tot, int(*)(BMFace *, void *) test_fn, void * user_data, const int nshapes, const bool use_self, const bool keep_hidden, const int boolean_mode) Line 453 C++ BMD_mesh_intersection(BMesh * bm, ModifierData * md, const ModifierEvalContext * ctx, Mesh * mesh_operand_ob, Object * object, Object * operand_ob, bool is_flip) Line 420 C modifyMesh(ModifierData * md, const ModifierEvalContext * ctx, Mesh * mesh) Line 677 C BKE_modifier_modify_mesh(ModifierData * md, const ModifierEvalContext * ctx, Mesh * me) Line 1055 C mesh_calc_modifiers(Depsgraph * depsgraph, Scene * scene, Object * ob, int useDeform, const bool need_mapping, const CustomData_MeshMasks * dataMask, const int index, const bool use_cache, const bool allow_shared_mesh, Mesh * * r_deform, Mesh * * r_final) Line 1183 C mesh_build_data(Depsgraph * depsgraph, Scene * scene, Object * ob, const CustomData_MeshMasks * dataMask, const bool need_mapping) Line 1806 C makeDerivedMesh(Depsgraph * depsgraph, Scene * scene, Object * ob, BMEditMesh * em, const CustomData_MeshMasks * dataMask) Line 1927 C BKE_object_handle_data_update(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 194 C BKE_object_eval_uber_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 385 C [External Code] blender::deg::`anonymous namespace'::evaluate_node(const blender::deg::`anonymous-namespace'::DepsgraphEvalState * state, blender::deg::OperationNode * operation_node) Line 115 C++ blender::deg::`anonymous namespace'::deg_task_run_func(TaskPool * pool, void * taskdata) Line 127 C++ Task::()::__l2::<Lambdafunktion>() Line 118 C++ tbb::interface7::internal::delegated_function<void <Lambdafunktion>(void) const ,void>::operator()() Line 94 C++ [External Code] tbb::interface7::internal::isolate_impl<void,void <Lambdafunktion>(void) const>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Line 161 C++ tbb::interface7::this_task_arena::isolate<void <Lambdafunktion>(void)>(const Task::()::__l2::void <Lambdafunktion>(void) & f) Line 396 C++ Task::operator()() Line 122 C++ tbb::internal::function_task<Task>::execute() Line 1049 C++ [External Code] ```
Author
Member

Added subscriber: @rjg

Added subscriber: @rjg
Author
Member

Added subscriber: @howardt

Added subscriber: @howardt
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

This issue was referenced by 1d447dcd19

This issue was referenced by 1d447dcd19120ed2fd14511589220438ce1904bc
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Howard Trickey self-assigned this 2020-12-10 15:18:40 +01:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blender/blender#83630
No description provided.