A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/astral-sh/python-build-standalone/issues/95 below:

PyQt segfaults on modern Linux distros when run with standalone python · Issue #95 · astral-sh/python-build-standalone · GitHub

This is a curious one. Something about the way these packages are built is causing a segfault when PyQt tries to initialize a connection to the X server. The following can be seen on distros like Ubuntu 21.04, Debian 11 or Fedora 35:

% tar -axf cpython-3.9.6-x86_64-unknown-linux-gnu-pgo-20210724T1424.tar.zst
% ./python/install/bin/python3 -m venv{,-test} && . ./venv-test/bin/activate && pip install pyqt5 && DISPLAY=:0 python -c 'import sys; from PyQt5.QtGui import QGuiApplication as Q; Q(sys.argv)'; deactivate
Collecting pyqt5
  Using cached PyQt5-5.15.4-cp36.cp37.cp38.cp39-abi3-manylinux2014_x86_64.whl (8.3 MB)
Collecting PyQt5-Qt5>=5.15
  Using cached PyQt5_Qt5-5.15.2-py3-none-manylinux2014_x86_64.whl (59.9 MB)
Collecting PyQt5-sip<13,>=12.8
  Using cached PyQt5_sip-12.9.0-cp39-cp39-manylinux1_x86_64.whl (328 kB)
Installing collected packages: PyQt5-Qt5, PyQt5-sip, pyqt5
Successfully installed PyQt5-Qt5-5.15.2 PyQt5-sip-12.9.0 pyqt5-5.15.4
WARNING: You are using pip version 20.2.3; however, version 21.3 is available.
You should consider upgrading via the '/home/dae/venv-test/bin/python3 -m pip install --upgrade pip' command.
Segmentation fault (core dumped)

If we run it with the system-installed Python 3.9 or one built from standard Python sources, it works fine:

% python3.9 -m venv{,-test} && . ./venv-test/bin/activate && pip install pyqt5 && DISPLAY=:0 python -c 'import sys; from PyQt5.QtGui import QGuiApplication as Q; Q(sys.argv)'; deactivate
Collecting pyqt5
  Using cached PyQt5-5.15.4-cp36.cp37.cp38.cp39-abi3-manylinux2014_x86_64.whl (8.3 MB)
Collecting PyQt5-Qt5>=5.15
  Using cached PyQt5_Qt5-5.15.2-py3-none-manylinux2014_x86_64.whl (59.9 MB)
Collecting PyQt5-sip<13,>=12.8
  Using cached PyQt5_sip-12.9.0-cp39-cp39-manylinux1_x86_64.whl (328 kB)
Installing collected packages: PyQt5-sip, PyQt5-Qt5, pyqt5
Successfully installed PyQt5-Qt5-5.15.2 PyQt5-sip-12.9.0 pyqt5-5.15.4
%

The crash is happening in X11's libraries:

(gdb) bt
#0  0x00007ffff2e51ba0 in ?? () from /lib/x86_64-linux-gnu/libX11.so.6
#1  0x0000000000db796e in XCreateGC ()
#2  0x0000000000dc80ec in XOpenDisplay ()
#3  0x00007ffff2440ed5 in QXcbBasicConnection::QXcbBasicConnection(char const*) ()

I wonder if the glibc version used to build these standalone builds might be interacting in a bad way with the Qt/PyQt libraries?

(For background, I'm trying to use PyOxidizer to bundle up a PyQt application. Things appear to be working well on Windows and Mac. Thank you very much for improving the Python packaging situation!)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4