FC crash when closing sketch

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
GeneFC
Posts: 67
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: FC crash when closing sketch

Postby GeneFC » Thu Feb 02, 2017 12:51 am

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
Site Admin
Posts: 11241
Joined: Thu Feb 19, 2009 10:32 am

Re: FC crash when closing sketch

Postby wmayer » Thu Feb 02, 2017 8:59 am

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

Re: FC crash when closing sketch

Postby Kunda1 » Thu Feb 02, 2017 12:24 pm

Linking issue #2741 to this thread since @wmayer thinks there is a connection (thread link).
mlampert
Posts: 288
Joined: Fri Sep 16, 2016 9:28 pm

Re: FC crash when closing sketch

Postby mlampert » Thu Feb 02, 2017 4:21 pm

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
Site Admin
Posts: 11241
Joined: Thu Feb 19, 2009 10:32 am

Re: FC crash when closing sketch

Postby wmayer » Thu Feb 02, 2017 6:26 pm

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
Posts: 288
Joined: Fri Sep 16, 2016 9:28 pm

Re: FC crash when closing sketch

Postby mlampert » Thu Feb 02, 2017 6:46 pm

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 7 times
wmayer
Site Admin
Posts: 11241
Joined: Thu Feb 19, 2009 10:32 am

Re: FC crash when closing sketch

Postby wmayer » Thu Feb 02, 2017 7:59 pm

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

Re: FC crash when closing sketch

Postby mlampert » Thu Feb 02, 2017 9:44 pm

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
Site Admin
Posts: 11241
Joined: Thu Feb 19, 2009 10:32 am

Re: FC crash when closing sketch

Postby wmayer » Fri Feb 03, 2017 9:20 am

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
Posts: 288
Joined: Fri Sep 16, 2016 9:28 pm

Re: FC crash when closing sketch

Postby mlampert » Fri Feb 03, 2017 7:26 pm

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 11 times