[FIXED] Using undo in Sketcher causes errors after the Big Merge
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[FIXED] Using undo in Sketcher causes errors after the Big Merge
Hi!
If I start FreeCAD v0.19 (after the Big Merge), and add a Part Design body, a sketch, and subsequently add anything adding constraints (e.g. two rectangles) into the sketch and undo the second one, there will be an error. All the constraints disappear, and I can't add any more constraints. When I subsequently exit Sketcher, and try to re-enter it I got complains about invalid sketch. Deleting constraints to external geometry makes the sketch re-editable again.
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17803 (Git)
Build type: Release
Branch: master
Hash: 89961a33d46063a43e9fb5b0308ca95d559eca94
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
If I start FreeCAD v0.19 (after the Big Merge), and add a Part Design body, a sketch, and subsequently add anything adding constraints (e.g. two rectangles) into the sketch and undo the second one, there will be an error. All the constraints disappear, and I can't add any more constraints. When I subsequently exit Sketcher, and try to re-enter it I got complains about invalid sketch. Deleting constraints to external geometry makes the sketch re-editable again.
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17803 (Git)
Build type: Release
Branch: master
Hash: 89961a33d46063a43e9fb5b0308ca95d559eca94
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
Last edited by aapo on Fri Aug 23, 2019 5:37 pm, edited 2 times in total.
Re: [Bug?] Using undo in Sketcher causes errors after the Big Merge
Can you provide a preferably very simple file with the rectangles and the references to external geometry?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [Bug?] Using undo in Sketcher causes errors after the Big Merge
Attached. Note that you'll be able to create such a file yourself simply by pressing "undo" in sketcher, with any sketch having any constraints. So, quite simple. I also tested with Linux with a self-compiled build, and the same error happens.
EDIT: I'm building the latest Git Master now to see, if there's a failure in the absolute newest FreeCAD head version.
EDIT2: It seems that the saved file does NOT have the bug, i.e. save-exit-load cycle fixes the corruption, which seems to exist in memory only as long as the executable runs.
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.17798 (Git)
Build type: Release
Branch: master
Hash: 7e60631239109c632a8f6cca83f6e7e5502e43a1
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)
- Attachments
-
- 20190822-FreeCAD-error.FCStd
- (5.74 KiB) Downloaded 59 times
Last edited by aapo on Thu Aug 22, 2019 3:46 pm, edited 1 time in total.
Re: [Bug?] Using undo in Sketcher causes errors after the Big Merge
Firstly I can confirm the bug when the project file is in a changed state i.e. not saved. The Sketcher Validation Tool states Four Missing Coincidences and Invalid Constraints Found after Undoing the second Rectangle. But, if you Save and Close the project file and then re-open it the Sketch can be opened error free. Therefore my assumption is that the Sketch is being analysed and a false positive is being generated only when in this changed state.
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17803 (Git)
Build type: Release
Branch: master
Hash: 89961a33d46063a43e9fb5b0308ca95d559eca94
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17803 (Git)
Build type: Release
Branch: master
Hash: 89961a33d46063a43e9fb5b0308ca95d559eca94
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
Re: [Bug?] Using undo in Sketcher causes errors after the Big Merge
The issue persists with the latest build, too. As an additional problem on Linux, FreeCAD crashes if I undo something in Sketcher, and after that add any constraint to the sketch.
Program received signal SIGSEGV, Segmentation fault.
#0 /lib/x86_64-linux-gnu/libc.so.6(+0x37840) [0x7f2d5c4a9840]
#1 0x7f2cf27e1d1a in finishDistanceConstraint(Gui::Command*, Sketcher::SketchObject*, bool)
So something in finishDistanceConstraint() seems to go belly up, presumably because the constraint list is in an unexpected state.
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.17850 (Git)
Build type: Release
Branch: master
Hash: 218d849355fa04f2a4790f17a7d0d0c193f99a03
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)
Program received signal SIGSEGV, Segmentation fault.
#0 /lib/x86_64-linux-gnu/libc.so.6(+0x37840) [0x7f2d5c4a9840]
#1 0x7f2cf27e1d1a in finishDistanceConstraint(Gui::Command*, Sketcher::SketchObject*, bool)
So something in finishDistanceConstraint() seems to go belly up, presumably because the constraint list is in an unexpected state.
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.17850 (Git)
Build type: Release
Branch: master
Hash: 218d849355fa04f2a4790f17a7d0d0c193f99a03
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)
Re: [Bug?] Using undo in Sketcher causes errors after the Big Merge
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: [Bug?] Using undo in Sketcher causes errors after the Big Merge
Undo works flawless here:
loaded your file, opened Sketcher
Use case 1: drag right upper corner, undo, sketch returns to initial state, with
Use case 2: add another rectangle right above existing, undo, second rectangle vanishes
All undos were tested with keyboard and icon.
OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17798 (Git)
Build type: Release
Branch: master
Hash: 7e60631239109c632a8f6cca83f6e7e5502e43a1
Python version: 3.7.3
Qt version: 5.9.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Germany (en_DE)
loaded your file, opened Sketcher
Use case 1: drag right upper corner, undo, sketch returns to initial state, with
Use case 2: add another rectangle right above existing, undo, second rectangle vanishes
All undos were tested with keyboard and icon.
OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17798 (Git)
Build type: Release
Branch: master
Hash: 7e60631239109c632a8f6cca83f6e7e5502e43a1
Python version: 3.7.3
Qt version: 5.9.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Germany (en_DE)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [Bug?] Using undo in Sketcher causes errors after the Big Merge
This may be related: After opening a file it is immediately in the edited state.
Edit: This is not a BigMerge issue, the behaviour was present before. I will investigate it further and open a new topic in due course.
Edit: This is not a BigMerge issue, the behaviour was present before. I will investigate it further and open a new topic in due course.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [Bug?] Using undo in Sketcher causes errors after the Big Merge
I made a gif animation demonstrating how to cause the error. I'm also quite sure that older v0.19 builds did not do this for me, as I use the undo feature quite often in Sketcher after I/O errors (idiot/operator ). Anyway, builds after the Big Merge do this every time for me with both Linux and Windows, when I use undo to remove anything in Sketcher. I used https://github.com/FreeCAD/FreeCAD/releases v0.19 release build 17803 for Windows for making the gif animation.
EDIT: I also tested with the old build 17651 before the Big Merge, and Sketcher undo worked flawlessly there, no problems whatsoever. Even if it does not seem to be directly related to the Big Merge process, I must point out that the time of occurrence of the bug is quite suspicious.
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17803 (Git)
Build type: Release
Branch: master
Hash: 89961a33d46063a43e9fb5b0308ca95d559eca94
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
EDIT: I also tested with the old build 17651 before the Big Merge, and Sketcher undo worked flawlessly there, no problems whatsoever. Even if it does not seem to be directly related to the Big Merge process, I must point out that the time of occurrence of the bug is quite suspicious.
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17803 (Git)
Build type: Release
Branch: master
Hash: 89961a33d46063a43e9fb5b0308ca95d559eca94
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
Re: [Bug?] Using undo in Sketcher causes errors after the Big Merge
The only commit based purely based on description that I can see being the issue is https://github.com/FreeCAD/FreeCAD/commit/022e6c you'll notice that the constraints are removed from the first geometry as well as the actual undo the user wants to be achieved.
I can confirm the last build before the Link3 merge that I have does not have this bug:
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17651 (Git)
Build type: Release
Branch: master
Hash: 16c26cb3b1cd7209ea8efc8cb30b3b18fd80cf95
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
I can confirm the last build before the Link3 merge that I have does not have this bug:
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17651 (Git)
Build type: Release
Branch: master
Hash: 16c26cb3b1cd7209ea8efc8cb30b3b18fd80cf95
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)