Sorry for the work but maybe it was worth it. When looking at the callstack I found this sectionOh 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.
and this could be the start point for the infinite loop.#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.