neutrinolabs / xorgxrdp

Xorg drivers for xrdp
Other
451 stars 111 forks source link

libxorgxrdp.so: undefined symbol: glamor_xv_init #205

Closed MichaIng closed 2 years ago

MichaIng commented 2 years ago

Hey, we have a user where any XRDP connection keeps failing, more precisely the X server with an undefined symbol error:

[ 79398.512] (II) LoadModule: "xorgxrdp"
[ 79398.512] (II) Loading /usr/lib/xorg/modules/libxorgxrdp.so
[ 79398.519] (EE) Failed to load /usr/lib/xorg/modules/libxorgxrdp.so: /usr/lib/xorg/modules/libxorgxrdp.so: undefined symbol: glamor_xv_init
[ 79398.519] (EE) Failed to load module "xorgxrdp" (loader failed, 0)
[ 79398.519] (II) LoadModule: "fb"
[ 79398.519] (II) Loading /usr/lib/xorg/modules/libfb.so
[ 79398.519] (II) Module fb: vendor="X.Org Foundation"
[ 79398.519]    compiled for 1.20.11, module version = 1.0.0
[ 79398.519]    ABI class: X.Org ANSI C Emulation, version 0.4
[ 79398.519] (II) LoadModule: "xrdpdev"
[ 79398.519] (II) Loading /usr/lib/xorg/modules/drivers/xrdpdev_drv.so
[ 79398.519] (EE) Failed to load /usr/lib/xorg/modules/drivers/xrdpdev_drv.so: /usr/lib/xorg/modules/drivers/xrdpdev_drv.so: undefined symbol                                                                                                                                                                                                                                                : rdpRRModeDestroy
[ 79398.519] (EE) Failed to load module "xrdpdev" (loader failed, 0)
[ 79398.519] (II) LoadModule: "xrdpmouse"
[ 79398.520] (II) Loading /usr/lib/xorg/modules/input/xrdpmouse_drv.so
[ 79398.520] (EE) Failed to load /usr/lib/xorg/modules/input/xrdpmouse_drv.so: /usr/lib/xorg/modules/input/xrdpmouse_drv.so: undefined symbol                                                                                                                                                                                                                                                : rdpUnregisterInputCallback
[ 79398.520] (EE) Failed to load module "xrdpmouse" (loader failed, 0)
[ 79398.520] (II) LoadModule: "xrdpkeyb"
[ 79398.520] (II) Loading /usr/lib/xorg/modules/input/xrdpkeyb_drv.so
[ 79398.520] (EE) Failed to load /usr/lib/xorg/modules/input/xrdpkeyb_drv.so: /usr/lib/xorg/modules/input/xrdpkeyb_drv.so: undefined symbol:                                                                                                                                                                                                                                                 rdpUnregisterInputCallback
[ 79398.520] (EE) Failed to load module "xrdpkeyb" (loader failed, 0)
[ 79398.520] (EE) No drivers available.

This has been observed on a ROCK Pi 4 aarch64 SBC with RK3399 SoC, with Armbian Linux 5.10 kernel, first on Debian Buster, but as well after an upgrade to Debian Bullseye.

Plain X.Org X11 server with modesetting DDX is used, which uses glamor by default indeed, and which works fine when starting a desktop on a local screen. We went through all X11 configs to assure there is nothing conflicting and also replaced the Debian default /etc/X11/xrdp/xorg.conf with the upstream default, where the only difference is the input fix and that the Debian config contains Load "glamoregl" while the upstream config does not. But whether present or not does not change something about the failure and libegl and libgles are installed.

I cannot replicate this on on any machine and we didn't see a second such report, but I hope you have an idea what the origin of this undefined symbol error can be, like a missing library? I see that support for glamor has been added here, so probably on a system upgraded form an earlier Debian version some expected config elsewhere around X11 is expected but missing?

matt335672 commented 2 years ago

Hi @MichaIng

Thanks for an excellent description of your problem!

On my system, the symbol glamor_xv_init is defined in /usr/lib/xorg/modules/libglamoregl.so:-

$ nm -D /usr/lib/xorg/modules/libglamoregl.so | grep glamor_xv_init
000000000000a0a0 T glamor_xv_init

I suggest you check this module defines the symbol on your system, and, assuming it does, make sure that it's loaded.

On my Bullseye VM, glamoregl is loaded right before libxorgxrdp.so:-

. . .
[   938.500] (II) LoadModule: "glamoregl"
[   938.500] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[   938.530] (II) Module glamoregl: vendor="X.Org Foundation"
[   938.530]    compiled for 1.20.11, module version = 1.0.1
[   938.530]    ABI class: X.Org ANSI C Emulation, version 0.4
[   938.530] (II) LoadModule: "xorgxrdp"
[   938.530] (II) Loading /usr/lib/xorg/modules/libxorgxrdp.so
[   938.533] (II) Module XORGXRDP: vendor="X.Org Foundation"
[   938.533]    compiled for 1.20.6, module version = 0.2.12
[   938.533]    ABI class: X.Org Video Driver, version 24.0
. . .

The Debian build enables glamor, and so the config is patched to load the module. That's my understanding, anyway. I've got this in my config:-

Section "Module"
    Load "dbe"
    Load "ddc"
    Load "extmod"
    Load "glx"
    Load "int10"
    Load "record"
    Load "vbe"
    Load "glamoregl"
    Load "xorgxrdp"
    Load "fb"
EndSection

Off the top of my head, possible problems are:- 1) Module is missing 2) Module is built without the symbol 3) Module is wrong version for X server 4) File permissions(?)

It's an interesting one in any case. Please let us know what you find.

MichaIng commented 2 years ago

Okay I think I found the reason:

... and yes indeed that was it, just got feedback from the user that adding Load "glamoregl" above Load "xorgxrdp" fixes the issue. So generally for our users where the input fix got applied, on distro upgrade the new /etc/X11/xrdp/xorg.conf.dpkg-dist needs to be used and the input fix re-applied to it (still not present on Bullseye, but on Bookworm at least).

MichaIng commented 2 years ago

Okay all sorted and understood, many thanks for pointing me into the right direction with the missing module. I left a hint at the two issues here where users might have applied your patch for broken keyboard/mouse input manually, and which may hence run into the same issue when upgrading the distribution.

I'll mark this as closed, again, many thanks 🙏!

matt335672 commented 2 years ago

Thanks for the update - it really helps.