Skip to content

SWIG DRC crashes if there are existing markers from GUI-run DRC #756

Description

@z2amiller

Describe the bug

If 'Force DRC' is used and the user has already run DRC, then KiCad will segfault when running
the DRC check as part of the export. Running on a board without first running DRC works fine.

I suspect this is because the DRC check modifies the board state -- it clears the existing markers
as part of running the DRC. I think it expects to have exclusive access to modify the board's state.

I've reported this upstream with a simple repro case:
https://gitlab.com/kicad/code/kicad/-/work_items/24124

I'm looking into workarounds - maybe copying the board first, maybe just trying to detect if
there are markers already on the board and popping up a warning to clear them.

To Reproduce

  • Load a board
  • Run DRC manually
  • Open the plugin to export gerbers, with 'Force DRC' setting checked
  • Run the export

Expected behavior
Not crash :-)

KiCad Version

There were some commits that addressed DRC segfauled so I installed the nightly build to see if the crash had been fixed upstream (nope), but this also happened on (at least) KiCad 10.0.1. I haven't tried booting up KiCad 9 to see if it repros there.

Application: KiCad arm64 on arm64

Version: 10.0.1-168-gcb1526804b, release build

Libraries:
	wxWidgets 3.2.8 
	FreeType 2.14.3
	HarfBuzz 12.3.2
	FontConfig 2.17.1
	libcurl/8.7.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.68.0

Platform: macOS Version 26.3.1 (a) (Build 25D771280a), 64 bit, Little endian, wxMac

Build Info:
	Date: Apr 26 2026 00:11:02
	wxWidgets: 3.2.8 (wchar_t,wx containers)
	Boost: 1.90.0
	OCC: 7.9.3
	Curl: 8.7.1
	ngspice: 45.2
	Compiler: Clang 17.0.0 with C++ ABI 1002
	KICAD_IPC_API=ON
	KICAD_USE_PCH=OFF

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions