Crash when attempting to create a blind via without prior routing of a track
Description
same as issue #19294 (closed) which was closed by bot.
crashes on kicad 8 and 9
I wanted to place a blind via directly on the pad of a footprint. So I selected "Route tracks (x)", then directly right-clicked on the pad, and, in the context menu, selected "Select layer and place blind/buried via..." (It's important to note that I did not draw any traces before). The result was an immediate crash-to-desktop. I would have expected the normal layer selection dialog and the construction of a via afterwards, though I'm meanwhile assuming that I'm doing this wrong and that there is a better way to quickly create blind vias. Still, a CTD is probably not the intended reaction to this.
Steps to reproduce
- Create a new project and open pcbnew.
- Select "Route tracks (x)", but don't route anything yet.
- Right click somewhere in the layout window.
- From the appearing context menu, select "Select layer and place blind/buried via...". Kicad should crash.
gdb bt created with: gdb kicad
Click to expand gdb bt kicad 8.0.8
gdb kicad
GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from kicad...
Reading symbols from /usr/lib/debug/.build-id/e0/df832e696aff5a236822776835876c9803ca1a.debug...
(gdb) run
Starting program: /usr/bin/kicad
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libwx_gtk3u_aui-3.2.so.0
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libwx_gtk3u_html-3.2.so.0
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libwx_gtk3u_core-3.2.so.0
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libwx_gtk3u_propgrid-3.2.so.0
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libwx_baseu_xml-3.2.so.0
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libwx_gtk3u_stc-3.2.so.0
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgobject-2.0.so.0
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libglib-2.0.so.0
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgdk-3.so.0
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgmodule-2.0.so.0
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libbrotlidec.so.1
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/liblber.so.2
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libbrotlicommon.so.1
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libcap.so.2
Warnung: could not find '.gnu_debugaltlink' file for /usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libxapp-gtk3-module.so
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libxapp.so.1
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgnomekbdui.so.8
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libgnomekbd.so.8
Warnung: could not find '.gnu_debugaltlink' file for /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so
Warnung: could not find '.gnu_debugaltlink' file for /usr/lib/x86_64-linux-gnu/gvfs/libgvfscommon.so
[New Thread 0x7fffefa006c0 (LWP 35501)]
[New Thread 0x7fffe7e006c0 (LWP 35502)]
[New Thread 0x7fffef0006c0 (LWP 35503)]
[New Thread 0x7fffee6006c0 (LWP 35504)]
[New Thread 0x7fffed0006c0 (LWP 35505)]
[New Thread 0x7fffe74006c0 (LWP 35506)]
[Thread 0x7fffe74006c0 (LWP 35506) exited]
[New Thread 0x7fffe6a006c0 (LWP 35507)]
[New Thread 0x7fffe60006c0 (LWP 35508)]
[New Thread 0x7fffe56006c0 (LWP 35509)]
[New Thread 0x7fffe4c006c0 (LWP 35510)]
[New Thread 0x7fffdfe006c0 (LWP 35511)]
[New Thread 0x7fffdf4006c0 (LWP 35512)]
[New Thread 0x7fffdea006c0 (LWP 35513)]
[New Thread 0x7fffde0006c0 (LWP 35514)]
[New Thread 0x7fffdd6006c0 (LWP 35515)]
[New Thread 0x7fffdcc006c0 (LWP 35516)]
[New Thread 0x7fffd3e006c0 (LWP 35517)]
[New Thread 0x7fffd34006c0 (LWP 35518)]
[Detaching after vfork from child process 35519]
[Detaching after vfork from child process 35521]
[Detaching after vfork from child process 35523]
[Detaching after vfork from child process 35525]
[Detaching after vfork from child process 35527]
[Detaching after vfork from child process 35529]
[New Thread 0x7fffd2a006c0 (LWP 35531)]
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libnss_mdns4_minimal.so.2
[Thread 0x7fffd2a006c0 (LWP 35531) exited]
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libwx_baseu_net-3.2.so.0
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKBO.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKBRep.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKCDF.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKernel.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKG3d.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKGeomBase.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKLCAF.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKMath.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKMesh.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKPrim.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKRWMesh.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKShHealing.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKTopAlgo.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKXCAF.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKXSBase.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKIGES.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKSTEP.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKXDEIGES.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKXDESTEP.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKGeomAlgo.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKG2d.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libtbbmalloc.so.2
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKService.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKVCAF.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKV3d.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKCAF.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKBool.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKSTEPAttr.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKSTEP209.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKSTEPBase.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libTKHLR.so.7
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libjxrglue.so.0
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libraw.so.23
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libOpenEXR-3_1.so.30
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libIex-3_1.so.30
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libjpegxr.so.0
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libIlmThread-3_1.so.30
[New Thread 0x7fffd2a006c0 (LWP 35532)]
[New Thread 0x7fffbfe006c0 (LWP 35533)]
[New Thread 0x7fffbf4006c0 (LWP 35534)]
[New Thread 0x7fffbea006c0 (LWP 35535)]
[New Thread 0x7fffbe0006c0 (LWP 35536)]
[New Thread 0x7fffbd6006c0 (LWP 35537)]
[New Thread 0x7fffbcc006c0 (LWP 35538)]
[New Thread 0x7fffbc2006c0 (LWP 35539)]
[New Thread 0x7fffbb8006c0 (LWP 35540)]
[New Thread 0x7fffbae006c0 (LWP 35541)]
[New Thread 0x7fffba4006c0 (LWP 35542)]
[New Thread 0x7fffb9a006c0 (LWP 35543)]
Warnung: could not find '.gnu_debugaltlink' file for /usr/lib/python3/dist-packages/wx/_core.cpython-312-x86_64-linux-gnu.so
Warnung: could not find '.gnu_debugaltlink' file for /usr/lib/python3/dist-packages/wx/siplib.cpython-312-x86_64-linux-gnu.so
Warnung: could not find '.gnu_debugaltlink' file for /usr/lib/python3/dist-packages/wx/_adv.cpython-312-x86_64-linux-gnu.so
Warnung: could not find '.gnu_debugaltlink' file for /usr/lib/python3/dist-packages/wx/_html.cpython-312-x86_64-linux-gnu.so
Warnung: could not find '.gnu_debugaltlink' file for /usr/lib/python3/dist-packages/wx/_richtext.cpython-312-x86_64-linux-gnu.so
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libwx_gtk3u_richtext-3.2.so.0
Warnung: could not find '.gnu_debugaltlink' file for /usr/lib/python3/dist-packages/wx/_xml.cpython-312-x86_64-linux-gnu.so
Warnung: could not find '.gnu_debugaltlink' file for /usr/lib/python3/dist-packages/wx/_stc.cpython-312-x86_64-linux-gnu.so
Warnung: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libtinfo.so.6
[New Thread 0x7fffad4006c0 (LWP 35544)]
[New Thread 0x7fffaca006c0 (LWP 35545)]
[New Thread 0x7fffa7e006c0 (LWP 35546)]
[New Thread 0x7fffa74006c0 (LWP 35547)]
[Thread 0x7fffa74006c0 (LWP 35547) exited]
[Thread 0x7fffa7e006c0 (LWP 35546) exited]
[New Thread 0x7fffa7e006c0 (LWP 35548)]
[New Thread 0x7fffa74006c0 (LWP 35549)]
[Thread 0x7fffa74006c0 (LWP 35549) exited]
[Thread 0x7fffa7e006c0 (LWP 35548) exited]
[New Thread 0x7fffa7e006c0 (LWP 35550)]
[New Thread 0x7fffa74006c0 (LWP 35551)]
[Thread 0x7fffa74006c0 (LWP 35551) exited]
[Thread 0x7fffa7e006c0 (LWP 35550) exited]
[New Thread 0x7fffa7e006c0 (LWP 35552)]
[New Thread 0x7fffa74006c0 (LWP 35553)]
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug
[Thread 0x7fffed0006c0 (LWP 35505) exited]
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug
terminate called after throwing an instance of 'std::out_of_range'
what(): bitset::set: __position (which is 18446744073709551615) >= _Nb (which is 60)
Thread 1 "kicad" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
Warnung: 44 ./nptl/pthread_kill.c: Datei oder Verzeichnis nicht gefunden
(gdb) bt
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3 0x00007ffff484526e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4 0x00007ffff48288ff in __GI_abort () at ./stdlib/abort.c:79
#5 0x00007ffff4ca5ff5 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff4cbb0da in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#7 0x00007ffff4ca5a55 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6
#8 0x00007ffff4cbb391 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
#9 0x00007ffff4ca94a0 in std::__throw_out_of_range_fmt(char const*, ...) () from /lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00007fffc67ce43e in std::bitset<60ul>::_M_check(unsigned long, char const*) const [clone .part.0] [clone .lto_priv.0] [clone .lto_priv.0] (__position=<optimized out>, __s=__s@entry=0x7fffc784082e "bitset::set",
this=<optimized out>) at /usr/include/c++/13/bitset:823
#11 0x00007fffc67ce484 in std::bitset<60ul>::_M_check (__s=0x7fffc784082e "bitset::set", __position=<optimized out>, this=<optimized out>) at /usr/include/c++/13/bitset:1168
#12 std::bitset<60ul>::set (this=<optimized out>, __position=<optimized out>, __val=<optimized out>) at /usr/include/c++/13/bitset:1170
#13 0x00007fffc7108ab7 in ROUTER_TOOL::handleLayerSwitch (this=0x5555568ab250, aEvent=..., aForceVia=<optimized out>) at /usr/src/kicad-8.0.8-testing-180+202501260019~08a8081eb9~ubuntu24.04.1/kicad/pcbnew/router/router_tool.cpp:1021
#14 0x00007fffc72cf9d8 in std::function<int (TOOL_EVENT const&)>::operator()(TOOL_EVENT const&) const (__args#0=..., this=0x55555f99d268) at /usr/include/c++/13/bits/std_function.h:591
#15 COROUTINE<int, TOOL_EVENT const&>::callerStub (aData=<optimized out>) at /usr/src/kicad-8.0.8-testing-180+202501260019~08a8081eb9~ubuntu24.04.1/kicad/include/tool/coroutine.h:509
#16 0x00007fffc783ee51 in make_fcontext () from /usr/bin/_pcbnew.kiface
#17 0x00010102464c457f in ?? ()
#18 0x0000000000000000 in ?? ()
crash also happens in Kicad 9.0.x
gdb bt created with: gdb --ex=run --args env LD_LIBRARY_PATH=/usr/lib/kicad-nightly/lib/x86_64-linux-gnu/:/usr/lib/kicad-nightly/lib/ KICAD_PATH=/usr/share/kicad-nightly KICAD_CONFIG_HOME="$HOME/.config/kicadnightly" /usr/lib/kicad-nightly/bin/kicad from https://forum.kicad.info/t/how-to-create-a-proper-bug-report-after-a-crash/25886/6
`
Click to expand gdb bt kicad 9.0.x
Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
0x00007fffc9ca0591 in sul::dynamic_bitset<unsigned long, std::allocator<unsigned long> >::set (value=true, pos=18446744073709551615, this=0x7fffc3fffb00)
at /usr/src/kicad-202501251904+42b9a9604b~182~ubuntu24.04.1/kicad/thirdparty/dynamic_bitset/dynamic_bitset.h:2588
Warnung: 2588 /usr/src/kicad-202501251904+42b9a9604b~182~ubuntu24.04.1/kicad/thirdparty/dynamic_bitset/dynamic_bitset.h: Datei oder Verzeichnis nicht gefunden
(gdb)
(gdb) bt
#0 0x00007fffc9ca0591 in sul::dynamic_bitset<unsigned long, std::allocator<unsigned long> >::set (value=true, pos=18446744073709551615, this=0x7fffc3fffb00)
at /usr/src/kicad-202501251904+42b9a9604b~182~ubuntu24.04.1/kicad/thirdparty/dynamic_bitset/dynamic_bitset.h:2588
#1 BASE_SET::set (this=<optimized out>, pos=18446744073709551615) at /usr/src/kicad-202501251904+42b9a9604b~182~ubuntu24.04.1/kicad/include/base_set.h:121
#2 0x00007fffca740729 in ROUTER_TOOL::handleLayerSwitch (this=0x5555571a3020, aEvent=..., aForceVia=<optimized out>) at /usr/src/kicad-202501251904+42b9a9604b~182~ubuntu24.04.1/kicad/pcbnew/router/router_tool.cpp:1035
#3 0x00007fffca919228 in std::function<int (TOOL_EVENT const&)>::operator()(TOOL_EVENT const&) const (__args#0=..., this=0x55556018f418) at /usr/include/c++/13/bits/std_function.h:591
#4 COROUTINE<int, TOOL_EVENT const&>::callerStub (aData=<optimized out>) at /usr/src/kicad-202501251904+42b9a9604b~182~ubuntu24.04.1/kicad/include/tool/coroutine.h:513
#5 0x00007fffcae81181 in make_fcontext () from /usr/lib/kicad-nightly/bin/_pcbnew.kiface
#6 0x00007fffc4000030 in ?? ()
#7 0x0000000000000000 in ?? ()
KiCad Version
Application: KiCad x86_64 on x86_64
Version: 8.0.8-unknown-202501260019~08a8081eb9~ubuntu24.04.1, release build
Libraries:
wxWidgets 3.2.4
FreeType 2.13.2
HarfBuzz 8.3.0
FontConfig 2.15.0
libcurl/8.5.0 OpenSSL/3.0.13 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 (+libidn2/2.3.7) libssh/0.10.6/openssl/zlib nghttp2/1.59.0 librtmp/2.3 OpenLDAP/2.6.7
Platform: Linux Mint 22.1, 64 bit, Little endian, wxGTK, X11, cinnamon, x11
Build Info:
Date: Jan 26 2025 00:19:03
wxWidgets: 3.2.4 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.83.0
OCC: 7.6.3
Curl: 8.5.0
ngspice: 43
Compiler: GCC 13.3.0 with C++ ABI 1018
Build settings: