kicad patches
Go to file
Jon Evans 1e33928b96 Fix issues with zone filling connectivity locking
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
2021-01-18 13:22:12 -05:00
.githooks Formatting: prefer a Git config variable to env var 2019-03-29 15:06:48 +00:00
.github Correct CERN funding link 2020-10-01 13:48:54 -07:00
.gitlab Default the translations build to off and build it in CI 2021-01-18 17:43:34 +00:00
3d-viewer Remove empty option from 3D Viewer dropdown 2021-01-17 23:11:29 +00:00
CMakeModules Rearrange linux resources and translate MIME files 2021-01-18 17:43:34 +00:00
Documentation Remove documentation now moved to http://dev-docs.kicad.org/ 2021-01-01 15:47:50 -05:00
bitmap2component Add multiple size icons for programs 2020-12-22 15:37:26 -08:00
bitmaps_png Icons: lighten up hierarchy navigator a bit 2021-01-11 23:31:25 +00:00
common Improvements to ERC and bus parsing. 2021-01-17 16:24:22 +00:00
cvpcb Change environmental variables to human-readable 2021-01-01 16:20:35 +00:00
demos Demos update 2021-01-15 20:21:23 +01:00
eeschema Eeschema: fix zoom change on undo/redo command. 2021-01-18 16:26:30 +01:00
gerbview Icons: general tweaks and pixel alignment 2021-01-11 23:31:25 +00:00
helpers Fix some glyph of CJK characters 2021-01-05 19:11:41 +00:00
include Fix issues with zone filling connectivity locking 2021-01-18 13:22:12 -05:00
kicad Icons: general tweaks and pixel alignment 2021-01-11 23:31:25 +00:00
libs Fix misplaced parenthesis in VECTOR2<T>::Resize() 2021-01-16 09:41:14 +00:00
pagelayout_editor Tidy up context menus a bit 2021-01-17 22:42:03 +00:00
patches Remove macos patches. 2018-01-31 10:18:41 -05:00
pcb_calculator Add more const specifiers 2021-01-12 20:51:31 +00:00
pcbnew Fix issues with zone filling connectivity locking 2021-01-18 13:22:12 -05:00
plugins Swap wxFileInputStream/wxFileOutputStream for the buffered kind 2020-12-12 18:52:02 -05:00
qa Add no-connects testcase 2021-01-14 21:01:03 -05:00
resources Rearrange linux resources and translate MIME files 2021-01-18 17:43:34 +00:00
scripting Unify scripting dirs and open user-based 2020-09-16 20:09:23 -07:00
scripts Remove ddr3_length_match.py 2020-11-20 08:10:53 +00:00
template Update project template system for new format 2020-07-02 22:08:54 -04:00
thirdparty libcontext: Initial support for Apple Silicon 2021-01-08 19:51:28 +00:00
tools Add basic netlist QA test 2020-04-19 19:13:24 -04:00
translation Update translations 2021-01-18 09:51:03 -08:00
utils Minor adjustments 2021-01-12 20:51:31 +00:00
.clang-tidy Adding default clang-tidy parameters 2019-12-05 19:48:50 -08:00
.gitattributes Renormalize line endings and enforce normalization for all contributors 2020-08-03 23:15:10 +01:00
.gitignore Rearrange linux resources and translate MIME files 2021-01-18 17:43:34 +00:00
.gitlab-ci.yml Enable windows ci again 2020-12-30 17:36:26 +00:00
AUTHORS.txt New icons for v6 2020-12-05 11:17:15 -08:00
CMakeLists.txt Default the translations build to off and build it in CI 2021-01-18 17:43:34 +00:00
CMakeSettings.json.sample Update cmakesettings sample with msys2 config 2020-11-13 19:17:33 -05:00
Doxyfile Add custom doxygen layout to add link to dev-docs 2021-01-02 08:39:56 -05:00
DoxygenLayout.xml Add custom doxygen layout to add link to dev-docs 2021-01-02 08:39:56 -05:00
INSTALL.txt Update KiCad website links 2020-12-22 17:38:56 -08:00
LICENSE Set project license file to GPLv3 for GitLab 2020-07-05 08:56:17 -07:00
LICENSE.BOOSTv1_0 Cleanup licensing 2019-02-11 08:35:23 -08:00
LICENSE.CC-BY-SA-4.0 Adding license text for CC-BY-SA-4.0 for completeness 2019-03-27 14:47:35 -04:00
LICENSE.GPLv3 Update license to AGPL due to TTL license. 2018-10-22 12:28:48 -04:00
LICENSE.ISC Cleanup licensing 2019-02-11 08:35:23 -08:00
LICENSE.MIT Adding MIT license 2019-06-09 08:43:43 -07:00
LICENSE.README Altium: Refactor and add initial structure for schematic importer 2020-08-23 19:01:08 +00:00
README.md Update KiCad website links 2020-12-22 17:38:56 -08:00
_clang-format Remove clang-format 11+ option 2020-12-15 19:09:46 -05:00
code-of-conduct.md Add Code of Conduct 2020-03-26 11:10:34 -05:00
copyright.h Bump copyright header year 2020-01-24 21:23:38 +00:00
uncrustify.cfg Fix case statement indentation setting for uncrustify. 2015-01-08 09:02:27 -05:00

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

Jenkins Jenkins Jenkins

Release status

latest released version(s) 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