Comment 12 for bug 1744600

Revision history for this message
Jeff Young (jeyjey) wrote : Re: [Bug 1744600] Re: Assertion failure quitting gerbview

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