eeschema crash on exiting "symbol library browser" using ESC key

Bug #1829981 reported by Dino Ghilardi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Critical
Jeff Young

Bug Description

To reproduce the behaviour:
-Open eeschema
-Select View->symbol library browser
-press 'ESC' to cancel

then we have a segmentation fault.

Exiting the the symbol library browser closing the window does not have the issue.

-----------------------------------------------------------------
running in gdb the faults is:

Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
0x00007fffda451fed in std::operator-<EDA_ITEM*, EDA_ITEM*&, EDA_ITEM**> (
    __x=<error reading variable: Cannot access memory at address 0x108>,
    __y=<error reading variable: Cannot access memory at address 0xe8>)
    at /usr/include/c++/6/bits/stl_deque.h:354
354 * (__x._M_node - __y._M_node - 1) + (__x._M_cur - __x._M_first)

backtrace gives:

#0 0x00007fffda451fed in std::operator-<EDA_ITEM*, EDA_ITEM*&, EDA_ITEM**> (
    __x=<error reading variable: Cannot access memory at address 0x108>,
    __y=<error reading variable: Cannot access memory at address 0xe8>)
    at /usr/include/c++/6/bits/stl_deque.h:354
#1 0x00007fffda451bc1 in std::deque<EDA_ITEM*, std::allocator<EDA_ITEM*> >::size (this=0xd8)
    at /usr/include/c++/6/bits/stl_deque.h:1265
#2 0x00007fffda45191c in SELECTION::Front (this=0x98)
    at /home/dinoghi/SANDBOXKICAD5/src/kicad/include/tool/selection.h:157
#3 0x00007fffda45d7be in EE_CONDITIONS::<lambda(const SELECTION&)>::operator()(const SELECTION &) const (__closure=0x7fffdaff16c0 <EE_CONDITIONS::Idle>, aSelection=...)
    at /home/dinoghi/SANDBOXKICAD5/src/kicad/eeschema/tools/ee_selection_tool.cpp:93
#4 0x00007fffda463a64 in std::_Function_handler<bool(const SELECTION&), EE_CONDITIONS::<lambda(const SELECTION&)> >::_M_invoke(const std::_Any_data &, const SELECTION &) (__functor=...,
    __args#0=...) at /usr/include/c++/6/functional:1717
#5 0x00007fffda262367 in std::function<bool (SELECTION const&)>::operator()(SELECTION const&) const (this=0x7fffdaff16c0 <EE_CONDITIONS::Idle>, __args#0=...)
    at /usr/include/c++/6/functional:2127
#6 0x00007fffda34c918 in SCH_DRAW_PANEL::OnKeyEvent (this=0x555559d1e000, event=...)
    at /home/dinoghi/SANDBOXKICAD5/src/kicad/eeschema/sch_draw_panel.cpp:290
#7 0x00007ffff634440e in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#8 0x00007ffff64c9ea5 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#9 0x00007ffff64ca29d in wxEvtHandler::SearchDynamicEventTable(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#10 0x00007ffff64ca31f in wxEvtHandler::TryHereOnly(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#11 0x00007ffff64ca3d3 in wxEvtHandler::ProcessEventLocally(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#12 0x00007ffff64ca435 in wxEvtHandler::ProcessEvent(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#13 0x00007ffff6ec405b in wxScrollHelperEvtHandler::ProcessEvent(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
#14 0x00007ffff64ca1a7 in wxEvtHandler::SafelyProcessEvent(wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#15 0x00007ffff6c7544d in ?? () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0

-------------------------------------------------------------------
Version info:
Application: Eeschema
Version: (5.1.0-648-g06b22594c), debug build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.52.1 OpenSSL/1.0.2r zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
Platform: Linux 4.9.0-8-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.52.1
    Compiler: GCC 6.3.0 with C++ ABI 1010

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    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
------------------------------------------------------

Tested on commit 06b22594ca7fb460692db2187b86bd8075bd315b

cheers,
Dino.

Tags: eeschema
Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :
Changed in kicad:
importance: Undecided → Critical
milestone: none → 6.0.0-rc1
status: New → Triaged
Jeff Young (jeyjey)
Changed in kicad:
assignee: nobody → Jeff Young (jeyjey)
status: Triaged → In Progress
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 1f2bdf895e50d5a03d0681903e373cb157a0093c
https://git.launchpad.net/kicad/patch/?id=1f2bdf895e50d5a03d0681903e373cb157a0093c

Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Dino Ghilardi (dino-ghilardi) wrote :

Now it seems that ESC can not be used to close symbol library browser, but since that key is used for almost all other dialogs as shortcut for "cancel", I think it should be re-enabled in order to have a consistent behaviour between dialogs and viewers as "hierarchy navigator", "symbol browser", "bus definition", that can be closed using the ESC key.

tested on revision ba4ba5b6689eeb3dab2648115f43ad4d3b8ed790

Cheers,
Dino.

Revision history for this message
jean-pierre charras (jp-charras) wrote :

The Library Browser is *not* a dialog, and AFAIK was never closed by ESC

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

As it's a window (not a dialog), it's closed with cmd-Q (at least on OSX; not sure about other platforms).

Revision history for this message
Dino Ghilardi (dino-ghilardi) wrote :

I agree, it is not a dialog, but in my mind "ESC" is a shortcut to "cancel", and I find it useful and faster to use it to exit dialogs (or tools).
On a viewer may be it is better having also the ESC key available since there is no danger of loosing some data cancelling an operation.

Also I expect that a user is not used to think if the open "sub-window" is a dialog or a tool: ESC should do the same on every "window" it makes sense to (as in viewers where pressing it by mistake does not cause loss of work) (Yes, it is the same mistake I did considering it a dialog)

In eeschema in most of the "sub-windows" ("dialog" or "tools with the [cancel] button" in eeschema) ESC does the same: "dont'save and close window", so I'd like being able to close the symbol browser in this way too.

P.S., by the way,
tools->Assign footprints: has a cancel button but ESC does not close the window: it seems the shortcut is missing there: do you think I have to file a bug for that?

Cheers,
Dino.

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

@Dino, probably best to log a bug for Assign Footprints. It used to be a window, but is now a dialog, so <ESC> processing probably never got implemented for it.

Revision history for this message
Dino Ghilardi (dino-ghilardi) wrote :

Done, thanks.

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.