crash switching work bench

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
HarryvL
Posts: 1057
Joined: Sat Jan 06, 2018 7:38 pm

crash switching work bench

Postby HarryvL » Wed Aug 08, 2018 9:07 pm

Hi, I recently moved from Ubuntu 16.04 to Windows 10 and managed to build two versions of FreeCAD (version info below) using CMake 3.12.0, LibPack FreeCADLibs_11.11_x64_VC12 and Visual Studio 2013. As far as I can see I don't get any errors along the way. However, although fully functional, both versions crash when switching work bench. Saving of the FCStd file in between WB switches seems to reduce the likelihood of a crash, but not consistently so. Did anybody experience the same issue and/or have a suggestion what to do about it?
Stop.png
Stop.png (344.89 KiB) Viewed 364 times
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14267 (Git)
Build type: Release
Branch: master
Hash: f99940ff1943a8985d76b339ea973191b71986b8
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/Denmark (en_DK)

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14094 (Git)
Build type: Release
Branch: trajectories
Hash: ce3e7dde66665997b33134b531d6d01834130730
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/Denmark (en_DK)
wmayer
Site Admin
Posts: 15126
Joined: Thu Feb 19, 2009 10:32 am

Re: crash switching work bench

Postby wmayer » Wed Aug 08, 2018 11:10 pm

Open a Windows Explorer and enter %APPDATA% into the address bar and got to the FreeCAD directory. Here you may find the file crash.dmp which you can load into Visual Studio. After pressing F5 it should show the call stack of the crash. Maybe you can see the function name of the last call.

If you don't get any useful information it's best to make a debug build and test it there.
User avatar
HarryvL
Posts: 1057
Joined: Sat Jan 06, 2018 7:38 pm

Re: crash switching work bench

Postby HarryvL » Thu Aug 09, 2018 3:42 am

Thanks Werner. There is no crash.dmp file in >AppData>Roaming>FreeCAD. I will try a Debug Build. Harry
User avatar
HarryvL
Posts: 1057
Joined: Sat Jan 06, 2018 7:38 pm

Re: crash switching work bench

Postby HarryvL » Thu Aug 09, 2018 5:24 am

I managed to do a debug build, but can't start that with "F5" (Unable to start program; ...\x64\Debug\ALL_BUILD; access denied). Anyway, starting FreeCAD_d.exe from Windows Explorer gives an (unrelated?) python error in the report window: x64\Debug\ALL_BUILD

Code: Select all

Traceback (most recent call last): 
File "C:\Users\hvlan\Documents\FC_Daily\Build\Mod\Fem\femguiobjects\_ViewProviderFemResultMechanical.py", line 43, in <module>
import numpy as np
File "C:\Users\hvlan\Documents\FC_Daily\Build\bin\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\Users\hvlan\Documents\FC_Daily\Build\bin\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Users\hvlan\Documents\FC_Daily\Build\bin\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Users\hvlan\Documents\FC_Daily\Build\bin\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Users\hvlan\Documents\FC_Daily\Build\bin\lib\site-packages\numpy\core\__init__.py", line 24, in <module>
raise ImportError(msg)
<type 'exceptions.ImportError'>: 
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
However, I wouldn't exepect that to be related to the crash (?). Apart from that, I am pretty much stuck.
User avatar
HarryvL
Posts: 1057
Joined: Sat Jan 06, 2018 7:38 pm

Re: crash switching work bench

Postby HarryvL » Thu Aug 09, 2018 5:46 am

By the way, FreeCAD_d does produce a crash.dmp file, but it is not very informative:
crash_dmp.png
crash_dmp.png (165.04 KiB) Viewed 330 times
User avatar
HarryvL
Posts: 1057
Joined: Sat Jan 06, 2018 7:38 pm

Re: crash switching work bench

Postby HarryvL » Thu Aug 09, 2018 5:50 am

Hang-on, there is more interesting information ...
Crash_dmp_2.png
Crash_dmp_2.png (260.27 KiB) Viewed 329 times
wmayer
Site Admin
Posts: 15126
Joined: Thu Feb 19, 2009 10:32 am

Re: crash switching work bench

Postby wmayer » Thu Aug 09, 2018 6:06 am

I managed to do a debug build, but can't start that with "F5" (Unable to start program; ...\x64\Debug\ALL_BUILD; access denied).
You have to set FreeCADMain as the active project or alternatively set the executable in the properties of the ALL_BUILD project.
By the way, FreeCAD_d does produce a crash.dmp file, but it is not very informative:
So, the debug version did but the release version not? I don't know how VS 2013 (or later) handles .dmp files but with VS 2008 (or earlier) you could load it via Edit > Open > Project/Solution and then press F5 to start the debugger. It then jumps to the location where the crash happened. So, it's not just statistical information as shown in your screen shot.

But anyway you get the crash inside the destructor of an OCCT array class which is called from ViewProviderPartExt::getNormals. But I don't see how this can be called only from a wb switch. Maybe you can scroll down the Call Stack window a bit to see which are the calling instances. Maybe it gives you, me or someone else an idea.
User avatar
HarryvL
Posts: 1057
Joined: Sat Jan 06, 2018 7:38 pm

Re: crash switching work bench

Postby HarryvL » Thu Aug 09, 2018 7:56 pm

wmayer wrote:
Thu Aug 09, 2018 6:06 am
So, the debug version did but the release version not?
Correct
wmayer wrote:
Thu Aug 09, 2018 6:06 am
So, it's not just statistical information as shown in your screen shot.
Indeed. See below for the full dump. Any help would be appreciated, because unfortunately I lack knowledge in all relevant areas :? ...

---
crash_1.png
crash_1.png (329.29 KiB) Viewed 302 times
---
crash_2.png
crash_2.png (239.04 KiB) Viewed 302 times
wmayer
Site Admin
Posts: 15126
Joined: Thu Feb 19, 2009 10:32 am

Re: crash switching work bench

Postby wmayer » Thu Aug 09, 2018 8:47 pm

Apparently you have opened the HTML Startpage and clicked on one of the files there. I guess internally it runs a Python script that switches the workbench and loads the file.

But it doesn't seem that the switch of the workbench is the problem but loading the Part object. Now, on which link on the Startpage did you click?
User avatar
HarryvL
Posts: 1057
Joined: Sat Jan 06, 2018 7:38 pm

Re: crash switching work bench

Postby HarryvL » Thu Aug 09, 2018 8:58 pm

I don't fully understand Werner. In all cases the crash occurred when switching between work benches. So I didn't leave the program nor did I open any pages from within the program (didn't know that was possible anyway). I did not open help pages or anything at the time of the crash, if that is what you mean?