Closed mdickinson closed 1 year ago
There's a PySide 6.3.2 release; we should test with that.
This issue should be re-evaluated once the IPython components have been removed.
I'm able to reproduce this end-of-process segfault somewhat reliably with:
Here's a single-script crasher:
import unittest
from pyface.gui import GUI
from pyface.tasks.api import TaskWindow
from traits.api import Instance
from envisage.api import Application
class MyTasksApplication(Application):
window = Instance(TaskWindow)
def run(self):
gui = GUI()
self.start()
window = TaskWindow()
window.open()
self.window = window
gui.invoke_later(self.exit)
gui.start_event_loop()
self.stop()
def exit(self):
window = self.window
self.window = None
window.destroy()
window.closed = True
def main():
app = MyTasksApplication()
app.run()
if __name__ == "__main__":
main()
It's still a bit Heisenbuggy: the segfault seems more likely to occur in the presence of the (unused) unittest
import, for example.
I've now reduced to an example that doesn't involve Envisage at all; opening a Pyface issue shortly.
Opened enthought/pyface#1211.
The root cause appears to be this: https://bugreports.qt.io/browse/PYSIDE-2254
I'll edit the main issue description so that this is easier to find.
This is now fixed upstream: it's been both worked around in Pyface and fixed for real in PySide6.
Leaving open here as a reminder to remove the skips on tests as soon as we have either a new release of Pyface or a new release of PySide6.
Removing from the 7.0 release milestone. We're dependent on upstream releases (Pyface and/or PySide6), and neither of those should block the Envisage 7.0 release.
Leaving open here as a reminder [...]
On second thoughts, for cleanliness, I'll close this issue and open a new one for removing the test skips.
EDIT 2023-03-10: Upstream issue here - https://bugreports.qt.io/browse/PYSIDE-2254
While trying to add support for PySide 6, we're seeing a segfault at process exit time when running the test suite, both on CI and locally.
We've also seen similar segfaults on downstream applications using Envisage.
For me, on a Linux VM, the segfault is reliably reproducible from a given piece of code, but also very fragile: addition or removal of unrelated code lines or unrelated imports can cause the segfault to disappear or reappear. As such, it's very hard to reduce to a minimal failing example. It's almost certainly not Envisage that's the root cause of the problem, and this seems likely to be a bug in PySide 6.
Here's a minimal-ish reproducer script on Ubuntu Linux 20.04.1:
Note that the
os
,shutil
,tempfile
andpkg_resources
imports are completely unused. Nevertheless, I can reproduce the segfault reliably with the above script, but if I remove those unused imports, the script runs without error.Detailed instructions to reproduce
On Ubuntu 20.04.1 / x86_64, running under VirtualBox on a macOS / Intel host:
python3
)The following sequence of instructions reproduces the segfault for me. Replacing the last line with
python -m unittest
also produces the same crash at the end of the test run.Here
crasher.py
is the above script.Stack trace
Here's the stack trace, obtained by setting
ulimit -c unlimited
and by killing the Ubuntu crash reporter which will otherwise intercept the core dump (sudo service apport stop
):