Copy/Paste from PCB to Footprint Editor crashes both
Description
Current: Cut/copy from PCB Editor and paste in Footprint Editor hangs/crashes both PCB Editor and Footprint Editor. Expected: Same operation in 7.0.2 works just fine.
Copying one or a few objects sometimes works, but any more consistently crashes. Attached is a simple .kicad_pcb file to reproduce the issue.
Steps to reproduce
- Open .kicad_pcb file
- "Tools->Footprint Editor"
- In Footprint Editor, "File->New Footprint"
- Specify footprint name and type, select "OK".
- In PCB Editor, select a single small graphic line.
- "Edit->Copy"
- In Footprint Editor, "Edit->Paste"
- The single graphic line usually pastes successfully.
- In PCB Editor, select multiple objects.
- "Edit->Copy"
- In Footprint Editor, "Edit->Paste"
- Mouse cursor changes to "move" symbol, then Footprint Editor and PCB Editor hang and crash/close several seconds later.
- PCB Editor will re-open and display "PCB is already open..." (pcb file was not closed gracefully)
KiCad Version
Application: KiCad x64 on x64
Version: 8.0.0-rc2, release build
Libraries:
wxWidgets 3.2.4
FreeType 2.12.1
HarfBuzz 8.3.0
FontConfig 2.14.2
Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW
wxWidgets: 3.2.4 (wchar_t,wx containers)
Boost: 1.83.0
OCC: 7.7.1
Curl: 8.5.0-DEV
ngspice: 42
Compiler: Visual C++ 1936 without C++ ABI
Build settings:
Designs
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- KiCad Bot added 8.0 priorityundecided statusnew labels
added 8.0 priorityundecided statusnew labels
- Matthew Bossard changed the description
Compare with previous version changed the description
- Owner
Might be worth trying a recent nightly to see if this still happens
1 - Matthew Bossard changed the description
Compare with previous version changed the description
- Owner
I don't get a crash but I do get warning on a bad OpenGL alloc and then a fall back to software rendering warning and then gray screen. Not sure what's going on here but something is up.
- Owner
Switched to software rendering. Got this beauty:
Click to show/hide backtrace.
Thread 1 "pcbnew" received signal SIGSEGV, Segmentation fault. __memcpy_avx512_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:265 Download failed: Invalid argument. Continuing without source file ./string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S. 265 ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory. (gdb) bt #0 __memcpy_avx512_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:265 #1 0x00007ffff4d6b533 in std::char_traits<wchar_t>::copy(wchar_t*, wchar_t const*, unsigned long) (__s1=<optimized out>, __s2=0x72 <error: Cannot access memory at address 0x72>, __n=85) at /build/reproducible-path/gcc-14-14-20240201/build/x86_64-linux-gnu/libstdc++-v3/include/bits/char_traits.h:558 #2 std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_S_copy(wchar_t*, wchar_t const*, unsigned long) (__d=<optimized out>, __s=0x72 <error: Cannot access memory at address 0x72>, __n=85) at /build/reproducible-path/gcc-14-14-20240201/build/x86_64-linux-gnu/libstdc++-v3/include/bits/basic_string.h:435 #3 std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_S_copy(wchar_t*, wchar_t const*, unsigned long) (__d=<optimized out>, __s=0x72 <error: Cannot access memory at address 0x72>, __n=85) at /build/reproducible-path/gcc-14-14-20240201/build/x86_64-linux-gnu/libstdc++-v3/include/bits/basic_string.h:430 #4 std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_S_copy_chars(wchar_t*, wchar_t*, wchar_t*) (__p=<optimized out>, __k1=0x72 <error: Cannot access memory at address 0x72>, __k2=<optimized out>) at /build/reproducible-path/gcc-14-14-20240201/build/x86_64-linux-gnu/libstdc++-v3/include/bits/basic_string.h:483 #5 std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_construct<wchar_t*>(wchar_t*, wchar_t*, std::forward_iterator_tag) (this=0x7fffafffb240, __beg=0x72 <error: Cannot access memory at address 0x72>, __end=<optimized out>) at /build/reproducible-path/gcc-14-14-20240201/build/x86_64-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:247 #6 0x00007fffe9026e2d in wxString::wxString(wxString const&) (this=0x7fffafffb240, stringSrc=...) at /usr/include/wx-3.2/wx/string.h:1180 #7 0x00007fffe9e4f819 in BOARD_CONNECTED_ITEM::GetUnescapedShortNetname() const (this=0x7ffef54ae6b0) at /home/foo/src/kicad/pcbnew/board_connected_item.cpp:143 #8 0x00007fffe9ff26c9 in KIGFX::PCB_PAINTER::draw(PCB_SHAPE const*, int) (this=0x5555578e4e60, aShape=0x7ffef54ae6b0, aLayer=60) at /home/foo/src/kicad/pcbnew/pcb_painter.cpp:1705 --Type <RET> for more, q to quit, c to continue without paging--c #9 0x00007fffe9feb9ee in KIGFX::PCB_PAINTER::Draw(KIGFX::VIEW_ITEM const*, int) (this=0x5555578e4e60, aItem=0x7ffef54ae6b0, aLayer=60) at /home/foo/src/kicad/pcbnew/pcb_painter.cpp:600 #10 0x00007fffe2a504ee in KIGFX::VIEW::updateItemGeometry(KIGFX::VIEW_ITEM*, int) (this=0x5555574dda40, aItem=0x7ffef54ae6b0, aLayer=60) at /home/foo/src/kicad/common/view/view.cpp:1318 #11 0x00007fffe2a4fe90 in KIGFX::VIEW::invalidateItem(KIGFX::VIEW_ITEM*, int) (this=0x5555574dda40, aItem=0x7ffef54ae6b0, aUpdateFlags=239) at /home/foo/src/kicad/common/view/view.cpp:1248 #12 0x00007fffe2a512f0 in KIGFX::VIEW::UpdateItems() (this=0x5555574dda40) at /home/foo/src/kicad/common/view/view.cpp:1490 #13 0x00007fffea36b658 in EDA_DRAW_PANEL_GAL::DoRePaint() (this=0x5555573d2df0) at /home/foo/src/kicad/common/draw_panel_gal.cpp:245 #14 0x00007fffea36c975 in EDA_DRAW_PANEL_GAL::ForceRefresh() (this=0x5555573d2df0) at /home/foo/src/kicad/common/draw_panel_gal.cpp:413 #15 0x00007fffe96598d1 in FOOTPRINT_EDIT_FRAME::CommonSettingsChanged(bool, bool) (this=0x555557b85350, aEnvVarsChanged=false, aTextVarsChanged=false) at /home/foo/src/kicad/pcbnew/footprint_edit_frame.cpp:1348 #16 0x00005555555ac634 in KIWAY::CommonSettingsChanged(bool, bool) (this=0x5555558e2220 <Kiway>, aEnvVarsChanged=false, aTextVarsChanged=false) at /home/foo/src/kicad/common/kiway.cpp:655 #17 0x00007fffea37cc17 in EDA_BASE_FRAME::ShowPreferences(wxString, wxString) (this=0x555557b85350, aStartPage=..., aStartParentPage=...) at /home/foo/src/kicad/common/eda_base_frame.cpp:1260 #18 0x00007fffea47a4a7 in COMMON_CONTROL::OpenPreferences(TOOL_EVENT const&) (this=0x55555fb30cc0, aEvent=...) at /home/foo/src/kicad/common/tool/common_control.cpp:71 #19 0x00007fffea47e317 in std::__invoke_impl<int, int (COMMON_CONTROL::*&)(TOOL_EVENT const&), COMMON_CONTROL*&, TOOL_EVENT const&>(std::__invoke_memfun_deref, int (COMMON_CONTROL::*&)(TOOL_EVENT const&), COMMON_CONTROL*&, TOOL_EVENT const&) (__f=@0x7ffef57e83f0: (int (COMMON_CONTROL::*)(COMMON_CONTROL * const, const TOOL_EVENT &)) 0x7fffea47a446 <COMMON_CONTROL::OpenPreferences(TOOL_EVENT const&)>, __t=@0x7ffef57e8400: 0x55555fb30cc0) at /usr/include/c++/13/bits/invoke.h:74 #20 0x00007fffea47e269 in std::__invoke<int (COMMON_CONTROL::*&)(TOOL_EVENT const&), COMMON_CONTROL*&, TOOL_EVENT const&>(int (COMMON_CONTROL::*&)(TOOL_EVENT const&), COMMON_CONTROL*&, TOOL_EVENT const&) (__fn=@0x7ffef57e83f0: (int (COMMON_CONTROL::*)(COMMON_CONTROL * const, const TOOL_EVENT &)) 0x7fffea47a446 <COMMON_CONTROL::OpenPreferences(TOOL_EVENT const&)>) at /usr/include/c++/13/bits/invoke.h:96 #21 0x00007fffea47e1bd in std::_Bind<int (COMMON_CONTROL::*(COMMON_CONTROL*, std::_Placeholder<1>))(TOOL_EVENT const&)>::__call<int, TOOL_EVENT const&, 0ul, 1ul>(std::tuple<TOOL_EVENT const&>&&, std::_Index_tuple<0ul, 1ul>) (this=0x7ffef57e83f0, __args=...) at /usr/include/c++/13/functional:506 #22 0x00007fffea47e0df in std::_Bind<int (COMMON_CONTROL::*(COMMON_CONTROL*, std::_Placeholder<1>))(TOOL_EVENT const&)>::operator()<TOOL_EVENT const&, int>(TOOL_EVENT const&) (this=0x7ffef57e83f0) at /usr/include/c++/13/functional:591 #23 0x00007fffea47e00d in std::__invoke_impl<int, std::_Bind<int (COMMON_CONTROL::*(COMMON_CONTROL*, std::_Placeholder<1>))(TOOL_EVENT const&)>&, TOOL_EVENT const&>(std::__invoke_other, std::_Bind<int (COMMON_CONTROL::*(COMMON_CONTROL*, std::_Placeholder<1>))(TOOL_EVENT const&)>&, TOOL_EVENT const&) (__f=...) at /usr/include/c++/13/bits/invoke.h:61 #24 0x00007fffea47de7b in std::__invoke_r<int, std::_Bind<int (COMMON_CONTROL::*(COMMON_CONTROL*, std::_Placeholder<1>))(TOOL_EVENT const&)>&, TOOL_EVENT const&>(std::_Bind<int (COMMON_CONTROL::*(COMMON_CONTROL*, std::_Placeholder<1>))(TOOL_EVENT const&)>&, TOOL_EVENT const&) (__fn=...) at /usr/include/c++/13/bits/invoke.h:114 #25 0x00007fffea47dc05 in std::_Function_handler<int (TOOL_EVENT const&), std::_Bind<int (COMMON_CONTROL::*(COMMON_CONTROL*, std::_Placeholder<1>))(TOOL_EVENT const&)> >::_M_invoke(std::_Any_data const&, TOOL_EVENT const&) (__functor=..., __args#0=...) at /usr/include/c++/13/bits/std_function.h:290 #26 0x00007fffea4c4a37 in std::function<int (TOOL_EVENT const&)>::operator()(TOOL_EVENT const&) const (this=0x7ffef5486588, __args#0=...) at /usr/include/c++/13/bits/std_function.h:591 #27 0x00007fffea4c1d1e in COROUTINE<int, TOOL_EVENT const&>::callerStub(long) (aData=140737488337360) at /home/foo/src/kicad/include/tool/coroutine.h:509 #28 0x00007fffea96e781 in make_fcontext () at /home/foo/build/kicad/dev-debug/pcbnew/_pcbnew.kiface #29 0x00007fffb0000030 in () #30 0x0000000000000000 in ()
Looks like the board connectivity code is being called in to footprint editor.
Collapse replies - Owner
BOARD_CONNECTED_ITEM::GetUnescapedShortNetname
is not really board connectivity code -- B_C_I is the base class for many items and is shared with the footprint editor. This looks more like a stale pointer in the VIEW to me.
- Owner
Can't reproduce on Mac Version: 8.0.0-rc2-576-g407bb101, debug build
- Maintainer
Ah ok, actually using the attached sample results in the bad allocation exceptioon
- Mark Roszko added prioritycritical statusconfirmed labels and removed priorityundecided statusnew labels
added prioritycritical statusconfirmed labels and removed priorityundecided statusnew labels
- Maintainer
- Mark Roszko changed milestone to %8.0
changed milestone to %8.0
- Mark Roszko closed with commit c48fc7eb
closed with commit c48fc7eb
- Mark Roszko added statusfix-committed label and removed statusconfirmed label
added statusfix-committed label and removed statusconfirmed label