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.
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
3 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#83630
No description provided.