FC crash when closing sketch

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: FC crash when closing sketch

Post by GeneFC »

I should have mentioned earlier; I never got a crash under any circumstances.

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9841 (Git)
Build type: Release
Branch: master
Hash: fa4b5d29b52b576335897d8b3436f8a847191b2e
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0


Gene
wmayer
Founder
Posts: 20317
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FC crash when closing sketch

Post by wmayer »

Does gdb give further hints about what kind of crash it is?
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FC crash when closing sketch

Post by Kunda1 »

Linking issue #2741 to this thread since @wmayer thinks there is a connection (thread link).
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
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: FC crash when closing sketch

Post by mlampert »

wmayer wrote:Does gdb give further hints about what kind of crash it is?
Unfortunately not. The trace is endless and doesn't seem to change, it's the same loop of invocations over and over again.
wmayer
Founder
Posts: 20317
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FC crash when closing sketch

Post by wmayer »

When running FreeCAD with --write-log it creates the file FreeCAD.log in $HOME/.FreeCAD. Can you have a look inside it if there are further relevant information?

And when closing the sketch panel programmatically does it still crash?

Code: Select all

Gui.ActiveDocument.resetEdit()
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: FC crash when closing sketch

Post by mlampert »

wmayer wrote:When running FreeCAD with --write-log it creates the file FreeCAD.log in $HOME/.FreeCAD. Can you have a look inside it if there are further relevant information?
Not sure what I'm looking for, attached.
And when closing the sketch panel programmatically does it still crash?

Code: Select all

Gui.ActiveDocument.resetEdit()
No it doesn't crash - interesting. In case that makes a difference, in the attached log are both, programmatic close first and then pressing the Close button.
Attachments
FreeCAD.log
(15.43 KiB) Downloaded 69 times
wmayer
Founder
Posts: 20317
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FC crash when closing sketch

Post by wmayer »

Another attempt: when you are sketcher edit mode then first switch manually back to Part Design and then press Close. What happens?
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: FC crash when closing sketch

Post by mlampert »

wmayer wrote:Another attempt: when you are sketcher edit mode then first switch manually back to Part Design and then press Close. What happens?
I don't know what you are drinking - but I want some of that stuff. The moment I select the Part Design WB I get the segfault.
I tried with other WBs and they seem fine. I checked the stack trace, it's identical to the one I posted above.
wmayer
Founder
Posts: 20317
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FC crash when closing sketch

Post by wmayer »

The moment I select the Part Design WB I get the segfault.
That's what I have not expected. I thought this maybe even avoids the crash since I guessed that directly performing the workbench switch in Command::assureWorkbench is causing problems and that it would be better to delay it by using a signal/slot connection.
And does this also only happen when the Body feature is active?

OK, then let's have a closer look to see if we are on the right track. When you comment out the line

Code: Select all

Gui::Command::assureWorkbench(oldWb.c_str());
in ViewProviderSketch::unsetEdit does it solve the crash when you then press the Close button?
I checked the stack trace, it's identical to the one I posted above.
That would have been my next question. Now can you figure out what is the stack trace before it starts this infinite loop? You have to go down to the beginning.
I tried with other WBs and they seem fine.
That's really weird. So it must be something PartDesign specific. I hope that the above stack trace information will shed some light on it.
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: FC crash when closing sketch

Post by mlampert »

wmayer wrote:
The moment I select the Part Design WB I get the segfault.
That's what I have not expected. I thought this maybe even avoids the crash since I guessed that directly performing the workbench switch in Command::assureWorkbench is causing problems and that it would be better to delay it by using a signal/slot connection.
And does this also only happen when the Body feature is active?
No, FC crashes regardless of the Body's activity state.
When you comment out the line

Code: Select all

Gui::Command::assureWorkbench(oldWb.c_str());
in ViewProviderSketch::unsetEdit does it solve the crash when you then press the Close button?
Yes it does, no more crashing on close regardless of Body's activity state.
Now can you figure out what is the stack trace before it starts this infinite loop? You have to go down to the beginning.
Oh boy, this is gonna take a while - curses on these machines and their ram sizes .... as it turns out you can specify a negative number for gdb's bt command, neat. Last 1000 frames attached.
Attachments
zero.bt-1000.txt
(129.23 KiB) Downloaded 65 times
Post Reply