Ticket #4319: Segfault removing edge from sketch

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
axos88
Posts: 12
Joined: Mon Oct 07, 2019 5:05 pm

Ticket #4319: Segfault removing edge from sketch

Postby axos88 » Wed Apr 22, 2020 12:56 pm

Probably something to do with the chamfering of the edge of the inner circle.

Repro:

1. Open Sketch "Sketch" within "Pad"
2. Delete inner circle
3. Segfault occurs.

Reproduces on FreeCAD_0.19-20514-Linux-Conda_glibc2.12-x86_64.AppImage

OS: Ubuntu 19.04 (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20514 (Git) AppImage
Build type: Release
Branch: master
Hash: a05ffd499366ab12fa1b43f37db73f4f1e9c332d
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
Attachments
RuhaRudTarto.FCStd
(68.08 KiB) Downloaded 17 times
Last edited by Kunda1 on Wed Apr 22, 2020 1:01 pm, edited 1 time in total.
Reason: Augmented thread title
axos88
Posts: 12
Joined: Mon Oct 07, 2019 5:05 pm

Re: 0004319: Segfault removing edge from sketch

Postby axos88 » Wed Apr 22, 2020 12:56 pm

kisolre
Posts: 3158
Joined: Wed Nov 21, 2018 1:13 pm

Re: Ticket #4319: Segfault removing edge from sketch

Postby kisolre » Wed Apr 22, 2020 4:10 pm

Could not reproduce. There is no inner circle is Sketch. There is inner slot. Deleting that causes expected wrong mapping in subsequent sketches but no other errors.

OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20477 (Git)
Build type: Release
Branch: master
Hash: 7d8ab175a68e476427e6e337fe3099b52da49dc8
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Bulgarian/Bulgaria (bg_BG)
User avatar
voskos
Posts: 66
Joined: Mon Dec 21, 2020 4:22 pm
Location: Greece

Re: Ticket #4319: Segfault removing edge from sketch

Postby voskos » Sat Jan 02, 2021 9:52 am

I can reproduce it, but it looks like an OCC bug in the chamfer
kisolre
Posts: 3158
Joined: Wed Nov 21, 2018 1:13 pm

Re: Ticket #4319: Segfault removing edge from sketch

Postby kisolre » Sat Jan 02, 2021 1:27 pm

voskos wrote:
Sat Jan 02, 2021 9:52 am
I can reproduce it,
With what version? As I mentioned before removing the inner SLOT will lead to bunch of toponaming problems later. Next sketch is based on a face from pad - this will brake. Fillet is based on edges generated mainly from the second sketch - this will also brake. Final chamfer is on the edges of the slot that was removed in step one. So the edges it was expected to chamfer no longer exist. This should not brake FreeCAD but surely can cause some OCC error. Which it does not do here.
I foundweird result with the fillet. If I remove the slot from the first sketch, remap properly the second sketch and try to recreate the fillet the order of edge selection leads to different results, some of them wrong. If I select the edges one by one along the resulting wire fillet is good. But if I select first the middle arc and then add the other edges result is broken fillet:
.
Broken fillet.JPG
Broken fillet.JPG (23.08 KiB) Viewed 158 times
.
OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23582 (Git)
Build type: Release
Branch: master
Hash: ceec7e3a8e03136e255fcd6b1da6ced6220c3b58
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Bulgarian/Bulgaria (bg_BG)
User avatar
voskos
Posts: 66
Joined: Mon Dec 21, 2020 4:22 pm
Location: Greece

Re: Ticket #4319: Segfault removing edge from sketch

Postby voskos » Sat Jan 02, 2021 6:04 pm

Using freecad-daily from the PPA
I thought I was going crazy, then realized that the file in the issue tracker is different. THAT one fails.

OS: Linux Mint 20 (X-Cinnamon/cinnamon2d)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: f2d17774e8c9154f80b98f797e3561ee2ad36061
Python version: 3.8.5
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.3.0
Locale: English/United States (en_US)
kisolre
Posts: 3158
Joined: Wed Nov 21, 2018 1:13 pm

Re: Ticket #4319: Segfault removing edge from sketch

Postby kisolre » Sat Jan 02, 2021 6:28 pm

Ok, that one failed also here. Here is the Edge22 that the chamfer is moved to. It tries to chamfer all tangent edges (the red line) and fails with "Illegal storage access" error after which FreeCAD usually crashes.
.
Edge22chamfer.JPG
Edge22chamfer.JPG (133.1 KiB) Viewed 130 times
.
Same happens with every edge (I tested just the big arc) along that wire. FreeCAD should capture that and not crash.