Kicad 5.99 giving segmentation fault when filling zones touching a pad or outline

Hi everyone,

I encounter a strange behaviour I suspect it might be a bug or I am doing something very wrong. I am trying to build a PCB by python scripting.
I place some connectors, an outline and start drawing zones (copper pours). I have a zone that touches the outline and one connector and I observe the following:

  1. If the zone touches both the outline and the footprint, but I don’t call “ZONE_FILLER Fill”, but instead save the board, open it with the GUI and press ‘b’, everything works.
  2. If the zone touches both the outline and the footprint, but I call “ZONE_FILLER Fill” in my code, I get a segmentation fault.
  3. If the zone touches either the outline or the footprint, but I call “ZONE_FILLER Fill” in my code, I get a segmentation fault.
  4. If the zone touches neither the outline nor the footprint, andI call “ZONE_FILLER Fill” in my code, everything works.

The thing that is bugging me the most is that filling the zones with the GUI works, and by code it crashes. I uploaded a python script that reproduces the behaviour by changing the flags in lines 107 and 108 here:

I am running nightly build with the following version: (though I tried with the latest nightly build and I got again segmentation fault)

Application: KiCad (64-bit)
Version: (5.99.0-11336-g5116fa6d12), release build
Libraries:
wxWidgets 3.1.5
libcurl/7.74.0-DEV Schannel zlib/1.2.11
Platform: Windows 10 (build 19042), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Date: Jul 6 2021 09:00:18
wxWidgets: 3.1.5 (wchar_t,STL containers)
Boost: 1.75.0
OCC: 7.5.0
Curl: 7.74.0-DEV
ngspice: 34
Compiler: Visual C++ 1928 without C++ ABI
Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON

I hope I explained my problem and looking forward to hearing from you guys!
Thanks!

Please update to the most recent build, there have been many fixes to DRC recently and see if it is still crashing

If you are adding components or other objects to the board they don’t get fully processed until the board is reloaded (or your action script ends, if it’s a plugin).
Try reloading the board file before doing the fill.

Indeed.
If KiCad does not give a segmentation fault if the PCB is saved and opened again, then that suggests you’re missing something in your Python script.

On the other hand…
KiCad should not give a Segmentation Fault anyway, but the error should be caught and turned into something understandable by mere humans.

Saving and loading the board before filling the zones works like a charm!

Thanks a lot!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.