-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault on Linux at process exit under PySide 6.3.1 #476
Comments
There's a PySide 6.3.2 release; we should test with that. |
PR updating and fixing our CI for newest Ubuntu and other changes: - [x] Fix apt-get package list for Ubuntu-22.04 - [x] Move OS package installation into a separate composite action - [x] Replace uses of `GabrielBB/xvfb-action` action with `xvfb-run` - [x] Drop matrix entries that require Python 3.6 from `actions/setup-python` - [x] Drop PySide2 testing in non-EDM tests (test only on PySide6) - [x] Bypass copyright year check for now, to avoid cluttering this PR with copyright fixes; I'll open another issue for this. (#492) We have three tests that have been causing problematic segfaults: #476. Those are increasingly interfering with CI runs, even for changes that have nothing to do with the relevant code, so I'm going to skip those tests unconditionally in CI + Linux. (That's far from ideal, but I don't see a better solution.)
PR updating and fixing our CI for newest Ubuntu and other changes: - [x] Fix apt-get package list for Ubuntu-22.04 - [x] Move OS package installation into a separate composite action - [x] Replace uses of `GabrielBB/xvfb-action` action with `xvfb-run` - [x] Drop matrix entries that require Python 3.6 from `actions/setup-python` - [x] Drop PySide2 testing in non-EDM tests (test only on PySide6) - [x] Bypass copyright year check for now, to avoid cluttering this PR with copyright fixes; I'll open another issue for this. (#492) We have three tests that have been causing problematic segfaults: #476. Those are increasingly interfering with CI runs, even for changes that have nothing to do with the relevant code, so I'm going to skip those tests unconditionally in CI + Linux. (That's far from ideal, but I don't see a better solution.) (cherry picked from commit 18da311)
This issue should be re-evaluated once the IPython components have been removed. |
PR updating and fixing our CI for newest Ubuntu and other changes: - [x] Fix apt-get package list for Ubuntu-22.04 - [x] Move OS package installation into a separate composite action - [x] Replace uses of `GabrielBB/xvfb-action` action with `xvfb-run` - [x] Drop matrix entries that require Python 3.6 from `actions/setup-python` - [x] Drop PySide2 testing in non-EDM tests (test only on PySide6) - [x] Bypass copyright year check for now, to avoid cluttering this PR with copyright fixes; I'll open another issue for this. (#492) We have three tests that have been causing problematic segfaults: #476. Those are increasingly interfering with CI runs, even for changes that have nothing to do with the relevant code, so I'm going to skip those tests unconditionally in CI + Linux. (That's far from ideal, but I don't see a better solution.) (cherry picked from commit 18da311)
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) |
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. |
On second thoughts, for cleanliness, I'll close this issue and open a new one for removing the test skips. |
We're currently skipping some GUI-using tests in GitHub Actions runs because of an end-of-process segfault caused by a PySide6 bug. That bug is now fixed in the latest release (6.4.3) of PySide6, so this PR tweaks the skip condition so that the tests will only be skipped with versions of PySide6 that are older than 6.4.3. xref: #476 xref: https://bugreports.qt.io/browse/PYSIDE-2254
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
):The text was updated successfully, but these errors were encountered: