from start: Segmentation fault (core dumped)

Asked by Luc OGER

I have just updated Opoensuse leap from 42.2 and 42.3 and I got a strange problem :
I am still able to compile the yade code without error-crash BUT I got immediately the " Segmentation fault (core dumped)" message without more comment or explanation.

I compiled after the the DEBUG option but the results is the same : no information, no way to found where is the problem??
could you give me some hints where and to find the problem.

Thanks

Luc

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Luc OGER
Solved:
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hello,
It is unusual that a debug build just segfaults. Could you please make sure you are really running a debug build?
E.g. do you see "-g" in the compiler options (in the output of cmake)? Are you sure you installed and executed the right binary? Is the "debug" build much bigger (in disk space) than non-debug?
Beyond that, did you recompile from scratch (cmake+make) in a fresh directory? and isn't there a specific problem reported by cmake?
Bruno

Revision history for this message
Luc OGER (luc-oger) said :
#2

IYes t is the case and here part of the Cmake output:
-- ===========================================================
-- Yade configured with following features: Odeint VTK OpenMP GTS GUI-Qt5 CGAL PFVFLOW GL2PS LBMFLOW
-- Disabled features: LINSOLV SPH DEFORM LIQMIGRATION MASK_ARBITRARY PROFILING PotentialParticles PotentialBlocks
-- Debug build
-- ===========================================================

and one of the first c++ in the make output :
[ 3%] Building CXX object gui/CMakeFiles/_GLViewer.dir/qt5/GLViewer.cpp.o
cd /home/oger/Yade/build/gui && /usr/bin/c++ -DBOOST_MATH_DISABLE_FLOAT128=1 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DYADE_ODEINT -D_GLViewer_EXPORTS -I/home/oger/Yade/trunk -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -I/usr/include/eigen3 -I/usr/include/vtk-7.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/home/oger/Yade/build -I/usr/include/QGLViewer -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtXml -isystem /usr/include/qt5/QtOpenGL -fPIC -O2 --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -std=c++11 -DYADE_VTK -DYADE_OPENMP -fopenmp -DYADE_GTS -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include -DQGLVIEWER_FOUND -DYADE_OPENGL -DYADE_QT5 -DYADE_CGAL -DFLOW_ENGINE -DYADE_GL2PS -DLBM_ENGINE -g -fPIC -ftrack-macro-expansion=0 -save-temps -fstack-protector -DYADE_DEBUG -g -DEIGEN_DONT_VECTORIZE -DEIGEN_DONT_ALIGN -DEIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT -DCGAL_DISABLE_ROUNDING_MATH_CHECK -frounding-math -fPIC -o CMakeFiles/_GLViewer.dir/qt5/GLViewer.cpp.o -c /home/oger/Yade/trunk/gui/qt5/GLViewer.cpp

where -g is:
-DLBM_ENGINE -g -fPIC -ftrack-macro-expansion=0 -save-temps -fstack-protector -DYADE_DEBUG -g

So I don't know how to look???

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#3

You can maybe get more than "segfault" if you run the program with "gdb" [1] (to at least know which library is crashing).
I'm not very familiar with gdb commands though, I can't give more details.
You could also try your luck with python debugger [2].
Bruno

[1] https://stackoverflow.com/questions/3718998/fixing-segmentation-faults-in-c
[2] https://stackoverflow.com/questions/16731115/how-to-debug-a-python-segmentation-fault

Revision history for this message
Luc OGER (luc-oger) said :
#4

thanks Bruno

Finally with the debug option and gdb I got the answer about the segmentation fault:
gdb
GNU gdb (GDB; openSUSE Leap 42.3) 8.0
Copyright (C) 2017 Free Software Foundation, Inc.
(gdb) file python
Reading symbols from python...(no debugging symbols found)...done.
(gdb) run yade-2017-09-11.git-949a2d9
Starting program: /usr/bin/python yade-2017-09-11.git-949a2d9
....
Welcome to Yade 2017-09-11.git-949a2d9
.....
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe4dd294c in ?? () from /usr/lib64/libQtGui.so.4

I have compiled yade with the QT5=ON option BUT the program is still looking at the /usr/lib64/libQtGui.so.4 which is linked to the QT4 version!
I think that is a problem inside the cmake script ?

indeed the /usr/lib64/libQt5Gui.so.5 and the /usr/lib64/libQt5Gui.so.4 are both present in the computer.

So I moved down to QT4 and the yade program is running well!

Revision history for this message
Anton Gladky (gladky-anton) said :
#5

That;s just mean that libqglviewer in OpenSuse is compiled against Qt4. So you are not able to swith to Qt5 in Yade without recompiling libqglviwer against qt5 and installing it.