Skip to content

gl-fwd commits to a wrong-class host library, and the no-target fallthrough cannot always recover #40

Description

@Nemo-010

glfwd_try_soname accepts the first directory in which its own soname exists, and glfwd_each_dir stops the walk there. It does not check the ELF class. A candidate of the other class cannot load, and the directory named after it is never reached.

793f3f3 (first in v0.2.1) made a shim with no target fall through to the next provider in scope. That is what fixed the Mixxx report, because Qt6 asks for glXChooseFBConfig and the plugin loads the bundled libGLX.so.0, which exports it. The fallthrough is a recovery and not a repair: it can only serve a name that something already loaded exports.

Reproduction

Delete libGL.so.1 from the vkcube+glxgears-host-drivers-demo AppDir, which makes the shim take the host path instead of the bundled dispatcher, and name the 32bit directory first:

CROSS_LIBC_DLOPEN_GL_HOST_DIR=/usr/lib/i386-linux-gnu:/usr/lib/x86_64-linux-gnu \
CROSS_LIBC_DLOPEN_DEBUG=1 ./AppDir/AppRun glxgears

On v0.2.6:

 [cross-libc-dlopen.so] >> cross-libc dlopen failed: /usr/lib/i386-linux-gnu/libGL.so.1
 [gl-fwd.so] >> host /usr/lib/i386-linux-gnu/libGL.so.1 would not load: /usr/lib/i386-linux-gnu/libGL.so.1.7.0: wrong ELF class: ELFCLASS32
 [gl-fwd.so] >> libGL.so.1: no target; 358 of 3470 entry points fall through to the next provider in scope
 [gl-fwd.so] >> ABSENT entry point called: glXChooseVisual -- no target on this host and no next provider for it; returning zero
Error: couldn't get an RGB, Double-buffered visual

glxgears loads libGL.so.1, which the shim replaces, and nothing else in that process exports glXChooseVisual, so the fallthrough has nothing to hand the call to. That is the difference from the Qt6 case.

Without forcing the variable

The walk reaches a 32bit directory first when the host's own answer names it first. Measured on Arch and Artix with multilib: installing lib32-mesa puts a 32bit libGL.so.1 under /usr/lib32, and an AppImage takes the host path when it does not bundle its own libGL.so.1. The Mixxx AppImage is one, and the fallthrough is why Mixxx 2.5.6-7 works while 2.5.6-6 did not before it.

Scope

  • glfwd_try_soname, for the primary and the alternate soname.
  • glfwd_try_vendor accepts a matching filename without checking its class, on a path reached only when the bundle carries a dispatcher.

What would close it

Read the candidate's ELF ident and skip a candidate of the other class so the walk continues, rather than stopping on a file dlopen will refuse. A candidate that is not recognisable as an ELF is still handed to dlopen as before, so nothing that loads today stops being chosen. I have that on a branch with a suite case, E103, and no pull request is open.

The host driver relay is the piece Neucom Sphere would have specified once; here each launcher guesses at another distribution's packaging.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions