I reverted back to the official FreeCAD/master, and compiled again, and confirmed that the bug is still in there, and FreeCAD crashes. However, I manually cherry-picked your fix a17196c... from your tree, and patched the official FreeCAD/master branch with just this one commit, and compiled once again. Resulting binary worked, so the a17196c... fixes the bug also on top of the official master:
Code: Select all
$ wget https://github.com/realthunder/FreeCAD/commit/a17196cdbe868c57e5cdee92b986f730d9956878.patch
$ git apply --stat a17196cdbe868c57e5cdee92b986f730d9956878.patch
src/Mod/Sketcher/App/SketchObject.cpp | 11 ++++-------
src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 10 ++++++++++
2 files changed, 14 insertions(+), 7 deletions(-)
$ git apply a17196cdbe868c57e5cdee92b986f730d9956878.patch
a17196cdbe868c57e5cdee92b986f730d9956878.patch:62: trailing whitespace.
if(Constr->First < -extGeoCount || Constr->First >= intGeoCount
a17196cdbe868c57e5cdee92b986f730d9956878.patch:63: trailing whitespace.
a17196cdbe868c57e5cdee92b986f730d9956878.patch:65: trailing whitespace.
warning: 3 lines add whitespace errors.
$ make -j4
Git complained about some trailing whitespace in your commit, but it didn't of course have an effect on compiling. So, your fix works for me on top of the official master, and fixes the bug. Well done!
OS: Debian GNU/Linux bullseye/sid (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17875 (Git)
Build type: Release
Python version: 2.7.16+
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)