Crash modelbuilder when removing views
This is to document a very strange problem that first appeared 03-Feb-2022 on a "rebase-remote-viz" branch in development. For some projects, modelbuilder crashes when closing the project. The crash occurs deep in paraview where some timer is triggering the properties view. (The properties view does not have to be open for this.)
This code snippet is from pqACE3PCloseBehavior.cxx
. The #if'd out code crashes in the layout->RemoveView()
call.
// Destroy all the views and collapse the layout
QList<pqView*> viewList = smModel->findItems<pqView*>(server);
foreach(pqView* view, viewList)
{
#if 0
// This code triggers a crash in ParaView for *some* projects.
vtkSMViewProxy* viewProxy = view->getViewProxy();
int location = layout->RemoveView(viewProxy);
//layout->Collapse(location);
builder->destroy(view);
#else
// Simply destroying the view seems to be OK, however, a
// layout Reset() is required (after the loop completes)
// to collapse any split/multiple locations.
builder->destroy(view);
#endif
}
The failure mode is repeatable, but only for some projects. There's no indication why that is.
A project directory is attached that triggers the crash on john's t4 machine. Window.tgz Before using, you will need to manually edit each .smtk file to change the filesystem paths. (Resources are not portable, sadly.)
Stack trace
Loguru caught a signal: SIGSEGV Stack trace: 65 0x55746dcbe9ee ./bin/modelbuilder(+0x169ee) [0x55746dcbe9ee] 64 0x7f74876530b3 __libc_start_main + 243 63 0x55746dccf0ed ./bin/modelbuilder(+0x270ed) [0x55746dccf0ed] 62 0x7f74928aed30 QCoreApplication::exec() + 128 61 0x7f74928a62ea QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) + 234 60 0x7f74928fee3f QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) + 95 59 0x7f7482ebf4a3 g_main_context_iteration + 51 58 0x7f7482ebf400 /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x52400) [0x7f7482ebf400] 57 0x7f7482ebf17d g_main_context_dispatch + 637 56 0x7f7473b42cba /home/john/projects/qt/qt.io/5.12.4/gcc_64/lib/libQt5XcbQpa.so.5(+0x6bcba) [0x7f7473b42cba] 55 0x7f7492f0276b QWindowSystemInterface::sendWindowSystemEvents(QFlagsQEventLoop::ProcessEventsFlag) + 203 54 0x7f7492f25125 QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) + 261 53 0x7f7492f23b73 QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 1587 52 0x7f74928a7a28 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 264 51 0x7f7493782aa0 QApplication::notify(QObject*, QEvent*) + 688 50 0x7f749377b9ac QApplicationPrivate::notify_helper(QObject*, QEvent*) + 156 49 0x7f74937d5dbb /home/john/projects/qt/qt.io/5.12.4/gcc_64/lib/libQt5Widgets.so.5(+0x1badbb) [0x7f74937d5dbb] 48 0x7f74937d3620 /home/john/projects/qt/qt.io/5.12.4/gcc_64/lib/libQt5Widgets.so.5(+0x1b8620) [0x7f74937d3620] 47 0x7f7493781fba QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer&, bool, bool) + 506 46 0x7f74928a7a28 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 264 45 0x7f749378307f QApplication::notify(QObject*, QEvent*) + 2191 44 0x7f749377b9ac QApplicationPrivate::notify_helper(QObject*, QEvent*) + 156 43 0x7f74938eb8cb QMenu::event(QEvent*) + 139 42 0x7f74937b9790 QWidget::event(QEvent*) + 496 41 0x7f74938e9380 QMenu::mouseReleaseEvent(QMouseEvent*) + 432 40 0x7f74938e8476 /home/john/projects/qt/qt.io/5.12.4/gcc_64/lib/libQt5Widgets.so.5(+0x2cd476) [0x7f74938e8476] 39 0x7f74938e135a /home/john/projects/qt/qt.io/5.12.4/gcc_64/lib/libQt5Widgets.so.5(+0x2c635a) [0x7f74938e135a] 38 0x7f7493777df0 QAction::activate(QAction::ActionEvent) + 272 37 0x7f74937759d2 QAction::triggered(bool) + 50 36 0x7f74928d34e9 QMetaObject::activate(QObject*, int, int, void**) + 1625 35 0x7f74950f9b39 /home/john/projects/slac/build/dev-superbuild/install/lib/libpqApplicationComponents-pv5.9.so.1(+0x118b39) [0x7f74950f9b39] 34 0x7f7462b92d5e pqACE3PCloseReaction::onTriggered() + 34 33 0x7f7462b9374b pqACE3PCloseBehavior::closeProject() + 2147 32 0x7f74921736d4 vtkSMViewLayoutProxy::RemoveView(vtkSMViewProxy*) + 362 31 0x7f7492171719 vtkSMViewLayoutProxy::UpdateState() + 979 30 0x7f7491ef9f46 /home/john/projects/slac/build/dev-superbuild/install/lib/libvtkPVServerManagerKit-pv5.9.so.1(+0x421f46) [0x7f7491ef9f46] 29 0x7f7488c519c9 vtkObject::InvokeEvent(unsigned long, void*) + 65 28 0x7f7488c51471 /home/john/projects/slac/build/dev-superbuild/install/lib/libvtkCommon-pv5.9.so.1(+0xf1c471) [0x7f7488c51471] 27 0x7f7488c52797 /home/john/projects/slac/build/dev-superbuild/install/lib/libvtkCommon-pv5.9.so.1(+0xf1d797) [0x7f7488c52797] 26 0x7f7494d23ea0 vtkObject::vtkClassMemberCallback::operator()(vtkObject*, unsigned long, void*) + 160 25 0x7f7494d18cd2 pqMultiViewWidget::reload() + 1558 24 0x7f7494708928 pqEventDispatcher::processEvents(QFlagsQEventLoop::ProcessEventsFlag) + 48 23 0x7f74928fee3f QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) + 95 22 0x7f7482ebf4a3 g_main_context_iteration + 51 21 0x7f7482ebf400 /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x52400) [0x7f7482ebf400] 20 0x7f7482ebf17d g_main_context_dispatch + 637 19 0x7f74928fead1 /home/john/projects/qt/qt.io/5.12.4/gcc_64/lib/libQt5Core.so.5(+0x2caad1) [0x7f74928fead1] 18 0x7f74928fe2f9 QTimerInfoList::activateTimers() + 1129 17 0x7f74928a7a28 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 264 16 0x7f7493782aa0 QApplication::notify(QObject*, QEvent*) + 688 15 0x7f749377b9ac QApplicationPrivate::notify_helper(QObject*, QEvent*) + 156 14 0x7f74928d43fb QObject::event(QEvent*) + 123 13 0x7f7494728159 pqTimer::timerEvent(QTimerEvent*) + 39 12 0x7f74928e0478 QTimer::timerEvent(QTimerEvent*) + 40 11 0x7f74928e01a7 QTimer::timeout(QTimer::QPrivateSignal) + 39 10 0x7f74928d34e9 QMetaObject::activate(QObject*, int, int, void**) + 1625 9 0x7f7494be0bd8 /home/john/projects/slac/build/dev-superbuild/install/lib/libpqComponents-pv5.9.so.1(+0x15fbd8) [0x7f7494be0bd8] 8 0x7f7494d52279 pqPropertiesPanel::apply() + 731 7 0x7f7494be12d5 pqPropertiesPanel::applied() + 45 6 0x7f74928d34e9 QMetaObject::activate(QObject*, int, int, void**) + 1625 5 0x7f74950eae5f /home/john/projects/slac/build/dev-superbuild/install/lib/libpqApplicationComponents-pv5.9.so.1(+0x109e5f) [0x7f74950eae5f] 4 0x7f749511ca7b pqApplyBehavior::onApplied() + 77 3 0x7f749511d3f9 pqApplyBehavior::applied(pqPropertiesPanel*) + 1699 2 0x7f749511e15b QWidget::isVisible() const + 33 1 0x7f749511e17d /home/john/projects/slac/build/dev-superbuild/install/lib/libpqApplicationComponents-pv5.9.so.1(+0x13d17d) [0x7f749511e17d] 0 0x7f7487b813c0 /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0) [0x7f7487b813c0] ( 17.000s) [paraview ] :0 FATL| Signal: SIGSEGV ../scripts/runModelbuilder.sh: line 7: 1625039 Segmentation fault (core dumped) LD_LIBRARY_PATH=/home/john/projects/qt/qt.io/5.12.4/gcc_64/lib:/home/john/projects/slac/build/dev-superbuild/install/lib:/home/john/projects/slac/build/dev-smtk/lib:/home/john/apps/openssl-1.1.1d ./bin/modelbuilder --multi-servers $*