Segfault when closing footprint editor with keyboard shortcut

Bug #1488808 reported by Blair Bonnett
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Critical
Maciej Suminski

Bug Description

Application: kicad
Version: (2015-08-25 BZR 6127)-product debug build
wxWidgets: Version 3.0.2 (debug,wchar_t,compiler with C++ ABI 1009,GCC 5.2.0,wx containers,compatible with 2.8)
Platform: Linux 4.1.5-1-ARCH x86_64, 64 bit, Little endian, wxGTK
Boost version: 1.58.0
         USE_WX_GRAPHICS_CONTEXT=OFF
         USE_WX_OVERLAY=OFF
         KICAD_SCRIPTING=ON
         KICAD_SCRIPTING_MODULES=ON
         KICAD_SCRIPTING_WXPYTHON=ON
         USE_FP_LIB_TABLE=HARD_CODED_ON
         BUILD_GITHUB_PLUGIN=ON

--------------------------------------------------

I'm getting a segfault when I close the footprint editor with the keyboard shortcut (Ctrl-Q for me). Doesn't matter whether its launched from the main KiCad window, or from within Pcbnew. Happens whether or not I've loaded a library/footprint, or close it as soon as it opens.

This does not occur if I use the File -> Close menu. To my inexperienced eyes, this behaviour and the traceback suggest something in the shortcut handler is doing some cleanup that the main close code does not expect to have already run.

This only occurs in GAL mode. I cannot get it to happen with Pcbnew, so it seems like something specific to the footprint editor.

First, an assert is triggered -- the traceback wxWidgets gives for the assert is:

ASSERT INFO
/home/blair/sources/kicad/product/common/gal/opengl/gpu_manager.cpp(153): assert "m_isDrawing" failed in EndDrawing().

BACKTRACE:
[1] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
[2] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[3] wxEvtHandler::SearchDynamicEventTable(wxEvent&)
[4] wxEvtHandler::TryHereOnly(wxEvent&)
[5] wxEvtHandler::ProcessEventLocally(wxEvent&)
[6] wxEvtHandler::ProcessEvent(wxEvent&)
[7] wxEvtHandler::ProcessPendingEvents()
[8] wxAppConsoleBase::ProcessPendingEvents()
[9] wxApp::DoIdle()
[10] g_main_context_dispatch
[11] g_main_loop_run
[12] gtk_main
[13] wxGUIEventLoop::DoRun()
[14] wxEventLoopBase::Run()
[15] wxAppConsoleBase::MainLoop()
[16] wxSizer::Insert(unsigned long, wxSizerItem*)
[17] wxEntry(int&, wchar_t**)
[18] __libc_start_main
[19] _start

Then the segfault occurs. Backtrace from the coredump is as follows:

Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f6d6d83dd96 in KIGFX::OPENGL_GAL::EndDrawing (this=0x2075520) at /home/blair/sources/kicad/product/common/gal/opengl/opengl_gal.cpp:226
226 delete clientDC;
(gdb) bt
#0 0x00007f6d6d83dd96 in KIGFX::OPENGL_GAL::EndDrawing (this=0x2075520) at /home/blair/sources/kicad/product/common/gal/opengl/opengl_gal.cpp:226
#1 0x00007f6d6d81b387 in EDA_DRAW_PANEL_GAL::onPaint (this=0x28d3b50) at /home/blair/sources/kicad/product/common/draw_panel_gal.cpp:162
#2 0x00007f6d79c6393e in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const () from /usr/lib/libwx_baseu-3.0.so.0
#3 0x00007f6d79dfb2e8 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#4 0x00007f6d79dfb6de in wxEvtHandler::SearchDynamicEventTable(wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#5 0x00007f6d79dfb76e in wxEvtHandler::TryHereOnly(wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#6 0x00007f6d79dfb833 in wxEvtHandler::ProcessEventLocally(wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#7 0x00007f6d79dfb895 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_baseu-3.0.so.0
#8 0x00007f6d79dfc2fa in wxEvtHandler::ProcessPendingEvents() () from /usr/lib/libwx_baseu-3.0.so.0
#9 0x00007f6d79c66987 in wxAppConsoleBase::ProcessPendingEvents() () from /usr/lib/libwx_baseu-3.0.so.0
#10 0x00007f6d7a302e52 in wxApp::DoIdle() () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#11 0x00007f6d7a302f43 in ?? () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#12 0x00007f6d77b2190d in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#13 0x00007f6d77b21ce0 in ?? () from /usr/lib/libglib-2.0.so.0
#14 0x00007f6d77b22002 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#15 0x00007f6d7888e467 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#16 0x00007f6d7a324485 in wxGUIEventLoop::DoRun() () from /usr/lib/libwx_gtk2u_core-3.0.so.0
#17 0x00007f6d79ca8c53 in wxEventLoopBase::Run() () from /usr/lib/libwx_baseu-3.0.so.0
#18 0x00007f6d79c67b46 in wxAppConsoleBase::MainLoop() () from /usr/lib/libwx_baseu-3.0.so.0
#19 0x000000000041c369 in APP_SINGLE_TOP::OnRun (this=<optimized out>) at /home/blair/sources/kicad/product/common/single_top.cpp:159
#20 0x00007f6d79cfe8f0 in wxEntry(int&, wchar_t**) () from /usr/lib/libwx_baseu-3.0.so.0
#21 0x0000000000415222 in main (argc=1, argv=<optimized out>) at /home/blair/sources/kicad/product/common/single_top.cpp:196

Related branches

Changed in kicad:
status: New → In Progress
assignee: nobody → Maciej Sumiński (orsonmmz)
Changed in kicad:
status: In Progress → Won't Fix
status: Won't Fix → Fix Committed
Jon Neal (reportingsjr)
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.