Segfault in CVPCB

Bug #1828289 reported by Frank Severinsen
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Critical
Jeff Young

Bug Description

Hi guys

When scrolling in CVPCB I have now experienced a crash 2 times.

I have the footprint viewer open and scrolled through a library.

When trying the second time through GDB I simply get:
Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
0x00007fff8f709285 in ?? () from /usr/bin/_cvpcb.kiface
(gdb) bt
#0 0x00007fff8f709285 in () at /usr/bin/_cvpcb.kiface

ofc, the second I closed the screen recorder I got the crash.

Application: kicad
Version: 5.1.2-f72e74a~84~ubuntu19.04.1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1b zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.8.6/openssl/zlib nghttp2/1.36.0 librtmp/2.3
Platform: Linux 5.0.0-13-generic 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:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=ON
    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
Jon Evans (craftyjon)
Changed in kicad:
importance: Undecided → Critical
Revision history for this message
Jon Evans (craftyjon) wrote :

Hi Frank,
Do you use KiCad from the Ubuntu PPA?
If so, can you install the `kicad-dbg` package?
This will make the backtrace more useful.
Thanks

Revision history for this message
Frank Severinsen (shack) wrote :

Sure thing. Ill try it later

Revision history for this message
Frank Severinsen (shack) wrote :
Download full text (5.1 KiB)

@Jon
I hope this is more useful

Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
CVPCB_MAINFRAME::CreateScreenCmp (this=0x55555a1b59b0) at ./kicad/cvpcb/cvpcb_mainframe.cpp:819
819 ./kicad/cvpcb/cvpcb_mainframe.cpp: Ingen sådan fil eller filkatalog.
(gdb) bt
#0 0x00007fffbcef8285 in CVPCB_MAINFRAME::CreateScreenCmp() (this=0x55555a1b59b0) at ./kicad/cvpcb/cvpcb_mainframe.cpp:819
#1 0x00007fffbcef5a5f in FOOTPRINTS_LISTBOX::OnLeftClick(wxListEvent&) (event=..., this=0x55555c8d6c10) at ./kicad/cvpcb/footprints_listbox.cpp:218
#2 0x00007fffbcef5a5f in FOOTPRINTS_LISTBOX::OnLeftClick(wxListEvent&) (this=0x55555c8d6c10, event=...) at ./kicad/cvpcb/footprints_listbox.cpp:205
#3 0x00007ffff74f6a8e in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#4 0x00007ffff74f6b93 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#5 0x00007ffff74f6ecc in wxEvtHandler::TryHereOnly(wxEvent&) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#6 0x00007ffff74f6f53 in wxEvtHandler::ProcessEventLocally(wxEvent&) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#7 0x00007ffff74f6ff1 in wxEvtHandler::ProcessEvent(wxEvent&) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#8 0x00007ffff7a94f6d in wxScrollHelperEvtHandler::ProcessEvent(wxEvent&) () at /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#9 0x00007ffff78b9680 in () at /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#10 0x00007ffff78baaef in () at /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#11 0x00007ffff78bc0dc in () at /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#12 0x00007ffff78bd98f in () at /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#13 0x00007ffff74f6a8e in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#14 0x00007ffff74f6b93 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#15 0x00007ffff74f6ecc in wxEvtHandler::TryHereOnly(wxEvent&) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#16 0x00007ffff74f6f53 in wxEvtHandler::ProcessEventLocally(wxEvent&) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#17 0x00007ffff74f6ff1 in wxEvtHandler::ProcessEvent(wxEvent&) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#18 0x00007ffff74f6d97 in wxEvtHandler::SafelyProcessEvent(wxEvent&) () at /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#19 0x00007ffff78a3b88 in () at /usr/lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0
#20 0x00007ffff6a0544b in () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#21 0x00007ffff64f4e7d in g_closure_invoke () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#22 0x00007ffff6508535 in () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#23 0x00007ffff6510b5b in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#24 0x00007ffff6511b2f in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#25 0x00007ffff69b21f4 in () at /usr/lib/x86_64-linux-gnu/libgtk-3...

Read more...

Revision history for this message
Frank Severinsen (shack) wrote :

my steps to reproduce.

open kicad
open a schematic
open CVPCB
select "view selected footprint"
select one of the filtered footprints.
now press down arrow (as going through the list)
after a few it freezes/dies

Revision history for this message
Jon Evans (craftyjon) wrote :

@Jeff
Maybe 4020b568 is relevant here?

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

Could be a null pointer (ie: no object had focus)? Hopefully it's not a freed pointer or trashed memory...

Revision history for this message
Frank Severinsen (shack) wrote :

@Jeff please let me know if I can do anything to help

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

I can't reproduce this, but I've inserted some defensive code which may (or may not) fix it.

tags: added: eeschema
Revision history for this message
Frank Severinsen (shack) wrote :

Hi Jeff, where did insert the code? And can you also add it to 5.1 branch? (perhaps this should be milestoned for 5.1.3

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

commit 717b1d37bed647ef9dfe6258554ee5f51f999d6b
Author: Jeff Young <email address hidden>
Date: Fri May 10 19:59:44 2019 +0100

    Defensive coding that will possibly fix a crash when scrolling through footprints.

    Fixes: lp:1828289
    * https://bugs.launchpad.net/kicad/+bug/1828289

diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp
index 19b480600..126c3e0fe 100644
--- a/cvpcb/cvpcb_mainframe.cpp
+++ b/cvpcb/cvpcb_mainframe.cpp
@@ -816,7 +816,8 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
         fpframe->Raise(); // Make sure that is visible.
         Raise(); // .. but still we want the focus.

- focus->SetFocus();
+ if( focus )
+ focus->SetFocus();
     }

     fpframe->InitDisplay();

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

It's safe enough it should probably go into 5.1 whether it fixes the bug or not.

Changed in kicad:
milestone: none → 5.1.3
Jeff Young (jeyjey)
Changed in kicad:
assignee: nobody → Jeff Young (jeyjey)
status: New → In Progress
Jeff Young (jeyjey)
Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Frank Severinsen (shack) wrote :

Hi Jeff this seems to fix the issue, Thank you very much!

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.