pcbnew: crash when starting routing (on existing design)
Description
Open existing design and try to add new trace or drag existing elements, it crashes with the following stack trace below.
It doesn't happen with all designs that I have though.
/usr/include/c++/12/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::vector<SHAPE_LINE_CHAIN>; _Alloc = std::allocator<std::vector<SHAPE_LINE_CHAIN> >; reference = std::vector<SHAPE_LINE_CHAIN>&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Thread 1 "kicad" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
Downloading source file /usr/src/debug/glibc-2.36-9.fc37.x86_64/nptl/pthread_kill.c
44 return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
(gdb) bt
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1 0x00007ffff56afec3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2 0x00007ffff565fa76 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3 0x00007ffff56497fc in __GI_abort () at abort.c:79
#4 0x00007ffff58d7e80 in std::__glibcxx_assert_fail(char const*, int, char const*, char const*)
(file=<optimized out>, line=<optimized out>, function=<optimized out>, condition=<optimized out>) at ../../../../../libstdc++-v3/src/c++11/debug.cc:60
#5 0x00007fffbf0ec677 in PNS_KICAD_IFACE_BASE::syncTextItem(PNS::NODE*, PCB_TEXT*, PCB_LAYER_ID) [clone .constprop.0] ()
at /usr/lib64/kicad-nightly/bin/_pcbnew.kiface
#6 0x00007fffbec25803 in PNS_KICAD_IFACE_BASE::SyncWorld(PNS::NODE*) () at /usr/lib64/kicad-nightly/bin/_pcbnew.kiface
#7 0x00007fffbec34b8c in PNS::ROUTER::SyncWorld() () at /usr/lib64/kicad-nightly/bin/_pcbnew.kiface
#8 0x00007fffbec0421f in PNS::TOOL_BASE::Reset(TOOL_BASE::RESET_REASON) () at /usr/lib64/kicad-nightly/bin/_pcbnew.kiface
#9 0x00007fffbee066f6 in TOOL_MANAGER::processEvent(TOOL_EVENT const&) () at /usr/lib64/kicad-nightly/bin/_pcbnew.kiface
#10 0x00007fffbf2a1de9 in TOOL_MANAGER::invokeTool(TOOL_BASE*) [clone .isra.0] () at /usr/lib64/kicad-nightly/bin/_pcbnew.kiface
#11 0x00007fffbec12d92 in ROUTER_TOOL::MainLoop(TOOL_EVENT const&) () at /usr/lib64/kicad-nightly/bin/_pcbnew.kiface
#12 0x00007fffbedfa680 in COROUTINE<int, TOOL_EVENT const&>::callerStub(long) () at /usr/lib64/kicad-nightly/bin/_pcbnew.kiface
#13 0x00007fffbf2fa451 in make_fcontext () at /usr/lib64/kicad-nightly/bin/_pcbnew.kiface
#14 0x0000000000000000 in ()
Steps to reproduce
Last known working nightly build version for me is 7.99.0-1.20230501git04a53ea4.fc37. First failing version is 7.99.0-1.20230502gitf27bc16d.fc37
KiCad Version
Application: KiCad x86_64 on x86_64
Version: 7.99.0-1.20230502gitf27bc16.fc37, release build
Libraries:
wxWidgets 3.2.1
FreeType 2.12.1
HarfBuzz 5.2.0
FontConfig 2.14.1
libcurl/7.85.0 OpenSSL/3.0.8 zlib/1.2.12 brotli/1.0.9 libidn2/2.3.4 libpsl/0.21.1 (+libidn2/2.3.3) libssh/0.10.4/openssl/zlib nghttp2/1.51.0
Platform: Fedora release 37 (Thirty Seven), 64 bit, Little endian, wxGTK, gnome, wayland
Build Info:
Date: May 2 2023 17:16:13
wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.78.0
OCC: 7.6.3
Curl: 7.85.0
ngspice: 40
Compiler: GCC 12.2.1 with C++ ABI 1017
Build settings:
Edited by Oleg Endo