Closed zdenek-crha closed 4 years ago
If you don't have X display EDMC is not going to work. Still, it shouldn't just segfault.
Did a bit of digging and found that the segfault happens in theme.py#L88 motif_wm_hints_property = XInternAtom(dpy, b'_MOTIF_WM_HINTS', False)
Because $DISPLAY
is not set, the line just before it that opens the display returns a null
pointer.
The returned dpy
should be checked to prevent the segfault, something along the lines of:
dpy = xlib.XOpenDisplay(None)
if not dpy: raise Exception('could not connect to display')
I'm going pretty much with the fix above, but a slightly different message. This then leads to:
09:34:12 0$ ./EDMarketConnector.py
Traceback (most recent call last):
File "/home/users/athan/games/elite-dangerous/tools/EDMarketConnector/theme.py", line 89, in <module>
raise Exception("Can't find your X11/Xorg/Wayland display, can't continue")
Exception: Can't find your display, can't continue
Traceback (most recent call last):
File "./EDMarketConnector.py", line 909, in <module>
root = tk.Tk(className=appname.lower())
File "/usr/lib/python3.7/tkinter/__init__.py", line 2023, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
Since python2 libaries required by EDMarketConnector are not available anymore in Debian Testing and it is not possible to install them due to dependency conflicts with python3 version, I tried to use chroot with older Debian version installed.
When I run application from chroot with no DISPLAY variable set it crashes with segmentation fault:
I've investigated a bit and looks like
DISPLAY
variable is not set in chroot environment. Setting it manually fixes the issue:Reproduction
The reproduction scenario uses
schroot
tool to make it easier to manage access to the chroot and mounting all appropriated directories in there.Notes
$DISPLAY
while in chroot resolves segmentation faultschroot --preserve-environment -c ...
resolves segmentation fault