FreeCAD crashes after SolverCalculix job completed

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!
FreeCAD97990
Posts: 23
Joined: Sat Jul 01, 2017 12:11 pm

FreeCAD crashes after SolverCalculix job completed

Postby FreeCAD97990 » Sun Jan 21, 2018 12:52 am

This is a problem that I have had over the last, say, 15 development builds. It affects not just SolverCalculix but also the Elmer and Z88 solvers too.

To show the problem, I've created a very simple box cantilever using Part, and used SolverCalculix to solve for a cantilever end load. Essentially, it's the same as the "new solver example analysis" on the FreeCAD Start Page, but it's even simpler because it only uses SolverCalculix.

I've run Netgen with a finer mesh, so that SolverCalculix takes longer to run and I have time to see what is going on on the screen.

When I come to run SolverCalculix under Solver Control I first select 'Write' and see 'Write Completed'
When I select 'Run' SolverCalculix starts (black winow on screen with SolverCalculix at the top).
After about 40 seconds Solver Control says 'Job Completed'. The seconds clock stops and the Mesh Object reappears.

Great!!!

But then after another 5 seconds, the clock starts to increment again........41, 42, 43...!
After about 5 seconds, FreeCAD crashes/closes.

In Task Manager, I can see that FreeCAD is still resident in memory, but as a process only, not as an application.

I've done everything I can think of to try to get rid of this problem. Any ideas anyone? Is anyone else seeing this too?

Attached are:

Report View Log
Python Console Log
FreeCAD log
Freecad part file

The Freecad log shows that things are going wrong at the end.....something to do with wrong threads:


Msg: imported mesh: 0 HEXA20, 0 TRIA3, 0 TRIA6, 0 QUAD4, 0 QUAD8, 0 SEG2, 0 SEG3Msg:
Log: QPixmap: It is not safe to use pixmaps outside the GUI thread.......

Log: 0.156000: Finish =========================================================
Log: QObject: Cannot create children for a parent that is in a different thread.
(Parent is QTextDocument(0x1f40c168870), parent's thread is QThread(0x1f407517eb0), current thread is QThread(0x1f4671d8820)


The only other issue I can see is that Calculix Steel seems to be seen as a 'NonMsg' material. But if I inspect the FEM data using Edit, the material properties are correct for Steel. And if I re-run the whole thing using Concrete Generic (!!!!!!) as a material, Freecad still crashes.

I'm running Windows 10 on a Dell Inspiron 3650 i7 64-bit about 18 months old.
I've also tried Safe Mode, and still get the same problem. Same problem too using GMSH mesh.
Tried lots of other things too!

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13050 (Git)
Build type: Release
Branch: master
Hash: 305a567819522a336bd16a6c694772be2f56af47
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedKingdom (en_GB)

I will say that I have also tried this by loading Freecad onto my son's Window's 10 machine.
It ran straight away, without any problems.

David
Attachments
SolverCalculix Box Cantilever.FCStd
saved with coarse mesh to reduce file size!
(11.12 KiB) Downloaded 21 times
FreeCAD.log
(18.59 KiB) Downloaded 26 times
Python Console.txt
(4.18 KiB) Downloaded 20 times
Report View.txt
(764 Bytes) Downloaded 28 times
fandaL
Posts: 344
Joined: Thu Jul 24, 2014 8:29 am

Re: FreeCAD crashes after SolverCalculix job completed

Postby fandaL » Sun Jan 21, 2018 12:50 pm

Your file works well on my computer.
You can check working directory for files produced by CalculiX. Uploading them on the forum (especially frd file) might help with searching.

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13050 (Git)
Build type: Release
Branch: master
Hash: 305a567819522a336bd16a6c694772be2f56af47
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: Czech/CzechRepublic (cs_CZ)
UR_
Posts: 1016
Joined: Tue Jan 03, 2017 8:42 pm

Re: FreeCAD crashes after SolverCalculix job completed

Postby UR_ » Sun Jan 21, 2018 2:17 pm

same crash here too

tested with:
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13005 (Git)
Build type: Release
Branch: master
Hash: 29533320fc514029f3ce1af6bbf53cc03fb93049
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)



backtrace:
backtrace.txt
(19.27 KiB) Downloaded 24 times
FreeCAD97990
Posts: 23
Joined: Sat Jul 01, 2017 12:11 pm

Re: FreeCAD crashes after SolverCalculix job completed

Postby FreeCAD97990 » Sun Jan 21, 2018 4:21 pm

Hi fandaL,
When I select 'Write' under SolverControl, four .inp files are written into the working directory (directory name is assigned by FreeCAD)
When I select 'Run' under Solver Control, I see 'Job Completed' and then 5 seconds or so later FreeCAD crashes.

When I next look for the working directory, it has disappeared - I expect it is deleted by FreeCAD when the Job is completed.

It looks like FreeCAD also creates a lock file, for example FreeCAD_7556.lock in the Temp file, but this is not deleted.

I've just re-run the FreeCAD again, and attach the four .inp files that are written into the working directory. This is just before going on to run.
I have renamed all of these files as .txt so that they are accepted as attachments. To reduce the sizes of the files, they all relate to a coarse mesh.

Regards,
David
Attachments
FEMMeshNetgen_Node_sets.txt
(252 Bytes) Downloaded 24 times
FEMMeshNetgen_Node_Force.txt
(448 Bytes) Downloaded 18 times
FEMMeshNetgen_Node_Elem_sets.txt
(6.2 KiB) Downloaded 21 times
FEMMeshNetgen.txt
(2.96 KiB) Downloaded 22 times
wmayer
Site Admin
Posts: 14999
Joined: Thu Feb 19, 2009 10:32 am

Re: FreeCAD crashes after SolverCalculix job completed

Postby wmayer » Sun Jan 21, 2018 4:56 pm

Hi,

the relevant part of the FreeCAD.log is this:
Log: QPixmap: It is not safe to use pixmaps outside the GUI thread
Log: QObject::startTimer: timers cannot be started from another thread
Log: QPixmap: It is not safe to use pixmaps outside the GUI thread
Log: QObject::startTimer: timers cannot be started from another thread
Log: QPixmap: It is not safe to use pixmaps outside the GUI thread
Log: QPixmap: It is not safe to use pixmaps outside the GUI thread
Log: QPixmap: It is not safe to use pixmaps outside the GUI thread
Log: QPixmap: It is not safe to use pixmaps outside the GUI thread
Log: QPixmap: It is not safe to use pixmaps outside the GUI thread
Log: QObject: Cannot create children for a parent that is in a different thread.
(Parent is QTextDocument(0x1f40c168870), parent's thread is QThread(0x1f407517eb0), current thread is QThread(0x1f4671d8820)
It as an absolute no-go to create, destroy or change any widgets in other threads than the main thread. See also: http://doc.qt.io/archives/qt-4.8/thread-basics.html
User avatar
bernd
Posts: 8486
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FreeCAD crashes after SolverCalculix job completed

Postby bernd » Sun Jan 21, 2018 8:24 pm

@_UR and FreeCAD97990:

does it mean it only crashes when you use the TaksPanel for the solver frame work solver? It does not crash when the Menue Solve --> run solver calculations is used?

The problems werner described seams inside https://github.com/FreeCAD/FreeCAD/blob ... Control.py This was developed during the GSoC project. I did not do any changes on this module, which means I do not yet have an idea how to change this module. I did sent a message to Markus, the student of GSoC project. He may help us in this regard.

Bernd
fandaL
Posts: 344
Joined: Thu Jul 24, 2014 8:29 am

Re: FreeCAD crashes after SolverCalculix job completed

Postby fandaL » Sun Jan 21, 2018 8:26 pm

FreeCAD97990 wrote:
Sun Jan 21, 2018 4:21 pm
Hi fandaL,
When I select 'Write' under SolverControl, four .inp files are written into the working directory (directory name is assigned by FreeCAD)
When I select 'Run' under Solver Control, I see 'Job Completed' and then 5 seconds or so later FreeCAD crashes.

When I next look for the working directory, it has disappeared - I expect it is deleted by FreeCAD when the Job is completed.

It looks like FreeCAD also creates a lock file, for example FreeCAD_7556.lock in the Temp file, but this is not deleted.

I've just re-run the FreeCAD again, and attach the four .inp files that are written into the working directory. This is just before going on to run.
I have renamed all of these files as .txt so that they are accepted as attachments. To reduce the sizes of the files, they all relate to a coarse mesh.

Regards,
David
From FreeCAD I get same input files as you (does not counting opposite force direction).
For completeness here is my resulting frd file (zipped). When I drag and drop it into FreeCAD I can see results
FEMMeshNetgen.zip
(15.39 KiB) Downloaded 14 times
UR_
Posts: 1016
Joined: Tue Jan 03, 2017 8:42 pm

Re: FreeCAD crashes after SolverCalculix job completed

Postby UR_ » Sun Jan 21, 2018 8:44 pm

bernd wrote:
Sun Jan 21, 2018 8:24 pm
It does not crash when the Menue Solve --> run solver calculations is used?
Sorry bernd,
crashes in both cases: task panel and starting from menu
FreeCAD97990
Posts: 23
Joined: Sat Jul 01, 2017 12:11 pm

Re: FreeCAD crashes after SolverCalculix job completed

Postby FreeCAD97990 » Sun Jan 21, 2018 11:12 pm

Thanks to everyone who has replied to my post.

I didn't really understand what you were trying to tell me in your reply, wmayer, but it sounded as though I was doing something very wery wrong.

So I got to thinking:

Well, I have downloaded a 'clean' version of FreeCAD several times, but the problem still persists. How can I make it 'cleaner' still?
So I reset the preferences several times. Then I changed back any customisations that I had applied. The deleted all FreeCAD development builds. And finally downloaded, unzipped and reinstalled FreeCAD 0.17.13050.

And it's now working with SolverCalculix!!!

I am of course very happy about this. But I still don't know what was wrong with the settings I had before. I have changed my settings, so far as I can tell, back to what they were before, and SolverCalculix is still working. Now I'm going to reinstall Elmer and see if that works too.

To answer your question, bernd, yes it did crash both from the task panel and starting from menu.

Anyway, thanks again for your help, and UR_, I hope this post might help fix your problem too.

Regards,

David
User avatar
bernd
Posts: 8486
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FreeCAD crashes after SolverCalculix job completed

Postby bernd » Mon Jan 22, 2018 5:23 am

FreeCAD97990 wrote:
Sun Jan 21, 2018 11:12 pm
I didn't really understand what you were trying to tell me in your reply, wmayer, but it sounded as though I was doing something very wery wrong.
Not you, one of the developers of this solver frame work did something very wrong.