eeschema: deleting a sheet instance property locks up kicad
Description
Attempting to delete a custom property from a sheet instance property dialog can cause kicad to lock up. When it happens once it happens every time, even immediately after opening eeschema. This can be repro'd by creating four custom properties and then trying to delete the second to last one.
Running with debugging symbols and backtracing, eeschema is getting stuck in SCH_SHEET::SetFields, where two of the fields have the same ID (2) and get infinitely swapped back and forth at ii=4.
Steps to reproduce
- Start with test.zip
- Open test.kicad_sch
- Right-click, properties on the sheet instance
- Click on "four"
- Click delete
- Wait until the heat death of the universe
KiCad Version
Application: KiCad x86_64 on x86_64
Version: 7.0.7-7.0.7~ubuntu22.04.1, release build
Libraries:
wxWidgets 3.2.1
FreeType 2.11.1
HarfBuzz 6.0.0
FontConfig 2.13.1
libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.16
Platform: Ubuntu 22.04.3 LTS, 64 bit, Little endian, wxGTK, xubuntu, x11
Build Info:
Date: Aug 13 2023 23:14:49
wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.74.0
OCC: 7.5.2
Curl: 7.88.1
ngspice: 38
Compiler: GCC 11.4.0 with C++ ABI 1016
Build settings:
KICAD_SPICE=ON
Edited by David Schneider