[solved] Follow on FreeCAD run error after re-compile

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
PMac
Posts: 135
Joined: Sat Sep 02, 2017 10:44 pm

[solved] Follow on FreeCAD run error after re-compile

Post by PMac »

Subsequent to the build error seen and fixed earlier https://forum.freecadweb.org/viewtopic. ... 15#p644515 I am now seeing a new run error as detailed below:
This is already fixed in master, please update your master and recompile.
So I cleared out the release build folder, did git pull and recompiled in the empty build folder from scratch. Compile now appears to complete OK.

However when going to run the GUI version of FreeCAD (from the terminal console), FC aborts as below with a new error:

Code: Select all

FreeCAD 0.21, Libs: 0.21R31143 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2022
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

FreeCAD: SoType.cpp:739: SbBool SoType::isDerivedFrom(SoType) const: Assertion `!this->isBad()' failed.
Aborted (core dumped)
Running the command-line version of FreeCADCmd does not abort and presents with the expected prompt for further actions.

Have entered this separately to the original fault as it is a different error.
Last edited by PMac on Fri Dec 16, 2022 9:42 am, edited 1 time in total.
PMac
Posts: 135
Joined: Sat Sep 02, 2017 10:44 pm

Re: Follow on FreeCAD run error after re-compile

Post by PMac »

Well that was a rabbit hole I never wish to see again. How I got in there initially I'll never know.

This is a long one, but the process may be helpful to others.

2 months plus later, hours wasted downloading and recompiling and still the crashes continued - always involving SoType bad assert. Nothing I could find online pointed to any specific error, just general information. Very hard to determine any fault cause from debugging, FC log, backtracing.

Finally a glimmer of light in this post https://forum.freecadweb.org/viewtopic.php?f=4&t=46740, particularly a comment by wmayer re duplicated installs of Coin libraries. Apparently loading the library the second time dumps associated variables and causes the bad assert.

Not really understanding what was going on, using ps -A and lsof - p <pid> I did manage to find that indeed I had the problem of duplicated Coin libraries. The problem one eventually appeared to be libCoin.so.80c. So as suggested elsewhere, I attempted remove all Coin bits and bobs. Then I started from scratch.

Manually rebuilt pivy, coin, quarter, SoQt all sourced from github Coin3d, without failure this time around. I'd had many errors along the learning curve, spent hours trying to understand readme and install instructions. Finally I rebuilt FC for the umpteenth time (both Release and Debug versions many times) and it finally works without SoType() crashing.

One of the main takeaways is re the compiling and building process when you encounter such a fault as I'll detail below.
(I've used pivy as the example, but this applies equally to any package )

Create a coin3d folder
Create a pivy folder below
While you're there, create the quarter, soqt and coin folders you'll need for those package compiles.

Clone pivy from github Coin3d/pivy into a source folder: coin3d/pivy/pivy_src
Create a build folder: coin3d/pivy/pivy_build

Always, always, always compile and build out-of-source.
(note that SoQt had a raft of errors reported to github re compiling at various folder levels earlier this year (2022) - this was another rabbit hole I tried to follow when trying to get a fix)

Change directory into pivy_build folder. Recheck you're in the correct folder.

Now do a cmake command as below. It's the same format every compile for any package.
(the -j8 just tells the processor to multithread using all 8x available processors on my machine)
Adjust the -j8 to suit your machine's number of processors whilst you have multiple cups of coffee, particularly during the later make processing)

cmake -j8 -DCMAKE_BUILD_TYPE=Release ../pivy_src
or cmake -j8 -DCMAKE_BUILD_TYPE=Debug ../pivy_src if you're going to use debug for fault finding

Whilst compiling and making, do not attempt to do other things, you'll eventually freeze your machine. Keep drinking coffee.

Ok, compile completes, hopefully without errors.
Next you'll need to make and from there, install your package. You'll definitely need a lot of coffee here.

Still in pivy_build directory, the commands are:
make -j8

And optionally, a full install.
sudo make -j8 install
(needs sudo admin rights to do installs under /usr folders)

The format of the commands always seems to remain the same for all packages. Always do a clean / hard reset of the source ex github, followed by a final git pull to remain current. Often the best option is to gut the build folder content into the trash bin, start again afresh, do your cmake, then the make command. Drink yet more coffee as you await completion of make.

I got there in the end, learnt heaps along the way. Hope this helps someone in the future.
Post Reply