Skip to content

ParallelCoordinates: Fix segfault

Julien Schueller requested to merge jschueller/vtk:parconeg into master

I load the boston housing price dataset in paraview, then convert the spreadsheetview to parallelcoordinatesview

https://raw.githubusercontent.com/selva86/datasets/master/BostonHousing.csv

if I play with the parallelcoordinates view with short double clicks on the different columns,

sometimes the column index CurrentAxis gets set to -1 and this array access triggers an assertion/segfault

I dont know if its the right fix though

kubuntu 22.04 / qt 5.15.3, CMAKE_CXX_FLAGS="-D_GLIBCXX_ASSERTIONS"

cc @spiros.tsalikis @lucas.givord

here is the original trace:

CurrentAxis=-1
size=14
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_vector.h:1123: std::vector::reference std::vector<vtkAxis *>::operator[](std::vector::size_type) [_Tp = vtkAxis *, _Alloc = std::allocator<vtkAxis *>]: Assertion '__n < this->size()' failed.

Thread 1 "paraview" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737116220416) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737116220416) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737116220416) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737116220416, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff2644476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff262a7f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff2a0b3ef in std::__glibcxx_assert_fail(char const*, int, char const*, char const*) () from /lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff0edd4de in vtkChartParallelCoordinates::MouseMoveEvent (this=0x7fffe400bb60, mouse=...) at /home/schueller/projects/kitware/paraview/VTK/Charts/Core/vtkChartParallelCoordinates.cxx:591
#7  0x00007ffff5976adf in vtkContextScene::ProcessItem (this=<optimized out>, cur=0x7fffe400bb60, event=..., eventPtr=&virtual table offset 280)
    at /home/schueller/projects/kitware/paraview/VTK/Rendering/Context2D/vtkContextScene.cxx:665
#8  vtkContextScene::MouseMoveEvent (this=<optimized out>, e=...) at /home/schueller/projects/kitware/paraview/VTK/Rendering/Context2D/vtkContextScene.cxx:501
#9  0x00007ffff0e3dc63 in vtkContextInteractorStyle::OnMouseMove (this=0x555558694050) at /home/schueller/projects/kitware/paraview/VTK/Views/Context2D/vtkContextInteractorStyle.cxx:189
#10 0x00007ffff2f1e13c in vtkCallbackCommand::Execute (this=0x5555588650f0, caller=0x5fd0b, event=392459, callData=0x7ffff2698a7c <__GI___pthread_kill+300>)
    at /home/schueller/projects/kitware/paraview/VTK/Common/Core/vtkCallbackCommand.cxx:42
#11 0x00007ffff30711d0 in vtkSubjectHelper::InvokeEvent (this=0x555558785850, event=6, callData=0x7ffff2698a7c <__GI___pthread_kill+300>, self=0x5fd0b)
    at /home/schueller/projects/kitware/paraview/VTK/Common/Core/vtkObject.cxx:650
#12 0x00007ffff6255028 in QVTKInteractorAdapter::ProcessEvent (this=<optimized out>, e=0x7fffffffd440, iren=0x5555587d6230)
    at /home/schueller/projects/kitware/paraview/VTK/GUISupport/Qt/QVTKInteractorAdapter.cxx:309
#13 0x00007ffff6256a9b in QVTKOpenGLNativeWidget::event (this=0x55555911f8a0, evt=0x7fffffffd440) at /home/schueller/projects/kitware/paraview/VTK/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx:293
#14 0x00007ffff76fa713 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007ffff7702364 in QApplication::notify(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007ffff65ace3a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007ffff7700e47 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007ffff7756d40 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007ffff7759fd5 in ?? () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#20 0x00007ffff76fa713 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007ffff65ace3a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#22 0x00007ffff6993307 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#23 0x00007ffff6968a2c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Gui.so.5
#24 0x00007fffe8e78d6e in ?? () from /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#25 0x00007fffefe60d3b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007fffefeb56c8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007fffefe5e3e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007ffff66060b8 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x00007ffff65ab75b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#30 0x00007ffff65b3cf4 in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x000055555556064e in main (argc=<optimized out>, argv=0x5555557249c0) at /home/schueller/projects/kitware/paraview/build/Clients/ParaView/paraview_main.cxx:151
Edited by Julien Schueller

Merge request reports