Add Zone cutout doesn't check that it has a point in the zone
Description
After creating a filled zone, we can add a zone cutout using the hotkey (default Shift-C). If the zone cutout doesn't overlap the originally-selected zone, we clear the whole zone and it is difficult to fix without reloading.
Steps to reproduce
- Create a filled zone.
- With the filled zone selected, move your mouse outside of the zone area
- Create a cutout that doesn't overlap the original zone outline
KiCad Version
Application: Pcbnew
Version: (5.99.0-3190-g7b05e456c-dirty), debug build
Libraries:
wxWidgets 3.0.5
Platform: Linux 5.7.0-3-amd64 x86_64, 64 bit, Little endian, wxGTK
wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.71.0
OCC: 7.4.0
Curl: 7.72.0
ngspice: 32
Compiler: GCC 10.2.0 with C++ ABI 1014
Build settings:
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCC=ON
KICAD_SPICE=ON
KICAD_STDLIB_DEBUG=ON
KICAD_SANITIZE=OFF
Designs
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Seth Hillbrand changed milestone to %6.0.0-rc1
changed milestone to %6.0.0-rc1
- Seth Hillbrand added pcbnew label
added pcbnew label
- Owner
This build information does not contain the expected version data.Please reply to this with where you downloaded your KiCad package.
Collapse replies - Author Owner
Bitten by my own bot 4 - Maintainer
It's becoming sentient. Hopefully we don't have a Cylon invasion soon...
- KiCad Bot added priorityundecided statusneed-info labels
added priorityundecided statusneed-info labels
- Seth Hillbrand closed
closed
- Seth Hillbrand reopened
reopened
- Seth Hillbrand added prioritymedium label and removed priorityundecided statusneed-info labels
added prioritymedium label and removed priorityundecided statusneed-info labels
- Maintainer
Are you still seeing this @sethhillbrand? I can't reproduce it, but there doesn't seem to be any code changes in the area either.
(Note that I did find another bug that if the cutout completely encloses the original zone then we segfault.)
- Jeff Young assigned to @jeffyoung
assigned to @jeffyoung
- Jeff Young added priorityhigh label and removed prioritymedium label
added priorityhigh label and removed prioritymedium label
- Author Owner
Huh. Right now, I can't create a zone at all but this is yesterday's build. I'm updating now to see if that's fixed.
- Author Owner
OK. Zones can be created now. This issue can be closed.
But it does look like we have an intermediate issue where we get an invalid zone outline during fill
#5 0x00007ffff138c2cd in CN_VISITOR::checkZoneZoneConnection (this=0x55555c63a458, aZoneLayerA=0x55555c4a3a80, aZoneLayerB=0x55555c4c5e90) at ../../pcbnew/connectivity/connectivity_algo.cpp:697 697 zoneB->GetFilledPolysList( layer ).COutline( aZoneLayerB->SubpolyIndex() ); (gdb) print layer $1 = PCBNEW_LAYER_ID_START (gdb) print zoneB $2 = (const ZONE_CONTAINER * const) 0x555559e0f000 (gdb) print aZoneLayerB->SubpolyIndex $3 = {int (const CN_ZONE_LAYER * const)} 0x7ffff1392bb2 <CN_ZONE_LAYER::SubpolyIndex() const> (gdb) print aZoneLayerB->SubpolyIndex() [Thread 0x7fffdffff700 (LWP 1981464) exited] $4 = 0 (gdb) print zoneB->GetFilledPolysList( 0 ) $5 = (const SHAPE_POLY_SET &) @0x55555c261ad8: {<SHAPE> = {<SHAPE_BASE> = { _vptr.SHAPE_BASE = 0x7ffff2f6a4a0 <vtable for SHAPE_POLY_SET+16>, m_type = SH_POLY_SET}, <No data fields>}, m_polys = std::__debug::vector of length 0, capacity 1, m_triangulatedPolys = std::__debug::vector of length 0, capacity 0, m_triangulationValid = true, m_hash = { m_valid = true, m_ctx = {data = "\000\000\000\000\200", '\000' <repeats 51 times>, " \000\000\000\000\000\000", datalen = 4, bitlen = {32, 0}, state = {2231358449, 846670147, 502410630, 1651697092}}, m_hash = "\361\323\377\204C)w2\206-\362\035\304\345rb"}} (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x00007ffff6dab537 in __GI_abort () at abort.c:79 #2 0x00007ffff7167ed1 in std::__throw_bad_exception() () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #3 0x00007ffff07e040c in std::__debug::vector<std::__debug::vector<SHAPE_LINE_CHAIN, std::allocator<SHAPE_LINE_CHAIN> >, std::allocator<std::__debug::vector<SHAPE_LINE_CHAIN, std::allocator<SHAPE_LINE_CHAIN> > > >::operator[](unsigned long) const (this=0x55555c261ae8, __n=0) at /usr/include/c++/10/debug/vector:434 #4 0x00007ffff0ab2449 in SHAPE_POLY_SET::COutline(int) const (this=0x55555c261ad8, aIndex=0) at ../../libs/kimath/include/geometry/shape_poly_set.h:683 #5 0x00007ffff138c2cd in CN_VISITOR::checkZoneZoneConnection(CN_ZONE_LAYER*, CN_ZONE_LAYER*) (this=0x55555c63a458, aZoneLayerA=0x55555c4a3a80, aZoneLayerB=0x55555c4c5e90) at ../../pcbnew/connectivity/connectivity_algo.cpp:697 #6 0x00007ffff138c51c in CN_VISITOR::operator()(CN_ITEM*) (this=0x55555c63a458, aCandidate=0x55555c4c5e90) at ../../pcbnew/connectivity/connectivity_algo.cpp:737 #7 0x00007ffff139bc7a in RTree<CN_ITEM*, int, 3, double, 8, 4>::Search<CN_VISITOR>(RTree<CN_ITEM*, int, 3, double, 8, 4>::Node*, RTree<CN_ITEM*, int, 3, double, 8, 4>::Rect*, CN_VISITOR&, int&) (this=0x555558f56bd0, a_node=0x555558cc5670, a_rect=0x55555c63a3d0, a_visitor=..., a_foundCount=@0x55555c63a3cc: 0) at ../../thirdparty/rtree/geometry/rtree.h:593 #8 0x00007ffff13992d1 in RTree<CN_ITEM*, int, 3, double, 8, 4>::Search<CN_VISITOR>(int const*, int const*, CN_VISITOR&) (this=0x555558f56bd0, a_min=0x55555c63a434, a_max=0x55555c63a428, a_visitor=...) at ../../thirdparty/rtree/geometry/rtree.h:201 #9 0x00007ffff1396a19 in CN_RTREE<CN_ITEM*>::Query<CN_VISITOR>(BOX2<VECTOR2<int> > const&, LAYER_RANGE const&, CN_VISITOR&) (this=0x555558bf5608, aBounds=..., aRange=..., aVisitor=...) at ../../pcbnew/connectivity/../connectivity/connectivity_rtree.h:115 #10 0x00007ffff13943f7 in CN_LIST::FindNearby<CN_VISITOR>(CN_ITEM*, CN_VISITOR) (this=0x555558bf5600, aItem=0x55555c4a3a80, aFunc=...) at ../../pcbnew/connectivity/../connectivity/connectivity_items.h:466 #11 0x00007ffff13890f1 in operator()(CN_LIST*, PROGRESS_REPORTER*) const (__closure=0x55555c63a550, aItemList=0x555558bf5600, aReporter=0x0) at ../../pcbnew/connectivity/connectivity_algo.cpp:243 #12 0x00007ffff13893f6 in CN_CONNECTIVITY_ALGO::searchConnections() (this=0x555558bf5600) at ../../pcbnew/connectivity/connectivity_algo.cpp:253 #13 0x00007ffff13898d4 in CN_CONNECTIVITY_ALGO::SearchClusters(CN_CONNECTIVITY_ALGO::CLUSTER_SEARCH_MODE, KICAD_T const*, int) (this=0x555558bf5600, aMode=CN_CONNECTIVITY_ALGO::CSM_CONNECTIVITY_CHECK, aTypes=0x55555c63aab0, aSingleNet=-1) at ../../pcbnew/connectivity/connectivity_algo.cpp:311 #14 0x00007ffff13896b6 in CN_CONNECTIVITY_ALGO::SearchClusters(CN_CONNECTIVITY_ALGO::CLUSTER_SEARCH_MODE) (this=0x555558bf5600, aMode=CN_CONNECTIVITY_ALGO::CSM_CONNECTIVITY_CHECK) at ../../pcbnew/connectivity/connectivity_algo.cpp:296 #15 0x00007ffff138b844 in CN_CONNECTIVITY_ALGO::FindIsolatedCopperIslands(std::__debug::vector<CN_ZONE_ISOLATED_ISLAND_LIST, std::allocator<CN_ZONE_ISOLATED_ISLAND_LIST> >&) (this=0x555558bf5600, aZones=std::__debug::vector of length 1, capacity 1 = {...}) at ../../pcbnew/connectivity/connectivity_algo.cpp:570 #16 0x00007ffff134e5aa in CONNECTIVITY_DATA::FindIsolatedCopperIslands(std::__debug::vector<CN_ZONE_ISOLATED_ISLAND_LIST, std::allocator<CN_ZONE_ISOLATED_ISLAND_LIST> >&) (this=0x5555590f4ee0, aZones=std::__debug::vector of length 1, capacity 1 = {...}) at ../../pcbnew/connectivity/connectivity_data.cpp:271 #17 0x00007ffff0d70e25 in ZONE_FILLER::Fill(std::__debug::vector<ZONE_CONTAINER*, std::allocator<ZONE_CONTAINER*> >&, bool, wxWindow*) (this=0x55555c63c010, aZones=std::__debug::vector of length 1, capacity 1 = {...}, aCheck=false, aParent=0x0) at ../../pcbnew/zone_filler.cpp:309 #18 0x00007ffff0e96898 in ZONE_CREATE_HELPER::commitZone(std::unique_ptr<ZONE_CONTAINER, std::default_delete<ZONE_CONTAINER> >) (this=0x55555c63cad0, aZone=std::unique_ptr<ZONE_CONTAINER> = {...}) at ../../pcbnew/tools/zone_create_helper.cpp:208 #19 0x00007ffff0e9739b in ZONE_CREATE_HELPER::OnComplete(POLYGON_GEOM_MANAGER const&) (this=0x55555c63cad0, aMgr=...) at ../../pcbnew/tools/zone_create_helper.cpp:337 #20 0x00007ffff173f0bc in POLYGON_GEOM_MANAGER::SetFinished() (this=0x55555c63c920) at ../../common/preview_items/polygon_geom_manager.cpp:74 #21 0x00007ffff0dba186 in DRAWING_TOOL::DrawZone(TOOL_EVENT const&) (this=0x555558d04360, aEvent=...) at ../../pcbnew/tools/drawing_tool.cpp:1881 #22 0x00007ffff0dc7d03 in std::__invoke_impl<int, int (DRAWING_TOOL::*&)(TOOL_EVENT const&), DRAWING_TOOL*&, TOOL_EVENT const&>(std::__invoke_memfun_deref, int (DRAWING_TOOL::*&)(TOOL_EVENT const&), DRAWING_TOOL*&, TOOL_EVENT const&) (__f= @0x555559936c30: (int (DRAWING_TOOL::*)(DRAWING_TOOL * const, const TOOL_EVENT &)) 0x7ffff0db9784 <DRAWING_TOOL::DrawZone(TOOL_EVENT const&)>, __t=@0x555559936c40: 0x555558d04360) at /usr/include/c++/10/bits/invoke.h:73 #23 0x00007ffff0dc79f1 in std::__invoke<int (DRAWING_TOOL::*&)(TOOL_EVENT const&), DRAWING_TOOL*&, TOOL_EVENT const&>(int (DRAWING_TOOL::*&)(TOOL_EVENT const&), DRAWING_TOOL*&, TOOL_EVENT const&) (__fn= @0x555559936c30: (int (DRAWING_TOOL::*)(DRAWING_TOOL * const, const TOOL_EVENT &)) 0x7ffff0db9784 <DRAWING_TOOL::DrawZone(TOOL_EVENT const&)>) at /usr/include/c++/10/bits/invoke.h:95 #24 0x00007ffff0dc76c9 in std::_Bind<int (DRAWING_TOOL::*(DRAWING_TOOL*, std::_Placeholder<1>))(TOOL_EVENT const&)>::__call<int, TOOL_EVENT const&, 0ul, 1ul>(std::tuple<TOOL_EVENT const&>&&, std::_Index_tuple<0ul, 1ul>) (this=0x555559936c30, __args=...) at /usr/include/c++/10/functional:416 #25 0x00007ffff0dc7447 in std::_Bind<int (DRAWING_TOOL::*(DRAWING_TOOL*, std::_Placeholder<1>))(TOOL_EVENT const&)>::operator()<TOOL_EVENT const&, int>(TOOL_EVENT const&) (this=0x555559936c30) at /usr/include/c++/10/functional:499 #26 0x00007ffff0dc701b in std::__invoke_impl<int, std::_Bind<int (DRAWING_TOOL::*(DRAWING_TOOL*, std::_Placeholder<1>))--Type <RET> for m--Type--Type <RET--T--Typ--Typ----Ty------T-------Ty--Typ---Type <--Typ--Ty--Typ--Type----Type --T----Typ---Typ--T---Typ-------Type <RET> for more, q to quit, c to continue without paging-- (TOOL_EVENT const&)>&, TOOL_EVENT const&>(std::__invoke_other, std::_Bind<int (DRAWING_TOOL::*(DRAWING_TOOL*, std::_Placeholder<1>))(TOOL_EVENT const&)>&, TOOL_EVENT const&) (__f=...) at /usr/include/c++/10/bits/invoke.h:60 #27 0x00007ffff0dc6c23 in std::__invoke_r<int, std::_Bind<int (DRAWING_TOOL::*(DRAWING_TOOL*, std::_Placeholder<1>))(TOOL_EVENT const&)>&, TOOL_EVENT const&>(std::_Bind<int (DRAWING_TOOL::*(DRAWING_TOOL*, std::_Placeholder<1>))(TOOL_EVENT const&)>&, TOOL_EVENT const&) (__fn=...) at /usr/include/c++/10/bits/invoke.h:141 #28 0x00007ffff0dc6262 in std::_Function_handler<int (TOOL_EVENT const&), std::_Bind<int (DRAWING_TOOL::*(DRAWING_TOOL*, std::_Placeholder<1>))(TOOL_EVENT const&)> >::_M_invoke(std::_Any_data const&, TOOL_EVENT const&) (__functor=..., __args#0=...) at /usr/include/c++/10/bits/std_function.h:291 #29 0x00007ffff1943475 in std::function<int (TOOL_EVENT const&)>::operator()(TOOL_EVENT const&) const (this=0x5555593a66b0, __args#0=...) at /usr/include/c++/10/bits/std_function.h:622 #30 0x00007ffff193ed5e in COROUTINE<int, TOOL_EVENT const&>::callerStub(long) (aData=140737488339920) at ../../include/tool/coroutine.h:356 #31 0x00007ffff19f76e1 in make_fcontext () at /usr/local/bin/_pcbnew.kiface #32 0x3fe0000000000000 in () #33 0x3fe0000000000000 in () #34 0x0000000000100010 in () #35 0x0000000000040011 in () #36 0x00002e890000fff1 in () #37 0x0000000100012e7a in () #38 0x0000000000000000 in ()
- Author Owner
This issue is very indeterminate. It looks like we might have some threading fighting the connectivity
- Jeff Young closed with commit ea387f2f
closed with commit ea387f2f
- Maintainer
@sethhillbrand, do you want to open a separate bug report for that, or leave this one open for it?
(I've fixed the cutout-whole-zone crash bug.)
Collapse replies - Author Owner
Thanks! I'll separate that one
- Jeff Young added statusfix-committed label and removed statusnew label
added statusfix-committed label and removed statusnew label