[Solved] FC Crashes after opening sketcher FC 0.20(Debug mode)

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
MikeLemon
Posts: 52
Joined: Mon Aug 09, 2021 7:13 pm

[Solved] FC Crashes after opening sketcher FC 0.20(Debug mode)

Post by MikeLemon »

Hi,

After building FC 0.20 (git clone https://github.com/FreeCAD/FreeCAD.git) with VS following the guide: https://wiki.freecadweb.org/Compile_on_ ... io_15_2017

I couldn't find PYTHON_DEBUG_LIBRARY path and the other cmake parameters and after bulding and setting FreeCADMain as Start up Project and running it in debug mode x64 the FreeCAD launches and created a file a a body alright but when switching to the sketcher workbench it pop's up the next error and crashes:

Image

Could it be that python parameter thing? where do you find the cmake file that holds this parameters?
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: FC Crashes after opening sketcher FC 0.20(Debug mode)

Post by GeneFC »

As you have discovered, if not already known, cmake stuff is scattered all over in the source.

I use grepwin to quickly find the target.

Gene
MikeLemon
Posts: 52
Joined: Mon Aug 09, 2021 7:13 pm

Re: FC Crashes after opening sketcher FC 0.20(Debug mode)

Post by MikeLemon »

Looking at it now in the CMakeCache.txt in build bin folder in says that python was set to the python 3.8 in the libpack and yet sketcher would still crash and that's the only workbench I want to work on right now!!! :evil: :x

I assume it was indeed suppose to use python 3.8 for 0.20 build, could I have missed something compiling FC in debug mode?
jais
Posts: 6
Joined: Wed Aug 18, 2021 7:53 am

Re: FC Crashes after opening sketcher FC 0.20(Debug mode)

Post by jais »

I also had problems with finding the Python settings in the CMake GUI, so I ran it from the Visual Studio developer command prompt like this:

cmake -S .\source -B .\build -DFREECAD_LIBPACK_DIR=.\libpack -DPYTHON_DEBUG_LIBRARY=.\libpack\bin\libs\python38_d.lib -DPYTHON_EXECUTABLE=.\libpack\bin\python.exe -DPYTHON_INCLUDE_DIR=.\libpack\bin\include -DPYTHON_LIBRARY=.\libpack\bin\libs\python38.lib

msbuild ALL_BUILD.vcxproj /p:Configuration=Debug


and then I could run it from Visual Studio. Change the source, build and libpack folders to match your folders.

I also had some errors from the Qt code generation, but they went away by running msbuild a few more times - I suspect it is some concurrency problem
MikeLemon
Posts: 52
Joined: Mon Aug 09, 2021 7:13 pm

Re: FC Crashes after opening sketcher FC 0.20(Debug mode)

Post by MikeLemon »

jais wrote: Wed Sep 08, 2021 4:52 pm I also had problems with finding the Python settings in the CMake GUI, so I ran it from the Visual Studio developer command prompt like this:

cmake -S .\source -B .\build -DFREECAD_LIBPACK_DIR=.\libpack -DPYTHON_DEBUG_LIBRARY=.\libpack\bin\libs\python38_d.lib -DPYTHON_EXECUTABLE=.\libpack\bin\python.exe -DPYTHON_INCLUDE_DIR=.\libpack\bin\include -DPYTHON_LIBRARY=.\libpack\bin\libs\python38.lib

msbuild ALL_BUILD.vcxproj /p:Configuration=Debug


and then I could run it from Visual Studio. Change the source, build and libpack folders to match your folders.

I also had some errors from the Qt code generation, but they went away by running msbuild a few more times - I suspect it is some concurrency problem
Well I tryed a fresh build with your commands and still even after running it more than once when loading sketcher in FC the program collapses...
User avatar
chennes
Veteran
Posts: 3878
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: FC Crashes after opening sketcher FC 0.20(Debug mode)

Post by chennes »

Did you hit "Retry" there and look at the backtrace? That often helps figure out what's going wrong. I really wouldn't suspect Python as the culprit here.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
MikeLemon
Posts: 52
Joined: Mon Aug 09, 2021 7:13 pm

Re: FC Crashes after opening sketcher FC 0.20(Debug mode)

Post by MikeLemon »

chennes wrote: Thu Sep 09, 2021 12:39 pm Did you hit "Retry" there and look at the backtrace? That often helps figure out what's going wrong. I really wouldn't suspect Python as the culprit here.
Yeah Said something about QT old error message, I'm currentlly building the release version which atleast somewhat works with just a conserning warning error at the end of the build :|
User avatar
chennes
Veteran
Posts: 3878
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: FC Crashes after opening sketcher FC 0.20(Debug mode)

Post by chennes »

When you have a moment, can you re-run your debug version and paste in the backtrace?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: FC Crashes after opening sketcher FC 0.20(Debug mode)

Post by sgrogan »

MikeLemon wrote: Wed Sep 08, 2021 8:42 pm Well I tryed a fresh build with your commands and still even after running it more than once when loading sketcher in FC the program collapses...
Do you have a system installed Python? I've had trouble with this in the past to get CMake to use the one in the Libpack.
"fight the good fight"
MikeLemon
Posts: 52
Joined: Mon Aug 09, 2021 7:13 pm

Re: FC Crashes after opening sketcher FC 0.20(Debug mode)

Post by MikeLemon »

chennes wrote: Thu Sep 09, 2021 2:35 pm When you have a moment, can you re-run your debug version and paste in the backtrace?
Yes just done building it, there it is(right after entering sketcher)
sgrogan wrote: Thu Sep 09, 2021 5:28 pm
Image

MikeLemon wrote: Wed Sep 08, 2021 8:42 pm Well I tryed a fresh build with your commands and still even after running it more than once when loading sketcher in FC the program collapses...
Do you have a system installed Python? I've had trouble with this in the past to get CMake to use the one in the Libpack.
:

Yes python 3.9 though with QT5 installed I'm pretty sure.
Post Reply