I am currently experiencing a very frustrating error in KiCAD. I have a new design I’m attempting to ready for fabrication, but running the DRC in PCBNew results in a crash. When running from the terminal, either nothing gets printed, or it prints “munmap_chunk(): invalid pointer”
Since it started crashing I now have visualization errors when looking at the 3D board view, and running plugins like Via Stitching also results in crashes, and even placing vias has caused crashes. I’ve never experienced this before, and suspect my project has become corrupted somehow, but I don’t know what to do to fix it. Running the Tools > Repair Board results in “No Board Problems Found”
I have enabled fallback graphics on the PCB editor, as well as the schematic editor and footprint editor for good measure, the crashing still happens. For what it’s worth, this is a project that was created and done entirely in KiCad 7.
I just tried a project I did in an older version of KiCad (can’t remember if it’s 5 or 6), and that runs the DRC just fine. This just re-enforces to me that it’s possibly a file corruption issue, though opening it by hand I don’t see any obvious issues. Is there a debug mode I can turn on to figure out what it’s doing to trigger the crash?
Thanks for the feedback. I am currently running the proprietary amdgpu drivers, however it doesn’t seem to be my issue.
I think I found the point of corruption, and have now fixed it.
The issue was my primary ground pour. I had a ground pour over the entire board, front and back. In fact, stitching these pours with the Via Stitching plugin is what caused the first crash. I suspected the ground pour may be an issue because the 3D visualization had weird artifacts relating to how the pour was visualized. Deleting and re-adding this pour caused the DRC to run successfully against the layout.
I tried diff-ing the backup files before and after the fix, but there’s so many changes it’s impossible for me to tell what change was the thing that triggered or fixed the crash. The strange thing I noted is that I had a number of silkscreen text bits I had been fiddling with around the time of the first crash, and these texts have been moved to a copper layer instead of silkscreen. Curiously though, the DRC did not catch these as clearance violations, despite the fact that a number of traces ran right through them. I caught them while performing a manual review to make sure all of the silkscreen was correctly positioned and all my labels were right.
I did a quick test by creating a text bit and putting it on copper, as well as drawing geometric shapes then grouping them and putting them on copper. DRC caught both of these, so I’m not sure why it missed the other. Some of the other text actually came from an import from a gerber file, so maybe it missed it because of the way gerber geometry gets imported? I’ll do a test later to see if this is the case.
Either way, the current issue seems solved! It was file corruption. Fixed by removing and re-adding the corrupted ground pour. Doesn’t answer why it crashed in the first place, but that may be related to the via stitching, the graphics, etc… I’ll keep digging if I get some time.
Gerber is purely optical exposure controls for plotting.
It looks like you have found a case that crashes DRC, something that should not happen, so if you can find an example in your projectname-backup folder, a bug report would be a good idea.
It can be set as confidential
Thanks for the feedback, all! I’ll try to run Kicad under gdb and see what turns up. I didn’t realize you could upload files as confidential, I’ll look into that!