PCBNew /DRC : crash when right-clicking on error or unconnected item

Bug #1854453 reported by Jean Philippe Eimer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Undecided
Unassigned

Bug Description

Kicad 5.1.5/PCBNew DRC dialog : trying to enlight the problem (marker or unconnected) with a mouse right-click triggers an instant crash.

Find below the trace displayed in a Debug version :

ASSERT INFO:
../src/generic/vlbox.cpp(279): assert ""selection == (-1) || (selection >= 0 && (size_t)selection < GetItemCount())"" failed in SetSelection(): wxVListBox::SetSelection(): invalid item index

BACKTRACE:
[1] wxVListBox::SetSelection(int)
[2] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[3] wxEvtHandler::SearchDynamicEventTable(wxEvent&)
[4] wxEvtHandler::TryHereOnly(wxEvent&)
[5] wxEvtHandler::ProcessEventLocally(wxEvent&)
[6] wxEvtHandler::ProcessEvent(wxEvent&)
[7] wxVarScrollHelperEvtHandler::ProcessEvent(wxEvent&)
[8] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[9] g_closure_invoke
[10] g_signal_emit_valist
[11] g_signal_emit
[12] gtk_main_do_event
[13] g_main_context_dispatch
[14] g_main_loop_run
[15] gtk_main
[16] wxGUIEventLoop::DoRun()
[17] wxEventLoopBase::Run()
[18] wxAppConsoleBase::MainLoop()
[19] APP_SINGLE_TOP::OnRun() /home/phil/src/kicad-5.1.5/common/single_top.cpp:197
[20] wxEntry(int&, wchar_t**)
[21] main /home/phil/src/kicad-5.1.5/common/single_top.cpp:271
[22] __libc_start_main
[23] _start /usr/src/glibc-2.30/csu/../sysdeps/x86_64/start.S:122

----------------------
Application: KiCad
Version: 5.1.5-jpmr, release build
Libraries:
    wxWidgets 3.1.3
    libcurl/7.67.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.1.1)
Platform: Linux 5.3.12-jpmr x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.1.3 (wchar_t,wx containers) GTK+ 3.24
    Boost: 1.71.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.67.0
    Compiler: GCC 9.2.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

Revision history for this message
Jean Philippe Eimer (phileimer) wrote :

I could open the same project with the Ubuntu current version (5.1.4+dfsg1-1), and there's no crash here.
So, this bug may have been introduced in 5.1.5, or due to my custom build from sources.

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

I am unable to recreate this issue. Can you try with the 5.1.5 PPA version?

Application: Pcbnew
Version: (5.1.5-16-g61f593f35-dirty), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1d 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-6-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:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Changed in kicad:
status: New → Incomplete
tags: added: drc pcbnew
Revision history for this message
Jean Philippe Eimer (phileimer) wrote :

I confirm there's no crash with 5.1.5 PPA.
The main difference with my build seems to be wxWidgets version : 3.1.3 / 3.0.4.

Application: Pcbnew
Version: 5.1.5-52549c5~84~ubuntu19.10.1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.65.3 OpenSSL/1.1.1c zlib/1.2.11 libidn2/2.2.0 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.9.0/openssl/zlib nghttp2/1.39.2 librtmp/2.3
Platform: Linux 5.3.0-23-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.65.3
    Compiler: GCC 9.2.1 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

Revision history for this message
Ian McInerney (imcinerney) wrote :

Where are you pulling the 3.1.3 build from? I didn't think it existed in any source repos we build against.

Revision history for this message
Jean Philippe Eimer (phileimer) wrote :

I built wxWidgets 3.1.3 from sources, with the following configuration :

../configure --prefix=/usr --with-gtk=3 --enable-ipv6 --with-opengl --enable-graphics_ctx --enable-display --enable-geometry --enable-mediactrl --enable-sound --enable-webview --with-flavour=jpmr LDFLAGS=-Wl,--as-needed

Revision history for this message
Jean Philippe Eimer (phileimer) wrote :

I've rebuilt KiCAD 5.1.5 against a wxWidgets 3.0.4 built from sources, using the same configuration options than in my previous post.

The crash doesn't occur anymore.

So, it's a wxWidgets 3.1.3 problem.

Application: Pcbnew
Version: 5.1.5-jpmr, debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.67.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.1.1)
Platform: Linux 5.3.14-jpmr 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.71.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.67.0
    Compiler: GCC 9.2.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

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

Agreed. If you can report this to wxWidgets, please post the link back here so that we can track it.

Changed in kicad:
status: Incomplete → Invalid
Revision history for this message
Jean Philippe Eimer (phileimer) wrote :

I back ported a piece of Jean-Pierre Charras' recent patch :
https://git.launchpad.net/kicad/commit/?id=5cd7f3fdee950d424a13cf0eb71227fc606cbdab
and this fixes the bug also in Linux.

Attached is the simplified patch for 5.1.5.

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

@jp- Do you have thoughts on this proposed patch based on yours?

Changed in kicad:
status: Fix Committed → New
tags: added: wxwidgets
Revision history for this message
jean-pierre charras (jp-charras) wrote :

I confirm the wxWigets bug exists also in Linux version.

I just committed a fix similar to the master branch.

Changed in kicad:
status: New → Fix Committed
milestone: none → 5.1.6
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.