segmentation fault using the FEM-examples from the start page

About the development of the FEM module/workbench.

Moderator: bernd

HoWil
Posts: 837
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

segmentation fault using the FEM-examples from the start page

Postby HoWil » Wed Jul 31, 2019 9:47 am

Hi,

I can reproduce a segmentation fault using the FEM-examples from the start page :? .

When I use the example 'FemCalculixCantilever3D' everything works fine *) but when I use 3D beam example with the new solvers called 'FemCalculixCantilever3D_newSolver' a Segmentation fault appears.

Steps to reproduce:
+ opening the related model for the start page
+ double click on the analyses symbol to switch to the FEM wb
+ double click on the solver symbol e.g. 'CalculiXccxTools' to open the task panel
+ click 'write .inp file' click 'Run Calculix' or 'Run' for the model with the new solver

I run the following appimage on ubuntu 18.04.2 FreeCAD_0.18-16131-Linux-Conda_Py3Qt5_glibc2.12-x86_64.AppImage
My Fc-info is:

Code: Select all

OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16131 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.18.3)
Hash: 3129ae4296e40ed20e7b3d460b86e6969acbe1c3
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)
The following output of my terminal shows the output when running both above mentioned models one after another. The fault also happens if I only run the model with the new solver.

Code: Select all

~/bin/FreeCAD$ ./FreeCAD_0.18-16131-Linux-Conda_Py3Qt5_glibc2.12-x86_64.AppImage 
/tmp/.mount_FreeCAvXK7h0
FreeCAD 0.18, Libs: 0.18R16131 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2019
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##


** (FreeCAD:3247): WARNING **: 11:28:42.923: invalid source position for vertical gradient

** (FreeCAD:3247): WARNING **: 11:28:42.923: invalid source position for vertical gradient
Generic Warning: In ../Common/Core/vtkInstantiator.cxx, line 265
vtkInstantiator::CreateInstance was deprecated for VTK 8.1 and will be removed in a future version.

Generic Warning: In ../Common/Core/vtkInstantiator.cxx, line 265
vtkInstantiator::CreateInstance was deprecated for VTK 8.1 and will be removed in a future version.

FEM preferences working dir setting is empty, the solver working directory is used.
All working Dir settings are empty: ''.
Working directory: '' doesn't exist.
Dir '/tmp' will be used instead.
FemToolsCCx.setup_working_dir()  -->  self.working_dir = /tmp
SolidMaterial has empty References.
FemConstraintFixed has Face reference shapes.
FemConstraintForce has Face reference shapes.
SolidMaterial has empty References.
FemInputWriterCcx --> self.dir_name  -->  /tmp/
FemInputWriterCcx --> self.main_file_name  -->  Box_Mesh.inp
FemInputWriterCcx --> self.file_name  -->  /tmp/Box_Mesh.inp
Constraint fixed: FemConstraintFixed
  nodes will be retrieved by searching the appropriate nodes in the FEM mesh
  ReferenceShape ... Type: Face, Object name: Box, Object label: Cube, Element name: Face1
Constraint force: FemConstraintForce
Writing time input file: 0.01 seconds 

runCalculix
run CalculiX at: /tmp/.mount_FreeCAvXK7h0/usr/bin/ccx with: /tmp/Box_Mesh
calculixStarted()
PySide2.QtCore.QProcess.ProcessState.Running
calculixFinished() 0
PySide2.QtCore.QProcess.ProcessState.NotRunning
PySide2.QtCore.QRegExp('\*ERROR.*\n\n', 1, 0)
CalculiX done without error!
We will load the ccx frd and dat result file.
Read ccx results from frd file: /tmp/Box_Mesh.frd
Added DisplacementLengths.
Read ccx results from dat file: /tmp/Box_Mesh.dat
Generic Warning: In ../Common/Core/vtkInstantiator.cxx, line 265
vtkInstantiator::CreateInstance was deprecated for VTK 8.1 and will be removed in a future version.

SolidMaterial has empty References.
FemConstraintFixed has Face reference shapes.
FemConstraintForce has Face reference shapes.
FemInputWriterCcx --> self.dir_name  -->  /tmp/femvv14mxpp/
FemInputWriterCcx --> self.main_file_name  -->  FEMMeshGmsh.inp
FemInputWriterCcx --> self.file_name  -->  /tmp/femvv14mxpp/FEMMeshGmsh.inp
Constraint fixed: FemConstraintFixed
  nodes will be retrieved by searching the appropriate nodes in the FEM mesh
  ReferenceShape ... Type: Face, Object name: Box, Object label: Cube, Element name: Face1
Constraint force: FemConstraintForce
Writing time input file: 0.02 seconds 

Read ccx results from frd file: /tmp/femvv14mxpp/FEMMeshGmsh.frd
Added DisplacementLengths.
Read ccx results from dat file: /tmp/femvv14mxpp/FEMMeshGmsh.dat
Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f47eee83f20]
#1  0x7f47f06957a0 in QTextDocument::docHandle() const from /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libQt5Gui.so.5+0
#2  0x7f47f068d718 in QTextFrame::begin() const from /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libQt5Gui.so.5+0x18
#3  /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libQt5Gui.so.5(+0x2175ca) [0x7f47f06c05ca]
#4  /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libQt5Gui.so.5(+0x2179c5) [0x7f47f06c09c5]
#5  0x7f47f06c0d50 in QTextDocumentLayout::doLayout(int, int, int) from /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libQt5Gui.so.5+0xf0
#6  0x7f47f06c232f in QTextDocumentLayout::documentChanged(int, int, int) from /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libQt5Gui.so.5+0x1df
#7  /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libQt5Gui.so.5(+0x1fcb5e) [0x7f47f06a5b5e]
#8  0x7f47f069395a in QTextDocument::setPlainText(QString const&) from /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libQt5Gui.so.5+0x4a
#9  /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libQt5Widgets.so.5(+0x32a450) [0x7f47f0d75450]
#10  0x7f47f53a8d95 in Gui::DAG::Model::updateSlot() from /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libFreeCADGui.so+0x1255
#11  0x7f47f53a9796 in Gui::DAG::Model::awake() from /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libFreeCADGui.so+0x16
#12  0x7f47f02248d1 in QMetaObject::activate(QObject*, int, int, void**) from /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libQt5Core.so.5+0x2c1
#13  0x7f47f024b9c9 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libQt5Core.so.5+0x99
#14  0x7f47f01f853b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libQt5Core.so.5+0xfb
#15  0x7f47f0200466 in QCoreApplication::exec() from /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libQt5Core.so.5+0x86
#16  0x7f47f522025c in Gui::Application::runApplication() from /tmp/.mount_FreeCAvXK7h0/usr/bin/../lib/libFreeCADGui.so+0x16bc
#17  /tmp/.mount_FreeCAvXK7h0/usr/bin/FreeCAD(main+0x6c9) [0x403829]
#18  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f47eee66b97]
#19  /tmp/.mount_FreeCAvXK7h0/usr/bin/FreeCAD() [0x404699]

Can anyone reproduce this? Any hints?
BR,
HoWil
HoWil
Posts: 837
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: segmentation fault using the FEM-examples from the start page

Postby HoWil » Thu Aug 01, 2019 12:29 pm

wmayer wrote: ping
Can you please have a look.
Maybe here is not the right place to post this.
How to proceed?
Br
Howil
looo
Posts: 2734
Joined: Mon Nov 11, 2013 5:29 pm

Re: segmentation fault using the FEM-examples from the start page

Postby looo » Thu Aug 01, 2019 1:06 pm

HoWil wrote:
Wed Jul 31, 2019 9:47 am
Steps to reproduce:
+ opening the related model for the start page
+ double click on the analyses symbol to switch to the FEM wb
+ double click on the solver symbol e.g. 'CalculiXccxTools' to open the task panel
+ click 'write .inp file' click 'Run Calculix' or 'Run' for the model with the new solver
no crash here with:

Code: Select all

OS: Ubuntu 18.04.2 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17445 (Git)
Build type: Release
Branch: master
Hash: 741dddf25485f692596faa9b7911e2e0f5d362a3
Python version: 3.7.3
Qt version: 5.9.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
also works on windows with:

Code: Select all

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17445 (Git)
Build type: Release
Branch: master
Hash: 741dddf25485f692596faa9b7911e2e0f5d362a3
Python version: 3.7.3
Qt version: 5.9.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
HoWil
Posts: 837
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: segmentation fault using the FEM-examples from the start page

Postby HoWil » Thu Aug 01, 2019 7:06 pm

looo wrote:
Thu Aug 01, 2019 1:06 pm
no crash here with:
I also tried it with a second system and had no problems:

Code: Select all

OS: Ubuntu 18.10 (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.6.8
Qt version: 5.11.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
:?: Hmmmmm
Will try the appimage on this second system as well and will report back.
HoWil
Posts: 837
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: segmentation fault using the FEM-examples from the start page

Postby HoWil » Thu Aug 01, 2019 7:31 pm

also works on the second system with:

Code: Select all

OS: Ubuntu 18.10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16131 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.18.3)
Hash: 3129ae4296e40ed20e7b3d460b86e6969acbe1c3
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)
EDIT Tomorrow I will try to remove and reinstall FC on my 18.04.2 system and will try it again. Thanks looo
wmayer
Site Admin
Posts: 14585
Joined: Thu Feb 19, 2009 10:32 am

Re: segmentation fault using the FEM-examples from the start page

Postby wmayer » Thu Aug 01, 2019 11:26 pm

With a debug build of

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17506 (Git)
Build type: Debug
Branch: master
Hash: b23589d6af576291097ae4051f26b5c529885e08
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

it crashes for me and the VC++ runtime raises an abort() dialog. When I attach with a debugger then the callstack says that it's related somehow to PySide/shiboken/Python. Hard to say what exactly is the problem.

When using the release version instead then everything is OK.