Preferences dialog quite often stuck

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
dsaiko
Posts: 17
Joined: Mon Jan 16, 2017 10:54 pm

Preferences dialog quite often stuck

Post by dsaiko »

Hi, first I need to say returning back to the FreeCAD after few years impressed me a lot. Great work and thanks for the software. Will try to contribute and start looking into the code. Already able to build and debug the source code.

Now one of the most annoying issues currently I have is a very slow loading of the Preferences dialog.
It happens in all 0.19 version I have tried, including the local build.

What happens:
1) I start FreeCAD, Start workbench is selected. I can go to Edit -> Preferences, I see "General", "Display", "Import-Export" and "Start" section. Can click on all of them, all works fine.
2) I switch to any other workbench (Part Design for example), then go to Edit -> Preferences. It displays fine mostly. But then, when I click "Part Design" section preferences, the whole dialog is stuck for something like 1 minute or more. Then Part design preferences display.
When I cancel the dialog and go to the preferences again, there is no more delay usually.

Seems there is an issue with loading the preferences from selected workbench plugin?

My desktop has quite high specs, Ryzen 7 3700X, 32 GB RAM. No similar issues with any other application.

Is this something what happens to any more users?
Is there any hint to where I could start looking for the issue?

regards
Let's 3D print a whole new world.
chrisb
Veteran
Posts: 54183
Joined: Tue Mar 17, 2015 9:14 am

Re: Preferences dialog quite often stuck

Post by chrisb »

Please add your full FreeCAD infos. Did you look at the Known OS specific issues?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
wmayer
Founder
Posts: 20303
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Preferences dialog quite often stuck

Post by wmayer »

We once had the problem that opening the preferences dialog was slow because figuring out the supported languages took quite some time (~10s). This was fixed with: git commit 7c4ab45e31e

No idea what is causing the problem you see but as you already made a local build you should try to run it in a debugger. When opening the preferences dialog switch to your IDE and break the debugger. It should jump to the line/block that takes so long and this may give you an idea why this happens.
dsaiko
Posts: 17
Joined: Mon Jan 16, 2017 10:54 pm

Re: Preferences dialog quite often stuck

Post by dsaiko »

Thanks, will try to work on this.

Have already spent several hours, still not sure what is going on. The UI in Preferences is stuck sometimes for more than a minute.

When I press "Break All" in Visual Studio while that happens, I get "Your app has entered a break state, but there is no code to show because all threads were executing external code (typically system or framework code)." Will need to do some more experiments .....
Let's 3D print a whole new world.
wmayer
Founder
Posts: 20303
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Preferences dialog quite often stuck

Post by wmayer »

Do you have a Debug build or a Release build? In order to get more useful hints a debug build is required.

If you then break the debugger switch to the main thread because what's going on in worker threads is not that important.
dsaiko
Posts: 17
Joined: Mon Jan 16, 2017 10:54 pm

Re: Preferences dialog quite often stuck

Post by dsaiko »

Thanks for the reply.

Yes, I am building a Debug version.
I have tried a lot. Removing Pages from DlgPreferences to see if any of them causes the issue, removing pieces of code, profiling, upgrading VS from 2017 to 2019, downloading debug symbols for system libraries ... No change. UI freeze (I could not even move the dialog window) was not probably caused by the dialog itself.
Last thing I did yesterday was installing full QT Opensource so I could try running FreeCAD against different versions of QT5 later.
But ... today the UI freeze occurs no more. I suspect some system library got upgraded as I installed different pieces of software? Who knows.

Long story short, thank you for your time, it works for me now.
If it ever comes back, I will notice for sure.

But it was definitelly a good lesson.

Now: I am ready to start helping with some small bugfixing to learn more.

Should I just pick up something from tracker?
Let's 3D print a whole new world.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Preferences dialog quite often stuck

Post by Kunda1 »

@dsaiko Bravo for your perseverance as you wade in to what we call 'Dependency Hell'. It's a little frustrating that it 'magically' disappeared without knowing what the exact issue was BUT that it works!
Look forward to seeing your contributions and participation in the community. :D
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply