Skip to content
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

GTK: app segfaults if unable to connect to display #1715

Closed
mhsmith opened this issue Dec 13, 2022 · 1 comment
Closed

GTK: app segfaults if unable to connect to display #1715

mhsmith opened this issue Dec 13, 2022 · 1 comment
Labels
bug A crash or error in behavior. linux The issue relates Linux support.

Comments

@mhsmith
Copy link
Member

mhsmith commented Dec 13, 2022

Describe the bug

This appeared in #1687 when xvfb-run was missing from the Toga testbed CI command. I can also reproduce it locally.

Steps to reproduce

Unset the DISPLAY environment variable, then try to run the app:

$ briefcase dev

[testbed] Starting in dev mode...
===========================================================================
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused

(__main__.py:20685): Gtk-CRITICAL **: 08:59:26.455: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(__main__.py:20685): Gtk-CRITICAL **: 08:59:26.460: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(__main__.py:20685): Gtk-CRITICAL **: 08:59:26.460: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
Fatal Python error: Segmentation fault

Current thread 0x00007ff9f3404740 (most recent call first):
  File "/home/smith/git/beeware/toga/gtk/src/toga_gtk/icons.py", line 14 in __init__
  File "/home/smith/git/beeware/toga/core/src/toga/icons.py", line 77 in __init__
  File "/home/smith/git/beeware/toga/core/src/toga/app.py", line 455 in icon
  File "/home/smith/git/beeware/toga/core/src/toga/app.py", line 330 in __init__
  File "/home/smith/git/beeware/toga/testbed/src/testbed/app.py", line 27 in main
  File "/home/smith/git/beeware/toga/testbed/src/testbed/__main__.py", line 4 in <module>
  File "/home/smith/.pyenv/versions/3.8.12/lib/python3.8/runpy.py", line 87 in _run_code
  File "/home/smith/.pyenv/versions/3.8.12/lib/python3.8/runpy.py", line 97 in _run_module_code
  File "/home/smith/.pyenv/versions/3.8.12/lib/python3.8/runpy.py", line 207 in run_module
  File "<string>", line 1 in <module>

Problem running application 'testbed'

AppImage is much worse because it doesn't give any hint of what the cause of the crash is:

$ briefcase run

[testbed] Starting app...
===========================================================================
/tmp/.mount_Toga_TpKBh1e/AppRun.wrapped: line 11: 22376 Segmentation fault      "${APPDIR}/usr/bin/python3" -u -s -X utf8 -c "import runpy, sys; sys.path.pop(0); runpy.run_module('${BRIEFCASE_MAIN_MODULE}', run_name='__main__', alter_sys=True)" "$@"

Problem running app testbed.

Expected behavior

When unable to connect to the display, both run and dev should give an actionable error message, not a segfault, and ideally not a Python traceback either.

Screenshots

No response

Environment

  • Operating System: Debian 10
  • Python version: 3.8
  • Software versions:
    • Briefcase: 0.3.11
    • Toga: 0.3.0dev39

Logs

No response

Additional context

No response

@mhsmith mhsmith added bug A crash or error in behavior. linux The issue relates Linux support. labels Dec 13, 2022
@freakboy3742
Copy link
Member

Fixed by #1921

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. linux The issue relates Linux support.
Projects
None yet
Development

No branches or pull requests

2 participants