There’s a compile error in it (canvas vs. GetGalCanvas()), but once that is corrected it does fix the bug on OSX.
> On 22 Jan 2018, at 17:10, jean-pierre charras <email address hidden> wrote: > > The attached patch could be better: > It moves m_toolManager->DeactivateTool(); to OnCloseWindow and deactivates GAL events. > (We already have an issue with events fired after a frame was close) > > ** Patch added: "gerbview_fix.patch" > https://bugs.launchpad.net/kicad/+bug/1744600/+attachment/5041143/+files/gerbview_fix.patch > > -- > You received this bug notification because you are subscribed to the bug > report. > https://bugs.launchpad.net/bugs/1744600 > > Title: > Assertion failure quitting gerbview > > Status in KiCad: > Fix Committed > > Bug description: > Open a gerber. > Click to select a pad. > Close document. > Assertion failure. > > Is there any reason we allow selection in gerbveiw? It doesn't seem > to have a purpose.... > > Assertion failed: (IsMapped()), function Allocate, file > /Users/jeff/kicad_dev/kicad/common/gal/opengl/cached_container.cpp, > line 108. > > Thread 0 Crashed:: Dispatch queue: com.apple.main-thread > 0 libsystem_kernel.dylib 0x00007fff694dee3e __pthread_kill + 10 > 1 libsystem_pthread.dylib 0x00007fff6961d150 pthread_kill + 333 > 2 libsystem_c.dylib 0x00007fff6943b312 abort + 127 > 3 libsystem_c.dylib 0x00007fff69403368 __assert_rtn + 320 > 4 _gerbview.kiface 0x0000000109299acd KIGFX::CACHED_CONTAINER::Allocate(unsigned int) + 141 (cached_container.cpp:108) > 5 _gerbview.kiface 0x00000001092a8084 KIGFX::VERTEX_MANAGER::Reserve(unsigned int) + 148 (vertex_manager.cpp:71) > 6 _gerbview.kiface 0x00000001092690bf KIGFX::OPENGL_GAL::DrawCircle(VECTOR2<double> const&, double) + 63 (opengl_gal.cpp:471) > 7 _gerbview.kiface 0x0000000108fb74b2 KIGFX::GERBVIEW_PAINTER::drawFlashedShape(GERBER_DRAW_ITEM*, bool) + 546 (gerbview_painter.cpp:431) > 8 _gerbview.kiface 0x0000000108fb6c9c KIGFX::GERBVIEW_PAINTER::draw(GERBER_DRAW_ITEM*, int) + 3708 (gerbview_painter.cpp:332) > 9 _gerbview.kiface 0x0000000108fb5df3 KIGFX::GERBVIEW_PAINTER::Draw(KIGFX::VIEW_ITEM const*, int) + 83 (gerbview_painter.cpp:160) > 10 _gerbview.kiface 0x00000001091241ca KIGFX::VIEW::updateItemGeometry(KIGFX::VIEW_ITEM*, int) + 554 (view.cpp:1169) > 11 _gerbview.kiface 0x0000000109123b20 KIGFX::VIEW::invalidateItem(KIGFX::VIEW_ITEM*, int) + 336 (view.cpp:1099) > 12 _gerbview.kiface 0x00000001091250b7 KIGFX::VIEW::UpdateItems() + 503 (view.cpp:1286) > 13 _gerbview.kiface 0x0000000109234c89 EDA_DRAW_PANEL_GAL::onPaint(wxPaintEvent&) + 297 (draw_panel_gal.cpp:168) > 14 libwx_baseu-3.0.0.4.0.dylib 0x000000010350fd96 wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const + 134 (appbase.cpp:612) > 15 libwx_baseu-3.0.0.4.0.dylib 0x000000010350fe35 wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const + 149 (appbase.cpp:623) > 16 libwx_baseu-3.0.0.4.0.dylib 0x00000001037361fc wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) + 220 (event.cpp:1396) > 17 libwx_baseu-3.0.0.4.0.dylib 0x000000010373875f wxEvtHandler::SearchDynamicEventTable(wxEvent&) + 335 (event.cpp:1754) > 18 libwx_baseu-3.0.0.4.0.dylib 0x000000010373853d wxEvtHandler::TryHereOnly(wxEvent&) + 77 (event.cpp:1588) > 19 libwx_baseu-3.0.0.4.0.dylib 0x00000001037382ad wxEvtHandler::TryBeforeAndHere(wxEvent&) + 77 (event.h:3680) > 20 libwx_baseu-3.0.0.4.0.dylib 0x00000001037382ef wxEvtHandler::ProcessEventLocally(wxEvent&) + 47 (event.cpp:1525) > 21 libwx_baseu-3.0.0.4.0.dylib 0x000000010373818e wxEvtHandler::ProcessEvent(wxEvent&) + 318 (event.cpp:1498) > 22 libwx_baseu-3.0.0.4.0.dylib 0x0000000103737c81 wxEvtHandler::ProcessPendingEvents() + 1377 (event.cpp:1362) > 23 libwx_baseu-3.0.0.4.0.dylib 0x000000010350f21c wxAppConsoleBase::ProcessPendingEvents() + 316 (appbase.cpp:522) > 24 _gerbview.kiface 0x0000000109176103 TOOL_MANAGER::ProcessEvent(TOOL_EVENT const&) + 307 (tool_manager.cpp:755) > 25 _gerbview.kiface 0x0000000108fbbedf GERBVIEW_SELECTION_TOOL::clearSelection() + 495 (selection_tool.cpp:617) > 26 _gerbview.kiface 0x0000000108fbc3a9 GERBVIEW_SELECTION_TOOL::Main(TOOL_EVENT const&) + 1209 (selection_tool.cpp:241) > > Application: kicad > Version: (2018-01-21 revision ba1fe4517)-master, debug build > Libraries: > wxWidgets 3.0.4 > libcurl/7.54.0 LibreSSL/2.0.20 zlib/1.2.11 nghttp2/1.24.0 > Platform: Mac OS X (Darwin 17.3.0 x86_64), 64 bit, Little endian, wxMac > Build Info: > wxWidgets: 3.0.4 (UTF-8,STL containers,compatible with 2.8) > Boost: 1.65.1 > Curl: 7.57.0 > Compiler: Clang 9.0.0 with C++ ABI 1002 > > Build settings: > USE_WX_GRAPHICS_CONTEXT=ON > USE_WX_OVERLAY=ON > KICAD_SCRIPTING=OFF > KICAD_SCRIPTING_MODULES=OFF > KICAD_SCRIPTING_WXPYTHON=OFF > KICAD_SCRIPTING_ACTION_MENU=OFF > BUILD_GITHUB_PLUGIN=ON > KICAD_USE_OCE=OFF > KICAD_SPICE=OFF > > To manage notifications about this bug go to: > https://bugs.launchpad.net/kicad/+bug/1744600/+subscriptions
There’s a compile error in it (canvas vs. GetGalCanvas()), but once that is corrected it does fix the bug on OSX.
> On 22 Jan 2018, at 17:10, jean-pierre charras <email address hidden> wrote: >DeactivateTool (); to OnCloseWindow and deactivates GAL events. fix.patch" /bugs.launchpad .net/kicad/ +bug/1744600/ +attachment/ 5041143/ +files/ gerbview_ fix.patch /bugs.launchpad .net/bugs/ 1744600 jeff/kicad_ dev/kicad/ common/ gal/opengl/ cached_ container. cpp, main-thread kernel. dylib 0x00007fff694dee3e __pthread_kill + 10 pthread. dylib 0x00007fff6961d150 pthread_kill + 333 CACHED_ CONTAINER: :Allocate( unsigned int) + 141 (cached_ container. cpp:108) VERTEX_ MANAGER: :Reserve( unsigned int) + 148 (vertex_ manager. cpp:71) OPENGL_ GAL::DrawCircle (VECTOR2< double> const&, double) + 63 (opengl_ gal.cpp: 471) GERBVIEW_ PAINTER: :drawFlashedSha pe(GERBER_ DRAW_ITEM* , bool) + 546 (gerbview_ painter. cpp:431) GERBVIEW_ PAINTER: :draw(GERBER_ DRAW_ITEM* , int) + 3708 (gerbview_ painter. cpp:332) GERBVIEW_ PAINTER: :Draw(KIGFX: :VIEW_ITEM const*, int) + 83 (gerbview_ painter. cpp:160) VIEW::updateIte mGeometry( KIGFX:: VIEW_ITEM* , int) + 554 (view.cpp:1169) VIEW::invalidat eItem(KIGFX: :VIEW_ITEM* , int) + 336 (view.cpp:1099) VIEW::UpdateIte ms() + 503 (view.cpp:1286) PANEL_GAL: :onPaint( wxPaintEvent& ) + 297 (draw_panel_ gal.cpp: 168) 3.0.0.4. 0.dylib 0x000000010350fd96 wxAppConsoleBas e::HandleEvent( wxEvtHandler* , void (wxEvtHandler: :*)(wxEvent& ), wxEvent&) const + 134 (appbase.cpp:612) 3.0.0.4. 0.dylib 0x000000010350fe35 wxAppConsoleBas e::CallEventHan dler(wxEvtHandl er*, wxEventFunctor&, wxEvent&) const + 149 (appbase.cpp:623) 3.0.0.4. 0.dylib 0x00000001037361fc wxEvtHandler: :ProcessEventIf MatchesId( wxEventTableEnt ryBase const&, wxEvtHandler*, wxEvent&) + 220 (event.cpp:1396) 3.0.0.4. 0.dylib 0x000000010373875f wxEvtHandler: :SearchDynamicE ventTable( wxEvent& ) + 335 (event.cpp:1754) 3.0.0.4. 0.dylib 0x000000010373853d wxEvtHandler: :TryHereOnly( wxEvent& ) + 77 (event.cpp:1588) 3.0.0.4. 0.dylib 0x00000001037382ad wxEvtHandler: :TryBeforeAndHe re(wxEvent& ) + 77 (event.h:3680) 3.0.0.4. 0.dylib 0x00000001037382ef wxEvtHandler: :ProcessEventLo cally(wxEvent& ) + 47 (event.cpp:1525) 3.0.0.4. 0.dylib 0x000000010373818e wxEvtHandler: :ProcessEvent( wxEvent& ) + 318 (event.cpp:1498) 3.0.0.4. 0.dylib 0x0000000103737c81 wxEvtHandler: :ProcessPending Events( ) + 1377 (event.cpp:1362) 3.0.0.4. 0.dylib 0x000000010350f21c wxAppConsoleBas e::ProcessPendi ngEvents( ) + 316 (appbase.cpp:522) :ProcessEvent( TOOL_EVENT const&) + 307 (tool_manager. cpp:755) SELECTION_ TOOL::clearSele ction() + 495 (selection_ tool.cpp: 617) SELECTION_ TOOL::Main( TOOL_EVENT const&) + 1209 (selection_ tool.cpp: 241) compatible with 2.8) GRAPHICS_ CONTEXT= ON _MODULES= OFF _WXPYTHON= OFF _ACTION_ MENU=OFF PLUGIN= ON /bugs.launchpad .net/kicad/ +bug/1744600/ +subscriptions
>
> The attached patch could be better:
> It moves m_toolManager-
> (We already have an issue with events fired after a frame was close)
>
> ** Patch added: "gerbview_
> https:/
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https:/
>
> Title:
> Assertion failure quitting gerbview
>
> Status in KiCad:
> Fix Committed
>
> Bug description:
> Open a gerber.
> Click to select a pad.
> Close document.
> Assertion failure.
>
> Is there any reason we allow selection in gerbveiw? It doesn't seem
> to have a purpose....
>
> Assertion failed: (IsMapped()), function Allocate, file
> /Users/
> line 108.
>
> Thread 0 Crashed:: Dispatch queue: com.apple.
> 0 libsystem_
> 1 libsystem_
> 2 libsystem_c.dylib 0x00007fff6943b312 abort + 127
> 3 libsystem_c.dylib 0x00007fff69403368 __assert_rtn + 320
> 4 _gerbview.kiface 0x0000000109299acd KIGFX::
> 5 _gerbview.kiface 0x00000001092a8084 KIGFX::
> 6 _gerbview.kiface 0x00000001092690bf KIGFX::
> 7 _gerbview.kiface 0x0000000108fb74b2 KIGFX::
> 8 _gerbview.kiface 0x0000000108fb6c9c KIGFX::
> 9 _gerbview.kiface 0x0000000108fb5df3 KIGFX::
> 10 _gerbview.kiface 0x00000001091241ca KIGFX::
> 11 _gerbview.kiface 0x0000000109123b20 KIGFX::
> 12 _gerbview.kiface 0x00000001091250b7 KIGFX::
> 13 _gerbview.kiface 0x0000000109234c89 EDA_DRAW_
> 14 libwx_baseu-
> 15 libwx_baseu-
> 16 libwx_baseu-
> 17 libwx_baseu-
> 18 libwx_baseu-
> 19 libwx_baseu-
> 20 libwx_baseu-
> 21 libwx_baseu-
> 22 libwx_baseu-
> 23 libwx_baseu-
> 24 _gerbview.kiface 0x0000000109176103 TOOL_MANAGER:
> 25 _gerbview.kiface 0x0000000108fbbedf GERBVIEW_
> 26 _gerbview.kiface 0x0000000108fbc3a9 GERBVIEW_
>
> Application: kicad
> Version: (2018-01-21 revision ba1fe4517)-master, debug build
> Libraries:
> wxWidgets 3.0.4
> libcurl/7.54.0 LibreSSL/2.0.20 zlib/1.2.11 nghttp2/1.24.0
> Platform: Mac OS X (Darwin 17.3.0 x86_64), 64 bit, Little endian, wxMac
> Build Info:
> wxWidgets: 3.0.4 (UTF-8,STL containers,
> Boost: 1.65.1
> Curl: 7.57.0
> Compiler: Clang 9.0.0 with C++ ABI 1002
>
> Build settings:
> USE_WX_
> USE_WX_OVERLAY=ON
> KICAD_SCRIPTING=OFF
> KICAD_SCRIPTING
> KICAD_SCRIPTING
> KICAD_SCRIPTING
> BUILD_GITHUB_
> KICAD_USE_OCE=OFF
> KICAD_SPICE=OFF
>
> To manage notifications about this bug go to:
> https:/