footprint editor segfault on copy multi item

Bug #1832331 reported by Martin Thomas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Critical
Seth Hillbrand

Bug Description

- I select 3 lines by pressing shift and select it with the mouse
- I pressed Strg C
- I pressed Strg V

=> kicad crashed

Application: KiCad
Version: (5.1.0-892-gd81f4c837), debug build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.52.1 GnuTLS/3.5.8 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 5.1.3-mt 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.62.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=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=OFF

[New Thread 0x7fffd1182700 (LWP 985)]
[Thread 0x7fffe2601700 (LWP 983) exited]
[New Thread 0x7fffe2601700 (LWP 986)]
[Thread 0x7fffd1182700 (LWP 985) exited]
[Thread 0x7fffe2601700 (LWP 986) exited]
[New Thread 0x7fffe2601700 (LWP 987)]
[Thread 0x7fffe2601700 (LWP 987) exited]
/home/mthomas/daten/git/kicad/kicad-source-mirror/pcbnew/class_module.cpp(293): assert "Assert failure" failed in Remove(): MODULE::Remove() needs work: BOARD_ITEM type (1561502560) not handled
/home/mthomas/daten/git/kicad/kicad-source-mirror/pcbnew/class_module.cpp(293): assert "Assert failure" failed in Remove(): MODULE::Remove() needs work: BOARD_ITEM type (1563120624) not handled

Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
0x00007fffda90ae84 in EDA_ITEM::Type (this=0x0) at /home/mthomas/daten/git/kicad/kicad-source-mirror/include/base_struct.h:199
199 return m_StructType;
(gdb) backtrace
#0 0x00007fffda90ae84 in EDA_ITEM::Type (this=0x0) at /home/mthomas/daten/git/kicad/kicad-source-mirror/include/base_struct.h:199
#1 0x00007fffdb026275 in MODULE::Remove (this=0x5555597bd120, aBoardItem=0x0)
    at /home/mthomas/daten/git/kicad/kicad-source-mirror/pcbnew/class_module.cpp:270
#2 0x00007fffdac5674b in PCBNEW_CONTROL::Paste (this=0x555559806c60, aEvent=...)
    at /home/mthomas/daten/git/kicad/kicad-source-mirror/pcbnew/tools/pcbnew_control.cpp:725
#3 0x00007fffdac5ff30 in std::__invoke_impl<int, int (PCBNEW_CONTROL::* const&)(TOOL_EVENT const&), PCBNEW_CONTROL*&, TOOL_EVENT const&> (__f=
    @0x55555d1123c0: (int (PCBNEW_CONTROL::*)(PCBNEW_CONTROL * const, const TOOL_EVENT &)) 0x7fffdac561f2 <PCBNEW_CONTROL::Paste(TOOL_EVENT const&)>, __t=@0x55555d1123d0: 0x555559806c60, __args#0=...) at /usr/include/c++/6/functional:227
#4 0x00007fffdac5fd46 in std::__invoke<int (PCBNEW_CONTROL::* const&)(TOOL_EVENT const&), PCBNEW_CONTROL*&, TOOL_EVENT const&> (
    __fn=
    @0x55555d1123c0: (int (PCBNEW_CONTROL::*)(PCBNEW_CONTROL * const, const TOOL_EVENT &)) 0x7fffdac561f2 <PCBNEW_CONTROL::Paste(TOOL_EVENT const&)>, __args#0=@0x55555d1123d0: 0x555559806c60, __args#1=...) at /usr/include/c++/6/functional:251
#5 0x00007fffdac5fc2f in std::_Mem_fn_base<int (PCBNEW_CONTROL::*)(TOOL_EVENT const&), true>::operator()<PCBNEW_CONTROL*&, TOOL_EVENT const&> (this=0x55555d1123c0, __args#0=@0x55555d1123d0: 0x555559806c60, __args#1=...) at /usr/include/c++/6/functional:604
#6 0x00007fffdac5fb15 in std::_Bind<std::_Mem_fn<int (PCBNEW_CONTROL::*)(TOOL_EVENT const&)> (PCBNEW_CONTROL*, std::_Placeholder<1>)>::__call<int, TOOL_EVENT const&, 0ul, 1ul>(std::tuple<TOOL_EVENT const&>&&, std::_Index_tuple<0ul, 1ul>) (this=0x55555d1123c0,
    __args=<unknown type in /usr/local/bin/_pcbnew.kiface, CU 0x36069c7, DIE 0x3674484>) at /usr/include/c++/6/functional:934
#7 0x00007fffdac5f8bd in std::_Bind<std::_Mem_fn<int (PCBNEW_CONTROL::*)(TOOL_EVENT const&)> (PCBNEW_CONTROL*, std::_Placeholder<1>)>::operator()<TOOL_EVENT const&, int>(TOOL_EVENT const&) (this=0x55555d1123c0, __args#0=...) at /usr/include/c++/6/functional:993
#8 0x00007fffdac5f18a in std::_Function_handler<int (TOOL_EVENT const&), std::_Bind<std::_Mem_fn<int (PCBNEW_CONTROL::*)(TOOL_EVENT const&)> (PCBNEW_CONTROL*, std::_Placeholder<1>)> >::_M_invoke(std::_Any_data const&, TOOL_EVENT const&) (__functor=..., __args#0=...)
    at /usr/include/c++/6/functional:1717
#9 0x00007fffdb2dd559 in std::function<int (TOOL_EVENT const&)>::operator()(TOOL_EVENT const&) const (this=0x55555776c1b8,
    __args#0=...) at /usr/include/c++/6/functional:2127
#10 0x00007fffdb2da68b in COROUTINE<int, TOOL_EVENT const&>::callerStub (aData=140737488338992)
    at /home/mthomas/daten/git/kicad/kicad-source-mirror/include/tool/coroutine.h:331
#11 0x00007fffdb3378e1 in make_fcontext () from /usr/local/bin/_pcbnew.kiface
#12 0x0000000000000000 in ?? ()

Tags: pcbnew
Revision history for this message
Martin Thomas (mtlaunchpad) wrote :

A video to explain what I did.

tags: added: pcbnew
Revision history for this message
Martin Thomas (mtlaunchpad) wrote :

Maybe it is related to #1832178. Currently I can not compile the last recent version. Thus I can not check if the bug is fixes already.

kicad-source-mirror/pcbnew/router/length_tuner_tool.cpp:55:68: error: no matching function for call to ‘TOOL_ACTION::TOOL_ACTION(const char [29], TOOL_ACTION_SCOPE, wxKeyCode, const wxString&, const wxString&)’
         _( "End Track" ), _( "Stops laying the current meander." ) );

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

Same here. It looks like one of the latest commits broke something. I'm using clang as my compilers so it does not appear to be compiler dependent.

Changed in kicad:
status: New → Triaged
importance: Undecided → Critical
milestone: none → 6.0.0-rc1
Revision history for this message
Seth Hillbrand (sethh) wrote :

The builds should be working now. Jeff just pushed a fix.

I cannot recreate the crash. I suspect it was fixed in a recent commit.

Application: ModEdit
Version: (5.1.0-940-gb9e07f2a7), debug 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) 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:
    USE_WX_GRAPHICS_CONTEXT=OFF
    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

Changed in kicad:
status: Triaged → Incomplete
Revision history for this message
Martin Thomas (mtlaunchpad) wrote :

I can compile now and kicad still crashes, when I copy e.g. a Silk line.

Application: KiCad
Version: (5.1.0-943-g51af86d02), debug build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.52.1 GnuTLS/3.5.8 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 5.1.3-mt 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.62.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
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=OFF

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

Can you attach the footprint that you are using?

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

Nevermind, I just found the crash.

Changed in kicad:
assignee: nobody → Seth Hillbrand (sethh)
status: Incomplete → In Progress
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 32052d953f99f59bca997dea2dd8e324e51368e2
https://git.launchpad.net/kicad/patch/?id=32052d953f99f59bca997dea2dd8e324e51368e2

Changed in kicad:
status: In Progress → Fix Committed
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.