Segfault when closing sub application - Log remains active

Bug #1837121 reported by Seth Hillbrand
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Unknown

Bug Description

I had libedit, eeschema, pcbnew and modedit all open. I saved the schematic and closed libedit then eeschema by clicking the "X" button on the window bar.

Here is the backtrace. pcbnew and modedit remained open as was the main KiCad window.

#0 0x00007ffff73d943f in wxLog::FlushActive() () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
(gdb) bt
#0 0x00007ffff73d943f in wxLog::FlushActive() () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#1 0x00007ffff73411b9 in wxAppConsoleBase::ProcessIdle() () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#2 0x00007ffff78f41e4 in wxAppBase::ProcessIdle() () at /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#3 0x00007ffff782f9e5 in wxApp::DoIdle() () at /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#4 0x00007ffff782fad3 in () at /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#5 0x00007ffff5908dd8 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#6 0x00007ffff59091c8 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#7 0x00007ffff59094c2 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#8 0x00007ffff5f19b15 in gtk_main () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#9 0x00007ffff784c1d5 in wxGUIEventLoop::DoRun() () at /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#10 0x00007ffff737d48d in wxEventLoopBase::Run() () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#11 0x00007ffff7346616 in wxAppConsoleBase::MainLoop() () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#12 0x0000555555611ea0 in APP_KICAD::OnRun() (this=0x5555558ee530) at ../../kicad/kicad.cpp:261
#13 0x00007ffff73c7cf9 in wxEntry(int&, wchar_t**) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#14 0x00005555556108dd in main(int, char**) (argc=1, argv=0x7fffffffe108) at ../../kicad/kicad.cpp:292

Application: KiCad
Version: (5.1.0-1313-ga1f16f368), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1c zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Platform: Linux 4.19.0-5-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.0
    Compiler: GCC 8.3.0 with C++ ABI 1013

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_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Tags: eeschema
tags: added: eeschema
Revision history for this message
Seth Hillbrand (sethh) wrote :

Possibly related. Again on closing. This time closing pcbnew. Logging seems to be held open past the pointer expiration. Possibly only when running in debug.

Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
0x00007ffff73d53be in wxLog::SetActiveTarget(wxLog*) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
(gdb) bt
#0 0x00007ffff73d53be in wxLog::SetActiveTarget(wxLog*) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#1 0x00007ffff73c6878 in wxEntryCleanup() () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#2 0x00007fffd46aa322 in () at /usr/lib/python3/dist-packages/wx/_core.cpython-37m-x86_64-linux-gnu.so
#3 0x00007fffebd23ad4 in PyCFunction_Call () at /usr/lib/x86_64-linux-gnu/libpython3.7m.so.1.0
#4 0x00007fffebba3e2d in () at /usr/lib/x86_64-linux-gnu/libpython3.7m.so.1.0
#5 0x00007fffebc25577 in Py_FinalizeEx () at /usr/lib/x86_64-linux-gnu/libpython3.7m.so.1.0
#6 0x00007fffd58a09d9 in pcbnewFinishPythonScripting() () at ../../pcbnew/swig/python_scripting.cpp:317
#7 0x00007fffd525fcd4 in PCB::IFACE::OnKifaceEnd() (this=0x7fffd67852a0 <PCB::kiface>) at ../../pcbnew/pcbnew.cpp:375
#8 0x000055555566d306 in KIWAY::OnKiwayEnd() (this=0x555555854f40 <Kiway>) at ../../common/kiway.cpp:522
#9 0x0000555555610862 in PGM_KICAD::OnPgmExit() (this=0x555555855360 <program>) at ../../kicad/kicad.cpp:170
#10 0x0000555555611e6e in APP_KICAD::OnExit() (this=0x5555558ee530) at ../../kicad/kicad.cpp:247
#11 0x00007ffff73c7d09 in wxEntry(int&, wchar_t**) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#12 0x00005555556108dd in main(int, char**) (argc=1, argv=0x7fffffffe108) at ../../kicad/kicad.cpp:292

Changed in kicad:
importance: Undecided → Critical
milestone: none → 6.0.0-rc1
Revision history for this message
Jeff Young (jeyjey) wrote :

@Devs, has anyone else seen this?

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I cannot duplicate this. I'm assuming that all of the windows were opened using the KiCad launcher. If that is not the case, then maybe that has something to do with the bug.

Application: KiCad
Version: (5.1.0-1429-gfb3aa446e), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.65.1 OpenSSL/1.1.1c zlib/1.2.11 libidn2/2.2.0 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.37.0 librtmp/2.3
Platform: Linux 4.19.0-5-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.62.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.65.1
    Compiler: Clang 7.0.1 with C++ ABI 1002

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_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Seth Hillbrand (sethh) wrote :

I'm going to tentatively mark this as fixed as I can not longer reproduce it. It may be related to the other crashes on exit we are seeing but I'm not 100% on that. If I see it again, I'll re-open.

Changed in kicad:
status: New → Fix Committed
Revision history for this message
Seth Hillbrand (sethh) wrote :

OK, that didn't take long. Re-opening as we have a backtrace on MacOS that shows the same crash path in the duplicate

Changed in kicad:
status: Fix Committed → Confirmed
summary: - Segfault when closing Eeschema
+ Segfault when closing sub application - Log remains active
Revision history for this message
Seth Hillbrand (sethh) wrote :

Similar crash again. This time while working in eeschema. Eeschema running in the background and noticed the crash when I came back to it.

Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
(gdb) info thread
  Id Target Id Frame
* 1 Thread 0x7ffff1f8dcc0 (LWP 4340) "kicad" 0x000055555561291d in main (argc=1, argv=0x7fffffffe108) at ../../kicad/kicad.cpp:292
  2 Thread 0x7ffff1c28700 (LWP 4364) "gmain" 0x00007ffff64bd819 in __GI___poll (fds=0x555555bc2e60, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
  3 Thread 0x7ffff1427700 (LWP 4365) "gdbus" 0x00007ffff64bd819 in __GI___poll (fds=0x555555bd5820, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
  291 Thread 0x7fffad1cd700 (LWP 8806) "pool" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
(gdb) bt
#0 0x00007ffff73d8449 in wxLog::FlushActive() () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#1 0x00007ffff73401b9 in wxAppConsoleBase::ProcessIdle() () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#2 0x00007ffff78f31e4 in wxAppBase::ProcessIdle() () at /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#3 0x00007ffff782e9e5 in wxApp::DoIdle() () at /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#4 0x00007ffff782ead3 in () at /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#5 0x00007ffff5907dd8 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#6 0x00007ffff59081c8 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#7 0x00007ffff59084c2 in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#8 0x00007ffff5f18b15 in gtk_main () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#9 0x00007ffff784b1d5 in wxGUIEventLoop::DoRun() () at /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#10 0x00007ffff737c48d in wxEventLoopBase::Run() () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#11 0x00007ffff7345616 in wxAppConsoleBase::MainLoop() () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#12 0x0000555555613ee0 in APP_KICAD::OnRun() (this=0x5555558f6530) at ../../kicad/kicad.cpp:261
#13 0x00007ffff73c6cf9 in wxEntry(int&, wchar_t**) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#14 0x000055555561291d in main(int, char**) (argc=1, argv=0x7fffffffe108) at ../../kicad/kicad.cpp:292

Revision history for this message
Jeff Young (jeyjey) wrote :

@Seth, I committed a change a few days ago that scopes when we push our own logger on to the stack. I don't know if this is related, but I'm going to mark this as Incomplete until we see it again.

Changed in kicad:
status: Confirmed → Incomplete
Revision history for this message
Seth Hillbrand (sethh) wrote :

Sounds good. Thanks, Jeff! I haven't seen this error in about a week

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

KiCad bug tracker has moved to Gitlab. This report is now available here: https://gitlab.com/kicad/code/kicad/-/issues/1751

Changed in kicad:
status: Incomplete → Expired
Changed in kicad:
importance: Critical → Unknown
status: Expired → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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