Repository navigation
Closed
Labels
Description
I'm seeing a reproducible segmentation fault with the PySide backend. This was produced by running the tests under haas, with the qobject-tracking plugin from haas-plugins. I haven't yet managed to reduce this to a single test or small number of tests.
Versions: Python 2.7.12, PySide 1.2.2-14, PyFace master. (OS X 10.9.5)
Here's the tail of the test run:
.test_resize (pyface.tests.test_window.TestWindow) changed QObject counts. added: {'QMainWindow': 1}.
.test_retitle (pyface.tests.test_window.TestWindow) changed QObject counts. added: {'QMainWindow': 1}.
.test_show (pyface.tests.test_window.TestWindow) changed QObject counts. added: {'QMainWindow': 1}.
.test_size (pyface.tests.test_window.TestWindow) changed QObject counts. added: {'QMainWindow': 1}.
.test_title (pyface.tests.test_window.TestWindow) changed QObject counts. added: {'QMainWindow': 1}.
.test_warning_accept (pyface.tests.test_window.TestWindow) changed QObject counts. added: {'QTimer': 1}.removed: {'QMainWindow': 8}.
.test_warning_ok (pyface.tests.test_window.TestWindow) changed QObject counts. added: {'QMessageBox': 1, 'QTimer': 1}.
EE.test_active_editor_after_focus_change (pyface.ui.qt4.tasks.tests.test_split_editor_area_pane.TestEditorAreaWidget) changed QObject counts. added: {'QMainWindow': 1, 'QStackedWidget': 1}.
.test_active_tabwidget_after_editor_containing_tabs_gets_focus (pyface.ui.qt4.tasks.tests.test_split_editor_area_pane.TestEditorAreaWidget) changed QObject counts. added: {'QMainWindow': 1, 'QStackedWidget': 1}.
...Fatal Python error: Segmentation fault
The Python traceback (from faulthandler) isn't all that useful: it simply shows that the segmentation fault is occurring during a gc.collect call.
Current thread 0x00007fff7d25c310 (most recent call first):
File "/Users/mdickinson/Enthought/Projects/Canopy_Geoscience/haas-plugins/haas_plugins/qobject_tracking_plugin.py", line 19 in _get_qobject_count
File "/Users/mdickinson/Enthought/Projects/Canopy_Geoscience/haas-plugins/haas_plugins/qobject_tracking_plugin.py", line 63 in stop_test
File "/Users/mdickinson/.edm/envs/pyface-test-2.7-pyside/lib/python2.7/site-packages/haas/result.py", line 444 in stopTest
File "/Users/mdickinson/.edm/envs/pyface-test-2.7-pyside/lib/python2.7/unittest/case.py", line 370 in run
File "/Users/mdickinson/.edm/envs/pyface-test-2.7-pyside/lib/python2.7/unittest/case.py", line 393 in __call__
File "/Users/mdickinson/.edm/envs/pyface-test-2.7-pyside/lib/python2.7/site-packages/haas/suite.py", line 200 in run
File "/Users/mdickinson/.edm/envs/pyface-test-2.7-pyside/lib/python2.7/site-packages/haas/suite.py", line 178 in __call__
File "/Users/mdickinson/.edm/envs/pyface-test-2.7-pyside/lib/python2.7/site-packages/haas/suite.py", line 200 in run
File "/Users/mdickinson/.edm/envs/pyface-test-2.7-pyside/lib/python2.7/site-packages/haas/suite.py", line 178 in __call__
File "/Users/mdickinson/.edm/envs/pyface-test-2.7-pyside/lib/python2.7/site-packages/haas/suite.py", line 200 in run
File "/Users/mdickinson/.edm/envs/pyface-test-2.7-pyside/lib/python2.7/site-packages/haas/suite.py", line 178 in __call__
File "/Users/mdickinson/.edm/envs/pyface-test-2.7-pyside/lib/python2.7/site-packages/haas/plugins/runner.py", line 49 in run
File "/Users/mdickinson/.edm/envs/pyface-test-2.7-pyside/lib/python2.7/site-packages/haas/haas_application.py", line 131 in run
File "/Users/mdickinson/.edm/envs/pyface-test-2.7-pyside/lib/python2.7/site-packages/haas/main.py", line 24 in main
File "/Users/mdickinson/.edm/envs/pyface-test-2.7-pyside/bin/haas", line 10 in <module>
Segmentation fault: 11
Here's the stack trace for the main thread:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff923aa292 __kill + 10
1 libsystem_platform.dylib 0x00007fff971245aa _sigtramp + 26
2 QtGui 0x000000010f5215be QTabBar::removeTab(int) + 46
3 QtGui 0x000000010f529a66 QTabWidget::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 486
4 QtCore 0x000000010c211422 QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 2274
5 QtGui 0x000000010f73c13c QStackedWidget::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 156
6 QtCore 0x000000010c211422 QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 2274
7 QtGui 0x000000010f73296e QStackedLayout::widgetRemoved(int) + 62
8 QtGui 0x000000010f105542 QStackedLayout::takeAt(int) + 162
9 QtGui 0x000000010f0fa7ab removeWidgetRecursively(QLayoutItem*, QWidget*) + 139
10 QtGui 0x000000010f0cae57 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 215
11 QtGui 0x000000010f0cdfbc QApplication::notify(QObject*, QEvent*) + 7372
12 QtGui.so 0x000000010e058b4b QApplicationWrapper::notify(QObject*, QEvent*) + 267
13 QtCore 0x000000010c1f8aba QCoreApplication::notifyInternal(QObject*, QEvent*) + 122
14 QtCore 0x000000010c20c035 QObjectPrivate::setParent_helper(QObject*) + 437
15 QtCore 0x000000010c20bc49 QObject::~QObject() + 1593
16 QtGui 0x000000010f111dcd QWidget::~QWidget() + 1309
17 QtGui.so 0x000000010e167b5c QFrameWrapper::~QFrameWrapper() + 12
18 libshiboken-python2.7.1.2.2.dylib 0x000000010c08108e SbkDeallocWrapperCommon(_object*, bool) + 350
19 org.python.python 0x00000001000f2d67 collect + 2167
20 org.python.python 0x00000001000f382f gc_collect + 111
21 org.python.python 0x00000001000b5efe PyEval_EvalFrameEx + 30574
22 org.python.python 0x00000001000ae482 PyEval_EvalCodeEx + 1538
23 org.python.python 0x00000001000bac05 fast_function + 117
24 org.python.python 0x00000001000b5af4 PyEval_EvalFrameEx + 29540
25 org.python.python 0x00000001000baca2 fast_function + 274
26 org.python.python 0x00000001000b5af4 PyEval_EvalFrameEx + 29540
27 org.python.python 0x00000001000ae482 PyEval_EvalCodeEx + 1538
28 org.python.python 0x00000001000bac05 fast_function + 117
29 org.python.python 0x00000001000b5af4 PyEval_EvalFrameEx + 29540
30 org.python.python 0x00000001000ae482 PyEval_EvalCodeEx + 1538
31 org.python.python 0x000000010003982c function_call + 364
32 org.python.python 0x00000001000138d3 PyObject_Call + 99
33 org.python.python 0x00000001000b6646 PyEval_EvalFrameEx + 32438
34 org.python.python 0x00000001000ae482 PyEval_EvalCodeEx + 1538
35 org.python.python 0x000000010003982c function_call + 364
36 org.python.python 0x00000001000138d3 PyObject_Call + 99
37 org.python.python 0x0000000100020af6 instancemethod_call + 182
38 org.python.python 0x00000001000138d3 PyObject_Call + 99
39 org.python.python 0x000000010006eb95 slot_tp_call + 133
40 org.python.python 0x00000001000138d3 PyObject_Call + 99
41 org.python.python 0x00000001000b6646 PyEval_EvalFrameEx + 32438
42 org.python.python 0x00000001000ae482 PyEval_EvalCodeEx + 1538
43 org.python.python 0x000000010003982c function_call + 364
44 org.python.python 0x00000001000138d3 PyObject_Call + 99
45 org.python.python 0x00000001000b6646 PyEval_EvalFrameEx + 32438
46 org.python.python 0x00000001000ae482 PyEval_EvalCodeEx + 1538
47 org.python.python 0x000000010003982c function_call + 364
48 org.python.python 0x00000001000138d3 PyObject_Call + 99
49 org.python.python 0x0000000100020af6 instancemethod_call + 182
50 org.python.python 0x00000001000138d3 PyObject_Call + 99
51 org.python.python 0x000000010006eb95 slot_tp_call + 133
52 org.python.python 0x00000001000138d3 PyObject_Call + 99
53 org.python.python 0x00000001000b6646 PyEval_EvalFrameEx + 32438
54 org.python.python 0x00000001000ae482 PyEval_EvalCodeEx + 1538
55 org.python.python 0x000000010003982c function_call + 364
56 org.python.python 0x00000001000138d3 PyObject_Call + 99
57 org.python.python 0x00000001000b6646 PyEval_EvalFrameEx + 32438
58 org.python.python 0x00000001000ae482 PyEval_EvalCodeEx + 1538
59 org.python.python 0x000000010003982c function_call + 364
60 org.python.python 0x00000001000138d3 PyObject_Call + 99
61 org.python.python 0x0000000100020af6 instancemethod_call + 182
62 org.python.python 0x00000001000138d3 PyObject_Call + 99
63 org.python.python 0x000000010006eb95 slot_tp_call + 133
64 org.python.python 0x00000001000138d3 PyObject_Call + 99
65 org.python.python 0x00000001000b6646 PyEval_EvalFrameEx + 32438
66 org.python.python 0x00000001000ae482 PyEval_EvalCodeEx + 1538
67 org.python.python 0x000000010003982c function_call + 364
68 org.python.python 0x00000001000138d3 PyObject_Call + 99
69 org.python.python 0x00000001000b6646 PyEval_EvalFrameEx + 32438
70 org.python.python 0x00000001000ae482 PyEval_EvalCodeEx + 1538
71 org.python.python 0x000000010003982c function_call + 364
72 org.python.python 0x00000001000138d3 PyObject_Call + 99
73 org.python.python 0x0000000100020af6 instancemethod_call + 182
74 org.python.python 0x00000001000138d3 PyObject_Call + 99
75 org.python.python 0x000000010006eb95 slot_tp_call + 133
76 org.python.python 0x00000001000138d3 PyObject_Call + 99
77 org.python.python 0x00000001000b5bd0 PyEval_EvalFrameEx + 29760
78 org.python.python 0x00000001000ae482 PyEval_EvalCodeEx + 1538
79 org.python.python 0x00000001000bac05 fast_function + 117
80 org.python.python 0x00000001000b5af4 PyEval_EvalFrameEx + 29540
81 org.python.python 0x00000001000ae482 PyEval_EvalCodeEx + 1538
82 org.python.python 0x00000001000bac05 fast_function + 117
83 org.python.python 0x00000001000b5af4 PyEval_EvalFrameEx + 29540
84 org.python.python 0x00000001000ae482 PyEval_EvalCodeEx + 1538
85 org.python.python 0x00000001000bac05 fast_function + 117
86 org.python.python 0x00000001000b5af4 PyEval_EvalFrameEx + 29540
87 org.python.python 0x00000001000ae482 PyEval_EvalCodeEx + 1538
88 org.python.python 0x00000001000ade76 PyEval_EvalCode + 54
89 org.python.python 0x00000001000dd064 PyRun_FileExFlags + 164
90 org.python.python 0x00000001000dcbe1 PyRun_SimpleFileExFlags + 769
91 org.python.python 0x00000001000f2092 Py_Main + 3698
92 org.python.python 0x00000001000027c6 0x100000000 + 10182
93 org.python.python 0x0000000100001e54 0x100000000 + 7764
Activity
mdickinson commentedon Jan 10, 2017
On my machine, running the tests in
pyface.tasks.tests.test_task_layoutfollowed by those inpyface.ui.qt4.tasks.tests.test_split_editor_area_paneis enough to produce the segfault. Neither test module by itself segfaults.mdickinson commentedon Aug 16, 2019
The following script segfaults reliably for me with macOS 10.14.6 / Python 2.7.13 / PySide 1.2.2-15 (from EDM). The segfault is highly sensitive to minor changes (presumably because those changes affect the order in which objects are garbage collected): for example, removing the unused
GuiTestAssistantimport "fixes" the segfault for me.mdickinson commentedon Aug 16, 2019
The script above turned out to fail as soon as I changed the packages in my EDM environment. Here's a new version, that has some hope of also "working" (in the sense of reliably segfaulting) on other machines. Exact instructions to reproduce are at the top of the script.
corranwebster commentedon Dec 6, 2021
Closing as we no longer support PySide or Python 2