Bug (file specific): SEGV when causing a recompute from sketcher

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
xhalo32
Posts: 7
Joined: Fri May 04, 2018 4:22 am
Location: Espoo, Finland
Contact:

Bug (file specific): SEGV when causing a recompute from sketcher

Post by xhalo32 »

Important: This is a file specific bug and I have not been able to reproduce this. Please notice the file attached. I have not reported this in mantis since it does not affect every user.

Making anything in the sketcher that triggers a recompute (e.g. clicking a length constraint and pressing "OK") causes a crash due to a segfault. Modifying extrusion parameters that are related to the sketches (e.g "length fwd") do not cause a crash.

When modifying any of the sketches called "CapXY", "ArcXY", "CapCutoutOuterYZ", "ConConProfile", "ConConSide" or "ScrewXZ" a crash does not occur; modifying any other sketch does trigger the crash. The length constraint in the sketch called "ReinforcementYZ" can be shrunk and does not cause a crash until the edit is undone and a recompute has been called.

Using lattice2 I can freeze the document and one by one recompute every touched item individually without a crash, but immediately when pressing F5 to recompute the whole document with nothing touched causes a crash!

Removing every cut and fusion in the document gets rid of the crashing.

It is most likely not caused by running out of memory.

Exact output of the AppImage executable:

/tmp/.mount_FreeCAAjqbBX
FreeCAD 0.19, Libs: 0.19R16207 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2019
##### #### ### ####
# # # # # #
# ## #### #### # # # # #
#### # # # # # # # ##### # #
# # #### #### # # # # #
# # # # # # # # # ## ## ##
# # #### #### ### # # #### ## ## ##

During initialization the error invalid character in identifier (<string>, line 1) occurred in /home/niklash/.FreeCAD/Mod/Fasteners/Init.py
Please look into the log file for further information
During initialization the error No module named 'core' occurred in /home/niklash/.FreeCAD/Mod/FreeCAD_assembly2/InitGui.py
Please look into the log file for further information
During initialization the error invalid character in identifier (<string>, line 1) occurred in /home/niklash/.FreeCAD/Mod/Fasteners/InitGui.py
Please look into the log file for further information
SIGSEGV signal raised: 11
terminate called after throwing an instance of 'std::runtime_error'
what(): throw_signal
/tmp/.mount_FreeCAAjqbBX/AppRun: line 10: 31628 Aborted (core dumped) ${HERE}/usr/bin/FreeCAD "$@"


The python errors in the output do not have anything to do with this problem. The output starting with "SIGSEGV signal raised: 11" gets printed at the crash.

FreeCad info:
OS: Arch Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16207 (Git) AppImage
Build type: Release
Branch: master
Hash: 741533941c67da2f721bf1b7c2d55c987fd22a0c
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Attachments
pt92legacy_slidecap.FCStd
(219.41 KiB) Downloaded 34 times
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug (file specific): SEGV when causing a recompute from sketcher

Post by chrisb »

Moved to Help forum, that's where bugs are discussed.

Please put the log output in code tags </>. It improves readability.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
quick61
Veteran
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Bug (file specific): SEGV when causing a recompute from sketcher

Post by quick61 »

I am getting a crash here too, when editing "ReinforcementYZ". Sort of looks like an OCC crash to me, but I'm no expert on that sort of thing.

/usr/lib/x86_64-linux-gnu/libTKShHealing.so.7

Code: Select all

(gdb) run
Starting program: /usr/bin/freecad-daily 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
FreeCAD 0.19, Libs: 0.19R
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2019
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Interlocking laser cut workbench loaded
[New Thread 0x7fffe1316700 (LWP 10774)]
[New Thread 0x7fffd3609700 (LWP 10775)]
[New Thread 0x7fffc2bc4700 (LWP 10776)]
[New Thread 0x7fffc2282700 (LWP 10777)]
[New Thread 0x7fffc1a81700 (LWP 10778)]
[New Thread 0x7fffc1280700 (LWP 10779)]
[New Thread 0x7fffc0a7f700 (LWP 10780)]
[New Thread 0x7fffabfff700 (LWP 10781)]
[New Thread 0x7fffab7fe700 (LWP 10782)]
[New Thread 0x7fffaaffd700 (LWP 10783)]
[New Thread 0x7fffaa7fc700 (LWP 10784)]
[New Thread 0x7fffa9ffb700 (LWP 10785)]
[New Thread 0x7fffa97fa700 (LWP 10786)]
[New Thread 0x7fffa8ff9700 (LWP 10787)]
[New Thread 0x7fff8bfff700 (LWP 10788)]
[Thread 0x7fff8bfff700 (LWP 10788) exited]
connect failed: No such file or directory
[New Thread 0x7fff8bfff700 (LWP 10793)]
[New Thread 0x7fff6d214700 (LWP 10794)]
[New Thread 0x7fff67c30700 (LWP 10797)]
[Thread 0x7fff67c30700 (LWP 10797) exited]
[Thread 0x7fff6d214700 (LWP 10794) exited]
[New Thread 0x7fff6d214700 (LWP 10800)]
[New Thread 0x7fff67c30700 (LWP 10801)]
[New Thread 0x7fff6703c700 (LWP 10802)]
[New Thread 0x7fff66c3b700 (LWP 10803)]
[New Thread 0x7fff6683a700 (LWP 10804)]
[New Thread 0x7fff66439700 (LWP 10805)]
[New Thread 0x7fff66038700 (LWP 10806)]
[New Thread 0x7fff65c37700 (LWP 10807)]

Thread 1 "freecad-daily" received signal SIGSEGV, Segmentation fault.
0x00007fff80a1c4bd in ShapeFix_Face::FixOrientation(NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>&) ()
   from /usr/lib/x86_64-linux-gnu/libTKShHealing.so.7
(gdb) c
Continuing.
SIGSEGV signal raised: 11
terminate called after throwing an instance of 'std::runtime_error'
  what():  throw_signal

Thread 1 "freecad-daily" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) c
Continuing.
Couldn't get registers: No such process.
Couldn't get registers: No such process.
(gdb) [Thread 0x7fff65c37700 (LWP 10807) exited]
[Thread 0x7fff66038700 (LWP 10806) exited]
[Thread 0x7fff66439700 (LWP 10805) exited]
[Thread 0x7fff6683a700 (LWP 10804) exited]
[Thread 0x7fff66c3b700 (LWP 10803) exited]
[Thread 0x7fff6703c700 (LWP 10802) exited]
[Thread 0x7fff67c30700 (LWP 10801) exited]
[Thread 0x7fff6d214700 (LWP 10800) exited]
[Thread 0x7fff8bfff700 (LWP 10793) exited]
[Thread 0x7fffa8ff9700 (LWP 10787) exited]
[Thread 0x7fffa97fa700 (LWP 10786) exited]
[Thread 0x7fffa9ffb700 (LWP 10785) exited]
[Thread 0x7fffaa7fc700 (LWP 10784) exited]
[Thread 0x7fffaaffd700 (LWP 10783) exited]
[Thread 0x7fffab7fe700 (LWP 10782) exited]
[Thread 0x7fffabfff700 (LWP 10781) exited]
[Thread 0x7fffc0a7f700 (LWP 10780) exited]
[Thread 0x7fffc1280700 (LWP 10779) exited]
[Thread 0x7fffc1a81700 (LWP 10778) exited]
[Thread 0x7fffc2282700 (LWP 10777) exited]
[Thread 0x7fffc2bc4700 (LWP 10776) exited]
[Thread 0x7fffd3609700 (LWP 10775) exited]
[Thread 0x7fffe1316700 (LWP 10774) exited]

Program terminated with signal SIGABRT, Aborted.
The program no longer exists.
Mark

** Build date 2019/05/25 22:00:29 **

OS: Ubuntu 18.04.2 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.6.7
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
This post made with 0.0% Micro$oft products - GOT LINUX?
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug (file specific): SEGV when causing a recompute from sketcher

Post by chrisb »

I had understood that it was not reproducible so I didn't check. Seeing Mark's answer I reproduced the crash here on a completely different system. I changed in BaseXY the width from 10.6mm to 10.7mm. FreeCAD crashes on closing Sketcher with OK.
The message doesn't show much:

Code: Select all

FreeCAD 0.19, Libs: 0.19R16822 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2019
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

/Users/cb/Desktop/FreeCAD.app/Contents/MacOS/FreeCAD: line 10: 78073 Segmentation fault: 11  "$PREFIX/bin/FreeCAD" $@
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug (file specific): SEGV when causing a recompute from sketcher

Post by chrisb »

Two further observations:
- The crash occurs without sketcher too, when changing the same constraint in the properties tab.
- a logfile may tell more:

Code: Select all

FreeCAD 0.19, Libs: 0.19R16822 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2019
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

/Users/cb/Desktop/FreeCAD.app/Contents/MacOS/FreeCAD: line 10: 78132 Segmentation fault: 11  "$PREFIX/bin/FreeCAD" $@
maccb:tmp cb$ less /tmp/fc.log 

Log: Init:      Initializing /Users/cb/Desktop/FreeCAD.app/Contents/Resources/Mod/PartDesign... done
Log: Init:      Initializing /Users/cb/Desktop/FreeCAD.app/Contents/Resources/Mod/Tux... done
Log: Init:      Initializing /Users/cb/Desktop/FreeCAD.app/Contents/Resources/Mod/Part... done
Log: Init:      Initializing /Users/cb/Desktop/FreeCAD.app/Contents/Resources/Mod/Import... done
Log: Init:      Initializing /Users/cb/Desktop/FreeCAD.app/Contents/Resources/Mod/Material... done
Log: Init:      Initializing /Users/cb/Desktop/FreeCAD.app/Contents/Resources/Mod/Raytracing... done
Log: Init:      Initializing /Users/cb/Library/Preferences/FreeCAD/Mod/FCGear(InitGui.py not found)... ignore
Log: Init:      Initializing /Users/cb/Library/Preferences/FreeCAD/Mod/BIM... done
Log: Init:      Initializing /Users/cb/Library/Preferences/FreeCAD/Mod/fasteners... done
Log: Init: Initializing freecad.gears
Log: Init: Initializing freecad.gears... done
Log: Init: Loading FreeCAD GUI
Log: Init: Running FreeCADGuiInit.py start script... done
Log: Init: Activating default workbench StartWorkbench
Log: Loading GUI of Web module... done
Log: Loading GUI of Start module... done
Log: Loading Start module... done
Log: Init: Showing main window
Log: Main window restored
Log: Show main window
Log: Toolbars restored
Log: Init: Entering event loop
Log: Init: Processing command line files
Log: Module: Part
Log: Loading Part module... done
Log: Loading Sketcher module... done
Log: Loading GUI of Part module... done
Log: Loading GUI of Sketcher module... done
Log: Loading PartDesign module... done
Log: Loading GUI of PartDesign module... done
Log: Sketcher::setUpSketch()-T:0.005
Log: Sketcher::Solve()-DogLeg-T:0.002
Log: Sketcher::setUpSketch()-T:0.002
Log: Sketcher::Solve()-DogLeg-T:0.001
Log: Sketcher::setUpSketch()-T:0.001
Log: Sketcher::Solve()-DogLeg-T:0
Log: Sketcher::setUpSketch()-T:0
Log: Sketcher::Solve()-DogLeg-T:0
Log: Sketcher::setUpSketch()-T:0.001
Log: Sketcher::Solve()-DogLeg-T:0
Log: Sketcher::setUpSketch()-T:0.001
Log: Sketcher::Solve()-DogLeg-T:0
Log: Sketcher::setUpSketch()-T:0
Log: Sketcher::Solve()-DogLeg-T:0
Log: Sketcher::setUpSketch()-T:0
Log: Sketcher::Solve()-DogLeg-T:0
Log: Sketcher::setUpSketch()-T:0
Log: Sketcher::Solve()-DogLeg-T:0
Log: Sketcher::setUpSketch()-T:0
Log: Sketcher::Solve()-DogLeg-T:0
Log: Sketcher::setUpSketch()-T:0
Log: Sketcher::Solve()-DogLeg-T:0
Log: Sketcher::setUpSketch()-T:0.001
Log: Sketcher::Solve()-DogLeg-T:0
Log: Sketcher::setUpSketch()-T:0
Log: Sketcher::Solve()-DogLeg-T:0
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug (file specific): SEGV when causing a recompute from sketcher

Post by chrisb »

... and one more: a full recompute makes FreeCAD crash as well.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug (file specific): SEGV when causing a recompute from sketcher

Post by chrisb »

The attached file causes a crash on recompute. If I delete Cut001 the recompute succeedes.
Attachments
pt92legacy_slidecap.FCStd
(141.49 KiB) Downloaded 28 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: Bug (file specific): SEGV when causing a recompute from sketcher

Post by kisolre »

Something is wrong with ReinforcementYZ sketch (original file). Here it is when loading the file:
ReinforcementYZ_BeforeRecompute.JPG
ReinforcementYZ_BeforeRecompute.JPG (61.83 KiB) Viewed 818 times
and here after just a recompute of that sketch:
ReinforcementYZ_AfterRecompute.JPG
ReinforcementYZ_AfterRecompute.JPG (103.23 KiB) Viewed 818 times
.
The second image is the valid sketch with those constraints:
[/code]
ReinforcementYZ_Valid.JPG
ReinforcementYZ_Valid.JPG (48.19 KiB) Viewed 818 times
.
No crash here

Code: Select all

OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16687 (Git)
Build type: Release
Branch: master
Hash: ff1fb11af15a7c5f7f0ba3ef79588e128f397c2c
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Bulgarian/Bulgaria (bg_BG)
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: Bug (file specific): SEGV when causing a recompute from sketcher

Post by kisolre »

chrisb wrote: Sun May 26, 2019 5:52 pm The attached file causes a crash on recompute. If I delete Cut001 the recompute succeedes.
Again no crash but ReinforcementYZ produces a shell (Extrude007) and then Fusion003 fails:
Extrude007_shell.JPG
Extrude007_shell.JPG (125.41 KiB) Viewed 815 times
xhalo32
Posts: 7
Joined: Fri May 04, 2018 4:22 am
Location: Espoo, Finland
Contact:

Re: Bug (file specific): SEGV when causing a recompute from sketcher

Post by xhalo32 »

What lead to this Point to not be calculated is uncertain. I did not have the document frozen with lattice2 while designing this.

As a complete fix for this "fully constrained but wrongly placed" issue is infeasible due to me not recording every action from creating a new document to ending up here, the cut "Cut001" should not cause FreeCAD to crash but rather show an error icon or something like what is currently implemented with fillets etc.

What makes this strange is that I can, in a new document, create self-intersecting "invalid" geometry, create a fusion with a box, and do cuts on the fusion without crashing FreeCAD. Therefore this bug needs more investigation, at least in my opinion.

I have attached an image with a very similar configuration that does not crash FreeCAD.
Attachments
tmp.png
tmp.png (139.85 KiB) Viewed 806 times
Post Reply