Skip to content

Pcbnew: Segmentation fault when cancelling item duplication

Description

Steps to reproduce

  1. Load attached project test.zip (any other project will probably do, too) in Pcbnew
  2. Select everything
  3. Duplicate everything (press Ctrl+D)
  4. Hit 'Esc' key while moving the duplicate objects

(This isn't 100% reproducible, so repeat a few times if necessary)

Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
0x00007faa78ea8cf6 in __dynamic_cast () from /lib64/libstdc++.so.6
(gdb) bt
#0  0x00007faa78ea8cf6 in __dynamic_cast () from /lib64/libstdc++.so.6
#1  0x00007faa4e98e8dd in KIGFX::PCB_VIEW::Update (this=0x1ea3ee0, aItem=0x4e9c270, aUpdateFlags=1) at /home/jh/CLionProjects/kicad/pcbnew/pcb_view.cpp:94
#2  0x00007faa4ec9159a in KIGFX::VIEW::Hide (this=0x1ea3ee0, aItem=0x4e9c270, aHide=true) at /home/jh/CLionProjects/kicad/common/view/view.cpp:1497
#3  0x00007faa4e3cdd48 in PCB_SELECTION_TOOL::highlightInternal (this=0x413ee80, aItem=0x4e9c270, aMode=2048, aUsingOverlay=true) at /home/jh/CLionProjects/kicad/pcbnew/tools/pcb_selection_tool.cpp:2162
#4  0x00007faa4e3cdbe8 in PCB_SELECTION_TOOL::highlight (this=0x413ee80, aItem=0x4e9c270, aMode=2048, aGroup=0x413f090) at /home/jh/CLionProjects/kicad/pcbnew/tools/pcb_selection_tool.cpp:2144
#5  0x00007faa4e3cdb4f in PCB_SELECTION_TOOL::select (this=0x413ee80, aItem=0x4e9c270) at /home/jh/CLionProjects/kicad/pcbnew/tools/pcb_selection_tool.cpp:2129
#6  0x00007faa4e3c9220 in PCB_SELECTION_TOOL::SelectItems (this=0x413ee80, aEvent=...) at /home/jh/CLionProjects/kicad/pcbnew/tools/pcb_selection_tool.cpp:943
#7  0x00007faa4e3e2ba6 in std::__invoke_impl<int, int (PCB_SELECTION_TOOL::*&)(TOOL_EVENT const&), PCB_SELECTION_TOOL*&, TOOL_EVENT const&> (__f=@0x4859350: (int (PCB_SELECTION_TOOL::*)(PCB_SELECTION_TOOL * const, const TOOL_EVENT &)) 0x7faa4e3c9190 <PCB_SELECTION_TOOL::SelectItems(TOOL_EVENT const&)>, __t=@0x4859360: 0x413ee80) at /usr/include/c++/10/bits/invoke.h:73
#8  0x00007faa4e3e2969 in std::__invoke<int (PCB_SELECTION_TOOL::*&)(TOOL_EVENT const&), PCB_SELECTION_TOOL*&, TOOL_EVENT const&> (__fn=@0x4859350: (int (PCB_SELECTION_TOOL::*)(PCB_SELECTION_TOOL * const, const TOOL_EVENT &)) 0x7faa4e3c9190 <PCB_SELECTION_TOOL::SelectItems(TOOL_EVENT const&)>) at /usr/include/c++/10/bits/invoke.h:95
#9  0x00007faa4e3e2363 in std::_Bind<int (PCB_SELECTION_TOOL::*(PCB_SELECTION_TOOL*, std::_Placeholder<1>))(TOOL_EVENT const&)>::__call<int, TOOL_EVENT const&, 0ul, 1ul>(std::tuple<TOOL_EVENT const&>&&, std::_Index_tuple<0ul, 1ul>) (this=0x4859350, __args=...) at /usr/include/c++/10/functional:416
#10 0x00007faa4e3e1b1f in std::_Bind<int (PCB_SELECTION_TOOL::*(PCB_SELECTION_TOOL*, std::_Placeholder<1>))(TOOL_EVENT const&)>::operator()<TOOL_EVENT const&, int>(TOOL_EVENT const&) (this=0x4859350) at /usr/include/c++/10/functional:499
#11 0x00007faa4e3e0be3 in std::__invoke_impl<int, std::_Bind<int (PCB_SELECTION_TOOL::*(PCB_SELECTION_TOOL*, std::_Placeholder<1>))(TOOL_EVENT const&)>&, TOOL_EVENT const&>(std::__invoke_other, std::_Bind<int (PCB_SELECTION_TOOL::*(PCB_SELECTION_TOOL*, std::_Placeholder<1>))(TOOL_EVENT const&)>&, TOOL_EVENT const&) (__f=...) at /usr/include/c++/10/bits/invoke.h:60
#12 0x00007faa4e3dfa32 in std::__invoke_r<int, std::_Bind<int (PCB_SELECTION_TOOL::*(PCB_SELECTION_TOOL*, std::_Placeholder<1>))(TOOL_EVENT const&)>&, TOOL_EVENT const&>(std::_Bind<int (PCB_SELECTION_TOOL::*(PCB_SELECTION_TOOL*, std::_Placeholder<1>))(TOOL_EVENT const&)>&, TOOL_EVENT const&) (__fn=...) at /usr/include/c++/10/bits/invoke.h:141
#13 0x00007faa4e3dd679 in std::_Function_handler<int (TOOL_EVENT const&), std::_Bind<int (PCB_SELECTION_TOOL::*(PCB_SELECTION_TOOL*, std::_Placeholder<1>))(TOOL_EVENT const&)> >::_M_invoke(std::_Any_data const&, TOOL_EVENT const&) (__functor=..., __args#0=...) at /usr/include/c++/10/bits/std_function.h:291
#14 0x00007faa4ecfe2b1 in std::function<int (TOOL_EVENT const&)>::operator()(TOOL_EVENT const&) const (this=0x4a41f50, __args#0=...) at /usr/include/c++/10/bits/std_function.h:622
#15 0x00007faa4ecfb6f2 in COROUTINE<int, TOOL_EVENT const&>::callerStub (aData=99510800) at /home/jh/CLionProjects/kicad/include/tool/coroutine.h:351
#16 0x00007faa4ed9f331 in make_fcontext () from /home/jh/CLionProjects/kicad/cmake-build-debug/pcbnew/_pcbnew.kiface
#17 0x0000000000000000 in ?? ()

KiCad Version

Application: KiCad

Version: (5.99.0-9829-g074f0432f0), debug build

Libraries:
	wxWidgets 3.1.4
	libcurl/7.71.1 OpenSSL/1.1.1j-fips zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.1 (+libidn2/2.3.0) libssh/0.9.5/openssl/zlib nghttp2/1.43.0

Platform: Linux 5.10.21-200.fc33.x86_64 x86_64, 64 bit, Little endian, wxGTK, gnome, wayland

Build Info:
	Date: Mar 18 2021 14:28:58
	wxWidgets: 3.1.4 (wchar_t,wx containers) GTK+ 3.24
	Boost: 1.73.0
	Curl: 7.71.1
	ngspice: 33
	Compiler: GCC 10.2.1 with C++ ABI 1014

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
	KICAD_SPICE=ON
	KICAD_STDLIB_DEBUG=OFF
	KICAD_STDLIB_LIGHT_DEBUG=OFF
	KICAD_SANITIZE=OFF
Edited by Jonathan Haas