pqPython crashes with Python 3.13 because of python highlighter
I have backported vtk/vtk!11486 (merged) and vtk/vtk!11494 (merged) to the VTK source tree bundled with Paraview 5.13.2 (as mentioned in #22846 (closed)), built Paraview with Python 3.13 (on Arch Linux), but Paraview still segfaults.
To reproduce the crash:
- open Paraview window
- click on Tools > Start Trace, confirm the dialog with Ok
- click on Tools > Stop Trace
Backtrace:
Thread 1 "paraview" received signal SIGSEGV, Segmentation fault.
0x00007ffff1da0e85 in PyObject_GetAttrString (v=0x0, name=0x7ffff7ba95a4 "HtmlFormatter") at Objects/object.c:1096
1096 if (Py_TYPE(v)->tp_getattr != NULL)
(gdb) bt
#0 0x00007ffff1da0e85 in PyObject_GetAttrString (v=0x0, name=0x7ffff7ba95a4 "HtmlFormatter") at Objects/object.c:1096
#1 0x00007ffff7b9f025 in pqPythonSyntaxHighlighter::pqPythonSyntaxHighlighter (this=<optimized out>, p=<optimized out>, textEdit=..., this=<optimized out>, p=<optimized out>, textEdit=...)
at /usr/src/debug/paraview/ParaView-v5.13.2/Qt/Python/pqPythonSyntaxHighlighter.cxx:59
#2 0x00007ffff7ba3b14 in pqPythonTextArea::pqPythonTextArea (this=<optimized out>, parent=<optimized out>, this=<optimized out>, parent=<optimized out>) at /usr/src/debug/paraview/ParaView-v5.13.2/Qt/Python/pqPythonTextArea.cxx:18
#3 0x00007ffff7ba44cf in pqPythonTabWidget::createNewEmptyTab (this=0x55555b8052f0) at /usr/src/debug/paraview/ParaView-v5.13.2/Qt/Python/pqPythonTabWidget.cxx:245
#4 0x00007ffff7ba482a in pqPythonTabWidget::pqPythonTabWidget (this=<optimized out>, parent=<optimized out>, this=<optimized out>, parent=<optimized out>) at /usr/src/debug/paraview/ParaView-v5.13.2/Qt/Python/pqPythonTabWidget.cxx:27
#5 0x00007ffff7ba493d in pqPythonScriptEditor::pqPythonScriptEditor (this=<optimized out>, p=<optimized out>, this=<optimized out>, p=<optimized out>) at /usr/src/debug/paraview/ParaView-v5.13.2/Qt/Python/pqPythonScriptEditor.cxx:44
#6 0x00007ffff7ba59d7 in pqPythonScriptEditor::getUniqueInstance () at /usr/src/debug/paraview/ParaView-v5.13.2/Qt/Python/pqPythonScriptEditor.cxx:248
#7 0x00007ffff7e7ca2d in pqTraceReaction::editTrace (this=this@entry=0x555555e41260, trace=..., incremental=incremental@entry=false) at /usr/src/debug/paraview/ParaView-v5.13.2/Qt/ApplicationComponents/pqTraceReaction.cxx:143
#8 0x00007ffff7e7cba6 in pqTraceReaction::stop (this=this@entry=0x555555e41260) at /usr/src/debug/paraview/ParaView-v5.13.2/Qt/ApplicationComponents/pqTraceReaction.cxx:130
#9 0x00007ffff7e7db02 in pqTraceReaction::onTriggered (this=0x555555e41260) at /usr/src/debug/paraview/ParaView-v5.13.2/Qt/ApplicationComponents/pqTraceReaction.cxx:74
#10 0x00007ffff24e3562 in doActivate<false> (sender=0x555555e40f70, signal_index=4, argv=0x7fffffffb9b0) at kernel/qobject.cpp:3937
#11 0x00007ffff7549305 in QAction::triggered (this=this@entry=0x555555e40f70, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#12 0x00007ffff754f030 in QAction::activate (this=0x555555e40f70, event=<optimized out>) at kernel/qaction.cpp:1161
#13 0x00007ffff76e168b in QMenuPrivate::activateCausedStack (this=this@entry=0x555555abd810, causedStack=..., action=action@entry=0x555555e40f70, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1384
#14 0x00007ffff76e17b4 in QMenuPrivate::activateAction (this=0x555555abd810, action=0x555555e40f70, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:1461
#15 0x00007ffff7590046 in QWidget::event (this=0x555555abd7d0, event=0x7fffffffbfe0) at kernel/qwidget.cpp:8671
#16 0x00007ffff7556581 in QApplicationPrivate::notify_helper (this=this@entry=0x5555557aaf90, receiver=receiver@entry=0x555555abd7d0, e=e@entry=0x7fffffffbfe0) at kernel/qapplication.cpp:3640
#17 0x00007ffff755c3e1 in QApplication::notify (this=<optimized out>, receiver=0x555555abd7d0, e=0x7fffffffbfe0) at kernel/qapplication.cpp:3084
#18 0x00007ffff24aee98 in QCoreApplication::notifyInternal2 (receiver=0x555555abd7d0, event=0x7fffffffbfe0) at kernel/qcoreapplication.cpp:1064
#19 0x00007ffff24aef23 in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474
#20 0x00007ffff755a0f5 in QApplicationPrivate::sendMouseEvent (receiver=0x555555abd7d0, event=0x7fffffffbfe0, alienWidget=<optimized out>, nativeWidget=0x555555abd7d0, buttonDown=<optimized out>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false)
at kernel/qapplication.cpp:2622
#21 0x00007ffff75aa055 in QWidgetWindow::handleMouseEvent (this=this@entry=0x5555573a1460, event=event@entry=0x7fffffffc360) at kernel/qwidgetwindow.cpp:580
#22 0x00007ffff75ab817 in QWidgetWindow::event (this=0x5555573a1460, event=0x7fffffffc360) at kernel/qwidgetwindow.cpp:300
#23 0x00007ffff7556581 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5555573a1460, e=0x7fffffffc360) at kernel/qapplication.cpp:3640
#24 0x00007ffff24aee98 in QCoreApplication::notifyInternal2 (receiver=0x5555573a1460, event=0x7fffffffc360) at kernel/qcoreapplication.cpp:1064
#25 0x00007ffff24aef23 in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474
#26 0x00007ffff653c260 in QGuiApplicationPrivate::processMouseEvent (e=0x55555aee6670) at kernel/qguiapplication.cpp:2285
#27 0x00007ffff651d2cd in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1169
#28 0x00007fffbfb2aad8 in xcbSourceDispatch (source=<optimized out>) at /usr/src/debug/qt5-base/kde-qtbase/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:105
#29 0x00007fffeb832559 in g_main_dispatch (context=0x7fffb8000ed0) at ../glib/glib/gmain.c:3357
#30 0x00007fffeb895257 in g_main_context_dispatch_unlocked (context=0x7fffb8000ed0) at ../glib/glib/gmain.c:4208
#31 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7fffb8000ed0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4273
#32 0x00007fffeb831a55 in g_main_context_iteration (context=0x7fffb8000ed0, may_block=1) at ../glib/glib/gmain.c:4338
#33 0x00007ffff24fe16f in QEventDispatcherGlib::processEvents (this=0x555555869dd0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#34 0x00007ffff24a6b5c in QEventLoop::exec (this=0x7fffffffc720, flags=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#35 0x00007ffff24b305d in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#36 0x00007ffff652f7ff in QGuiApplication::exec () at kernel/qguiapplication.cpp:1870
#37 0x00007ffff7554a2a in QApplication::exec () at kernel/qapplication.cpp:2832
#38 0x000055555555ea74 in main (argc=<optimized out>, argv=0x5555557aaf60) at /usr/src/debug/paraview/build/Clients/ParaView/paraview_main.cxx:134