Two issues found with the locking system used to prevent access to stale connectivity data during the zone fill process: 1) a std::mutex has undefined behavior if you try to use it to guard against access from the same thread. Because of the use of wx event loops (and coroutines) it is entirely possible, and in some situations inevitable, that the same thread will try to redraw the ratsnest in the middle of zone refilling. 2) The mutex was only guarding the ZONE_FILLER::Fill method, but the callers of that method also do connectivity updates as part of the COMMIT::Push. Redrawing the ratsnest after the Fill but before the Push will result in stale connectivity pointers to zone filled areas. Fixed (1) by switching to a trivial spinlock implementation. Spinlocks would generally not be desirable if the contention for the connectivity data crossed thread boundaries, but at the moment I believe it's guaranteed that the reads and writes to connectivity that are guarded by this lock happen from the main UI thread. The writes are also quite rare compared to reads, and reads are generally fast, so I'm not really worried about the UI thread spinning for any real amount of time. Fixed (2) by moving the locking location up to the call sites of ZONE_FILLER::Fill. This issue was quite difficult to reproduce, but I found a fairly reliable way: It only happens (for me) on Windows, MSYS2 build, with wxWidgets 3.0 It also only happens if I restrict PcbNew to use 2 CPU cores. With those conditions, I can reproduce the issue described in #6471 by repeatedly editing a zone properties and changing its net. The crash is especially easy to trigger if you press some keys (such as 'e' for edit) while the progress dialog is displayed. It's easiest to do this in a debug build as the slower KiCad is running, the bigger the window is to trigger this bug. Fixes https://gitlab.com/kicad/code/kicad/-/issues/6471 Fixes https://gitlab.com/kicad/code/kicad/-/issues/7048 |
||
---|---|---|
.githooks | ||
.github | ||
.gitlab | ||
3d-viewer | ||
CMakeModules | ||
Documentation | ||
bitmap2component | ||
bitmaps_png | ||
common | ||
cvpcb | ||
demos | ||
eeschema | ||
gerbview | ||
helpers | ||
include | ||
kicad | ||
libs | ||
pagelayout_editor | ||
patches | ||
pcb_calculator | ||
pcbnew | ||
plugins | ||
qa | ||
resources | ||
scripting | ||
scripts | ||
template | ||
thirdparty | ||
tools | ||
translation | ||
utils | ||
.clang-tidy | ||
.gitattributes | ||
.gitignore | ||
.gitlab-ci.yml | ||
AUTHORS.txt | ||
CMakeLists.txt | ||
CMakeSettings.json.sample | ||
Doxyfile | ||
DoxygenLayout.xml | ||
INSTALL.txt | ||
LICENSE | ||
LICENSE.BOOSTv1_0 | ||
LICENSE.CC-BY-SA-4.0 | ||
LICENSE.GPLv3 | ||
LICENSE.ISC | ||
LICENSE.MIT | ||
LICENSE.README | ||
README.md | ||
_clang-format | ||
code-of-conduct.md | ||
copyright.h | ||
uncrustify.cfg |
README.md
KiCad README
For specific documentation like Compiling, GUI translation, old changelogs see the Documentation subfolder.
You may also take a look into the Wiki, the Developers section on our Website and our Forum.
Build state
Release status
Files
- AUTHORS.txt - The authors, contributors, document writers and translators list
- CMakeLists.txt - Main CMAKE build tool script
- copyright.h - A very short copy of the GNU General Public License to be included in new source files
- CTestConfig.cmake - Support for CTest and CDash testing tools
- Doxyfile - Doxygen config file for KiCad
- INSTALL.txt - The release (binary) installation instructions
- uncrustify.cfg - Uncrustify config file for uncrustify sources formatting tool
- _clang-format - clang config file for clang-format sources formatting tool
Subdirectories
- 3d-viewer - Sourcecode of the 3D viewer
- bitmap2component - Sourcecode of the bitmap to pcb artwork converter
- bitmaps_png - Menu and program icons
- CMakeModules - Modules for the CMAKE build tool
- common - Sourcecode of the common library
- cvpcb - Sourcecode of the CvPCB tool
- demos - Some demo examples
- Documentation - Developer documentation. Old changelogs etcetera.
- eeschema - Sourcecode of the schematic editor
- gerbview - Sourcecode of the gerber viewer
- helpers - Helper tools and utilities for development
- include - Interfaces to the common library
- kicad - Sourcecode of the project manager
- libs - Sourcecode of kicad utilities (geometry and others)
- pagelayout_editor - Sourcecode of the pagelayout editor
- patches - Collection of patches for external dependencies
- pcbnew - Sourcecode of the printed circuit board editor
- plugins - Sourcecode for the 3d viewer plugins
- qa - Unit testing framework for KiCad
- resources - Resources for freedesktop mime-types for linux
- scripting - SWIG Python scripting definitions and build scripts
- scripts - Example scripts for distribution with KiCad
- template - Project template
- thirdparty - Sourcecode of external libraries used in kicad but not written by Kicad team
- tools - Other miscellaneous helpers for testing
- utils - Small utils for kicad, e.g. IDF, STEP and OGL tools and converters