Skip to content

eeschema: repeat action can cause sheet recursion

Description

I managed to trigger a crash using repeat action, where eeschema decided the action to repeat was inserting an instance of a sheet into itself. I'm not sure why that eeschema decided that was the action to repeat at that moment, but the easiest way to repro the crash half is to do it intentionally.

Steps to reproduce

  1. Start an empty project
  2. Create a subsheet
  3. In the root page, copy-paste or ctrl-d the subsheet to make a second instance.
  4. Go into the sub-sheet.
  5. Use the repeat action command.
  6. eeschema will pop up a dialog that the sheet changes can't be made due to potential recursion. OK the dialog.
  7. The "sheet properties" dialog will pop up, with no sheetfile. Cancel the dialog.
  8. Use the repeat action command again.
  9. BOOM

KiCad Version

Application: KiCad Schematic Editor x86_64 on x86_64

Version: 8.0.3-68-gf6a8ffe47e, release build

Libraries:
	wxWidgets 3.2.4
	FreeType 2.11.1
	HarfBuzz 2.7.4
	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.17

Platform: Ubuntu 22.04.4 LTS, 64 bit, Little endian, wxGTK, X11, xubuntu, x11
OpenGL: Intel, Mesa Intel(R) Graphics (RPL-P), 4.6 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2

Build Info:
	Date: Jun 12 2024 11:07:39
	wxWidgets: 3.2.4 (wchar_t,wx containers) GTK+ 3.24
	Boost: 1.74.0
	OCC: 7.6.3
	Curl: 7.81.0
	ngspice: 36
	Compiler: GCC 11.4.0 with C++ ABI 1016

Build settings: