[SOLVED ]Crash when opening a sketch

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!
Post Reply
Escain
Posts: 40
Joined: Sun Oct 11, 2015 4:04 pm

[SOLVED ]Crash when opening a sketch

Post by Escain »

Hi!

i am having issues using the sketcher, it seem a bug but I wonder if it is only due to some user configuration or something else.

Description:
How to reproduce:
1) Open FreeCAD
2) Select the sketcher WB
3) Create a new empty document
4) Create a new Sketch
5) Accept the XY-Plane; no reverse direction; 00mm offset.
Result: Crash.

Another way to get the issue is by opening a previously created file and double-click any sketch.

Core-dump:
http://www.escain.org/download/core.freeCAD.2019-03-25

GDB bt:

Code: Select all

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007f28700e8535 in __GI_abort () at abort.c:79
#2  0x00007f28700e840f in __assert_fail_base (fmt=0x7f287024aee0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=0x7f28748361a8 "(SoBase::classTypeId != SoType::badType()) && \"An SoBase-derived class was attempted instantiated *before* Coin initialization. (Have you perhaps placed an SoBase-derived instance (e.g. a scene graph "..., file=0x7f2874835ffb "SoBase.cpp", line=199, function=<optimized out>) at assert.c:92
#3  0x00007f28700f60f2 in __GI___assert_fail (
    assertion=0x7f28748361a8 "(SoBase::classTypeId != SoType::badType()) && \"An SoBase-derived class was attempted instantiated *before* Coin initialization. (Have you perhaps placed an SoBase-derived instance (e.g. a scene graph "..., file=0x7f2874835ffb "SoBase.cpp", line=199, function=0x7f2874836be0 "SoBase::SoBase()") at assert.c:101
#4  0x00007f28744f4639 in SoBase::SoBase() () from /usr/lib/x86_64-linux-gnu/libCoin.so.80
#5  0x00007f2874508588 in SoPath::SoPath(int) () from /usr/lib/x86_64-linux-gnu/libCoin.so.80
#6  0x00007f28745013d9 in SoFullPath::SoFullPath(int) () from /usr/lib/x86_64-linux-gnu/libCoin.so.80
#7  0x00007f287451378e in SoTempPath::SoTempPath(int) () from /usr/lib/x86_64-linux-gnu/libCoin.so.80
#8  0x00007f28743936cc in SoAction::SoAction() () from /usr/lib/x86_64-linux-gnu/libCoin.so.80
#9  0x00007f28743a63fc in SoSearchAction::SoSearchAction() () from /usr/lib/x86_64-linux-gnu/libCoin.so.80
#10 0x00007f2857847354 in ?? () from /usr/lib/python2.7/dist-packages/pivy/_coin.x86_64-linux-gnu.so
#11 0x00007f2875352b31 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#12 0x00007f2875349622 in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#13 0x00007f28753d025c in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#14 0x00007f28753faad3 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#15 0x00007f28753e743c in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#16 0x00007f28753faad3 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#17 0x00007f2875396c02 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#18 0x00007f2875395dba in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#19 0x00007f28753faad3 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#20 0x00007f287534e9ca in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#21 0x00007f2875351599 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#22 0x00007f2875351599 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#23 0x00007f2875351599 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#24 0x00007f2875349622 in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#25 0x00007f2875349c39 in PyEval_EvalCode () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#26 0x00007f2875322066 in PyRun_StringFlags () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#27 0x00007f2875724b04 in Base::InterpreterSingleton::runString[abi:cxx11](char const*) () from /opt/freecad/free-cad-code/lib/libFreeCADBase.so
#28 0x00007f2876e1d71c in Gui::Command::runCommand(Gui::Command::DoCmd_Type, QByteArray const&) () from /opt/freecad/free-cad-code/lib/libFreeCADGui.so
#29 0x00007f285de4dc72 in SketcherGui::ViewProviderSketch::setEdit(int) () from /opt/freecad/free-cad-code/Mod/Sketcher/SketcherGui.so
#30 0x00007f2877109049 in Gui::ViewProvider::startEditing(int) () from /opt/freecad/free-cad-code/lib/libFreeCADGui.so

Info about FreeCAD

Code: Select all

OS: Debian GNU/Linux buster/sid
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16207 (Git)
Build type: Unknown
Branch: master
Hash: 741533941c67da2f721bf1b7c2d55c987fd22a0c
Python version: 2.7.16
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.9.1.oce-0.18
Locale: English/UnitedKingdom (en_GB)
Last edited by Escain on Mon Mar 25, 2019 10:16 pm, edited 1 time in total.
chrisb
Veteran
Posts: 52169
Joined: Tue Mar 17, 2015 9:14 am

Re: Crash when opening a sketch

Post by chrisb »

Moved to Help forum.

Have you tried to reset your config files?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9019
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Crash when opening a sketch

Post by openBrain »

chrisb wrote: Mon Mar 25, 2019 8:52 am Moved to Help forum.
@chrisb, looks like this thread is still on "Open Discussion". ;)

@Escrain : I guess you compiled yourself. Could you try compiling with Qt5 as well as using the OCCT lib coming with the FC repo instead of the OCE one coming with your distro ? Tell me if you don't succeed, I also went to this recently. ;)
Escain
Posts: 40
Joined: Sun Oct 11, 2015 4:04 pm

Re: Crash when opening a sketch

Post by Escain »

Have you tried to reset your config files?
Yes, that did not help unfortunately.
@Escrain : I guess you compiled yourself. Could you try compiling with Qt5 as well as using the OCCT lib coming with the FC repo instead of the OCE one coming with your distro ? Tell me if you don't succeed, I also went to this recently. ;)
Ok, I need an acronym course here! :lol:
Qt5: I have 5.11 installed, so I wonder why it is not used. I will check. In any case, it does not seem an issue of Qt.
OCCT / OCE: I used the community edition repository (https://github.com/tpaviot/oce) and built it myself. Which repository do you suggest?
Jee-Bee
Veteran
Posts: 2568
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Crash when opening a sketch

Post by Jee-Bee »

openBrain
Veteran
Posts: 9019
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Crash when opening a sketch

Post by openBrain »

Escain wrote: Mon Mar 25, 2019 6:20 pm Ok, I need an acronym course here! :lol:
Qt5: I have 5.11 installed, so I wonder why it is not used. I will check. In any case, it does not seem an issue of Qt.
OCCT / OCE: I used the community edition repository (https://github.com/tpaviot/oce) and built it myself. Which repository do you suggest?
For Qt, the CMake will by default use Qt4 (if it's found). The problem is that once you've run CMake (or CMake GUI) once, enabling Qt5 build afterwards doesn't work. So you have to start from a clean blank build and start a first CMake with the -DBUILD_QT5=ON option. Here when doing so, I have to also precise the Python suffix so everything goes well. To summarize, from a fresh new blank build, run first :

Code: Select all

cmake -DBUILD_QT5=ON -DPYTHON_CONFIG_SUFFIX="-python2.7.x86_64-linux-gnu" PATH_TO_SOURCE_DIR
Regarding OpenCascade, AFAIK, OCE is specifically the Community Edition. This is the one that often comes with distro. If you get the sources by adding the FreeCAD PPA, it provides a recent OCCT lib (7.3.0 IIRC). The problem here is probably also that CMake first find the OCE version from your distro repo. It's (normally) pretty easy to use OCCT instead by cleaning the OCE dev files :

Code: Select all

sudo apt-get purge liboce*dev
sudo apt-get install --reinstall libocct*
Better do it before running CMake. ;)
Escain
Posts: 40
Joined: Sun Oct 11, 2015 4:04 pm

Re: Crash when opening a sketch

Post by Escain »

@OpenBrain
This worked fine! It changed quite a lot, I even had to install new packages, but at the end, I could opend/use sketch again.
Thanks you.

OS: Debian GNU/Linux buster/sid
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16207 (Git)
Build type: Unknown
Branch: master
Hash: 741533941c67da2f721bf1b7c2d55c987fd22a0c
Python version: 2.7.16
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
openBrain
Veteran
Posts: 9019
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: [SOLVED ]Crash when opening a sketch

Post by openBrain »

Nice. Glad you succeed.
If at one time you want to give a try for a Qt5/Python3 build, there in useful information in this thread. ;)

But AFAIK, keeping Python2 is OK at this time, while using Qt5 & OCC7 is really better.
jmaustpc
Veteran
Posts: 11211
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: [SOLVED ]Crash when opening a sketch

Post by jmaustpc »

Escain wrote: Mon Mar 25, 2019 6:20 pm OCCT / OCE: I used the community edition repository (https://github.com/tpaviot/oce) and built it myself. Which repository do you suggest?
Development of OCE stopped a long time ago, I wouldn't be surprised if it doesn't work with current FreeCAD any more, at the very least there are many new features in OCC that are not in OCE.

OCE= Opencascade community edition which was a fork created due to frustration with the OpenCascade company, the company had backed down on most of the contentious issues and most of the OCE devs went back to OCC. OCC = OpenCascade
openBrain wrote: Mon Mar 25, 2019 6:58 pm build and start a first CMake with the -DBUILD_QT5=ON option
In most cases the best advise, if you want to compile FreeCAD, is to use "Cmake-GUI" rather than trying to remember command line options (and not miss type, and not know that various flags even exist in the first place), unless you are scripting an automatic build etc. Cmake-GUI shows you what all the options/parameters are in the first place, shows you what defaults have been picked up with --configure and allows you to change everything including finding/setting directories with a gui file selector.

This is particularly important when you start compiling many different instances of FreeCAD with different options and doing the same with FreeCAD's dependencies like OCC.

Back in the OCE days, I used to compile several versions of OCE both bug fix testing of OCE but also testing multi-threading options (which at the time did not speed up FreeCAD very much in most cases). I would then compile a FreeCAD instance for each oce. etc.
openBrain
Veteran
Posts: 9019
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: [SOLVED ]Crash when opening a sketch

Post by openBrain »

jmaustpc wrote: Mon Mar 25, 2019 11:48 pm
openBrain wrote: Mon Mar 25, 2019 6:58 pm build and start a first CMake with the -DBUILD_QT5=ON option
In most cases the best advise, if you want to compile FreeCAD, is to use "Cmake-GUI" rather than trying to remember command line options (and not miss type, and not know that various flags even exist in the first place), unless you are scripting an automatic build etc.
You're most probably right. But each time I tried to first run CMake-Gui, I found myself stuck because it already has acquired some values that makes it compile with Qt4. This is probably a lack of knowledge on my side, but with the "CLI method", I can set up a basic Qt5 configuration that I can then modify with CMake-Gui.
Maybe I didn't set value / configure / generate in the correct order. ;)
Post Reply