FC crash when closing sketch

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
wmayer
Site Admin
Posts: 11241
Joined: Thu Feb 19, 2009 10:32 am

Re: FC crash when closing sketch

Postby wmayer » Sat Feb 04, 2017 10:15 am

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.

Sorry for the work but maybe it was worth it. When looking at the callstack I found this section
#36913 0x00007ffff748d7f0 in Gui::TaskView::TaskView::addTaskWatcher (this=0x555555bf38b0)
at /home/markus/projects/FreeCAD/github/dev/FreeCAD/src/Gui/TaskView/TaskView.cpp:666
#36914 0x00007ffff748d6ab in Gui::TaskView::TaskView::addTaskWatcher (this=0x555555bf38b0,
Watcher=std::vector of length 13, capacity 16 = {...})
at /home/markus/projects/FreeCAD/github/dev/FreeCAD/src/Gui/TaskView/TaskView.cpp:648
#36915 0x00007ffff75c9435 in Gui::Workbench::addTaskWatcher (this=0x55555758a670,
Watcher=std::vector of length 13, capacity 16 = {...})
at /home/markus/projects/FreeCAD/github/dev/FreeCAD/src/Gui/Workbench.cpp:393

and this could be the start point for the infinite loop.

So, now when reverting the changes you made and now commenting out the code of TaskView::addTaskWatcher(void) does this solve the crashes? Test both scenarios for which you got the crashes, please.
mlampert
Posts: 288
Joined: Fri Sep 16, 2016 9:28 pm

Re: FC crash when closing sketch

Postby mlampert » Sat Feb 04, 2017 9:48 pm

wmayer wrote:Sorry for the work but maybe it was worth it.
No worries at all, this is why I posted in the first place.

#36913 0x00007ffff748d7f0 in Gui::TaskView::TaskView::addTaskWatcher (this=0x555555bf38b0)
at /home/markus/projects/FreeCAD/github/dev/FreeCAD/src/Gui/TaskView/TaskView.cpp:666
#36914 0x00007ffff748d6ab in Gui::TaskView::TaskView::addTaskWatcher (this=0x555555bf38b0,
Watcher=std::vector of length 13, capacity 16 = {...})
at /home/markus/projects/FreeCAD/github/dev/FreeCAD/src/Gui/TaskView/TaskView.cpp:648
#36915 0x00007ffff75c9435 in Gui::Workbench::addTaskWatcher (this=0x55555758a670,
Watcher=std::vector of length 13, capacity 16 = {...})
at /home/markus/projects/FreeCAD/github/dev/FreeCAD/src/Gui/Workbench.cpp:393

So, now when reverting the changes you made and now commenting out the code of TaskView::addTaskWatcher(void) does this solve the crashes? Test both scenarios for which you got the crashes, please.

If I comment out the call to TaskView::addWatcher in TaskView.cpp+648, the segfault goes away regardless of body activation. However, when I activate the body it switches to task view and previously showed 2 panels
taskpanel.png
taskpanel.png (49.27 KiB) Viewed 267 times
- it still switches over but the panels aren't shown anymore.

I wasn't sure if you meant commenting out the code inside addTaskWatcher(void), so I enclosed the body in an #if 0 (reverting above change beforehand). It has the same behaviour, no more segfault regardless of body activation and/or manually switching back to the PD WB - and for completeness sake the two panels don't show up neither when the body is activated.
wmayer
Site Admin
Posts: 11241
Joined: Thu Feb 19, 2009 10:32 am

Re: FC crash when closing sketch

Postby wmayer » Sat Feb 04, 2017 10:54 pm

OK, so it looks like the creation/deletion of the items in the task panel is causing the crashes.
wmayer
Site Admin
Posts: 11241
Joined: Thu Feb 19, 2009 10:32 am

Re: FC crash when closing sketch

Postby wmayer » Sun Feb 19, 2017 10:41 am

@mlampert Next attempt: can you just comment out the line 666

Code: Select all

(*it2)->show();

in TaskView.cpp? I have tested it here and the line seems to be superfluous and is the entry point of the stack overflow in your case.
mlampert
Posts: 288
Joined: Fri Sep 16, 2016 9:28 pm

Re: FC crash when closing sketch

Postby mlampert » Sun Feb 26, 2017 1:46 am

It seems the magic is gone. I was away for 2 weeks, updated the branch and can no longer reproduce the issue. For what it's worth, I did disable said show() statement and I didn't find a difference in behaviour - it indeed seems redundant.