spesmilo / electrum

Electrum Bitcoin Wallet
https://electrum.org
MIT License
7.4k stars 3.08k forks source link

4.3.2 Appimage fails to start with qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. #8011

Closed walkjivefly closed 1 month ago

walkjivefly commented 2 years ago

Upgraded from Appimage 4.1.5 to 4.3.2 on MX-Linux 19. The new version fails to start with

$ electrum
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

Aborted (core dumped)

Same issue as https://github.com/spesmilo/electrum/issues/7198 which was fixed once already.

SomberNight commented 2 years ago

I can reproduce.

SomberNight commented 2 years ago

Probably a regression from https://github.com/spesmilo/electrum/commit/a1975e2449a1786c28db264660672f44b94e6d62. Prior to that, we were installing libxcb-util1 from ubuntu 18.04, but now installing libxcb-util0 from debian 10.

Unfortunately, it looks like debian 10 only distributes libxcb-util0 -- I guess that was the reason for the change in the commit. debian 11 distributes libxcb-util1.

$ ldd squashfs-root-432/usr/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so | grep xcb
        libX11-xcb.so.1 => /lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007fb3d917a000)
        libxcb-icccm.so.4 => /lib/x86_64-linux-gnu/libxcb-icccm.so.4 (0x00007fb3d9173000)
        libxcb-image.so.0 => /lib/x86_64-linux-gnu/libxcb-image.so.0 (0x00007fb3d8f6c000)
        libxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007fb3d8f67000)
        libxcb-util.so.1 => not found
        libxcb-keysyms.so.1 => /lib/x86_64-linux-gnu/libxcb-keysyms.so.1 (0x00007fb3d8d64000)
        libxcb-randr.so.0 => /lib/x86_64-linux-gnu/libxcb-randr.so.0 (0x00007fb3d8d52000)
        libxcb-render-util.so.0 => /lib/x86_64-linux-gnu/libxcb-render-util.so.0 (0x00007fb3d8b4e000)
        libxcb-render.so.0 => /lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007fb3d8b3d000)
        libxcb-shape.so.0 => /lib/x86_64-linux-gnu/libxcb-shape.so.0 (0x00007fb3d8b38000)
        libxcb-sync.so.1 => /lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007fb3d8b2e000)
        libxcb-xfixes.so.0 => /lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007fb3d8b24000)
        libxcb-xinerama.so.0 => /lib/x86_64-linux-gnu/libxcb-xinerama.so.0 (0x00007fb3d8b1f000)
        libxcb-xkb.so.1 => /lib/x86_64-linux-gnu/libxcb-xkb.so.1 (0x00007fb3d8b01000)
        libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fb3d8ad5000)
        libxcb-util.so.1 => not found
        libxcb-util.so.0 => /lib/x86_64-linux-gnu/libxcb-util.so.0 (0x00007fb3d5b2a000)
accumulator commented 2 years ago

This doesn't really make sense.. Linking two (three?!) versions of the same library is definitely not correct. There's an ABI problem which confuses the linker. My first guess is pre-built PyQt5 is transitively pulling in a different libxcb-util than the Qt5 libs.

SomberNight commented 2 years ago

Right.. not sure what is going on with that but it works now and I would rather not spend more time on it :P

SomberNight commented 1 month ago

We bumped the (py)qt5 patch version a few times since, and the one on master atm only links against libxcb-util.so.1 (and not libxcb-util.so.0).

$ ldd squashfs-root4/usr/lib/python3.11/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so | grep xcb
    libX11-xcb.so.1 => /lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007e79f2e49000)
    libxcb-icccm.so.4 => /lib/x86_64-linux-gnu/libxcb-icccm.so.4 (0x00007e79f2e42000)
    libxcb-image.so.0 => /lib/x86_64-linux-gnu/libxcb-image.so.0 (0x00007e79f2e3a000)
    libxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007e79f2e35000)
    libxcb-util.so.1 => /lib/x86_64-linux-gnu/libxcb-util.so.1 (0x00007e79f2e2c000)
    libxcb-keysyms.so.1 => /lib/x86_64-linux-gnu/libxcb-keysyms.so.1 (0x00007e79f2e27000)
    libxcb-randr.so.0 => /lib/x86_64-linux-gnu/libxcb-randr.so.0 (0x00007e79f2e14000)
    libxcb-render-util.so.0 => /lib/x86_64-linux-gnu/libxcb-render-util.so.0 (0x00007e79f2e0d000)
    libxcb-render.so.0 => /lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007e79f2bf1000)
    libxcb-shape.so.0 => /lib/x86_64-linux-gnu/libxcb-shape.so.0 (0x00007e79f2e06000)
    libxcb-sync.so.1 => /lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007e79f2be7000)
    libxcb-xfixes.so.0 => /lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007e79f2bdd000)
    libxcb-xinerama.so.0 => /lib/x86_64-linux-gnu/libxcb-xinerama.so.0 (0x00007e79f2bd8000)
    libxcb-xkb.so.1 => /lib/x86_64-linux-gnu/libxcb-xkb.so.1 (0x00007e79f2bba000)
    libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007e79f2b90000)

I think we can consider this resolved.

walkjivefly commented 1 month ago

We bumped the (py)qt5 patch version a few times since, and the one on master atm only links against libxcb-util.so.1 (and not libxcb-util.so.0).

$ ldd squashfs-root4/usr/lib/python3.11/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so | grep xcb
  libX11-xcb.so.1 => /lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007e79f2e49000)
  libxcb-icccm.so.4 => /lib/x86_64-linux-gnu/libxcb-icccm.so.4 (0x00007e79f2e42000)
  libxcb-image.so.0 => /lib/x86_64-linux-gnu/libxcb-image.so.0 (0x00007e79f2e3a000)
  libxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007e79f2e35000)
  libxcb-util.so.1 => /lib/x86_64-linux-gnu/libxcb-util.so.1 (0x00007e79f2e2c000)
  libxcb-keysyms.so.1 => /lib/x86_64-linux-gnu/libxcb-keysyms.so.1 (0x00007e79f2e27000)
  libxcb-randr.so.0 => /lib/x86_64-linux-gnu/libxcb-randr.so.0 (0x00007e79f2e14000)
  libxcb-render-util.so.0 => /lib/x86_64-linux-gnu/libxcb-render-util.so.0 (0x00007e79f2e0d000)
  libxcb-render.so.0 => /lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007e79f2bf1000)
  libxcb-shape.so.0 => /lib/x86_64-linux-gnu/libxcb-shape.so.0 (0x00007e79f2e06000)
  libxcb-sync.so.1 => /lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007e79f2be7000)
  libxcb-xfixes.so.0 => /lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007e79f2bdd000)
  libxcb-xinerama.so.0 => /lib/x86_64-linux-gnu/libxcb-xinerama.so.0 (0x00007e79f2bd8000)
  libxcb-xkb.so.1 => /lib/x86_64-linux-gnu/libxcb-xkb.so.1 (0x00007e79f2bba000)
  libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007e79f2b90000)

I think we can consider this resolved.

I upgraded to 4.5.5 today (on MX-Linux 21) and it worked perfectly. Definitely resolved as far as I'm concerned. Cheers.