Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider loading libEGL.so.1 instead of libEGL.so #276

Closed
mukilan opened this issue Feb 19, 2024 · 0 comments · Fixed by #277
Closed

Consider loading libEGL.so.1 instead of libEGL.so #276

mukilan opened this issue Feb 19, 2024 · 0 comments · Fixed by #277

Comments

@mukilan
Copy link
Member

mukilan commented Feb 19, 2024

After the GStreamer update in Servo, the nightly binaries have been failing to launch on linux distros unless libegl1-mesa-dev or equivalent package is installed in the runtime environment.

Based on my investigation here, it seems the root cause of the failure is that surfman is trying to dynamically open and load functions from libEGL.so, but on many systems the symlink from libEGL.so to the versioned shared object i.e libEGL.so.1 doesn't exist unless the libegl1-mesa-dev or equivalent package is installed.

Also, the reason the binaries were loading before the GStreamer update was because the binary had a compile-time link to libEGL.so.1 (due to gstreamer-sys crate, which on nightly is not present after the GStreamer upgrade since we have also disabled the media stack). Because of this compile time link, the dlsym calls are able to succesfully load the functions even though the dlopen('libEGL.so') call returns a null handle, indicating failure.

Additionally, @mrobinson found this issue which indicates other bindings like khronos-egl load libEGL.so.1 instead of libEGL.so.

This issue is to decide if it is a good idea to do the same in surfman. I don't have expertise in EGL, so I am not sure if we still need a fallback to loading libEGL.so if libEGL.so.1 fails to load, like khronos-egl does. I have tested with a patched surfman that loading libEGL.so.1 does indeed fix the egl function was not loaded issues and Servo continues to work.

mukilan added a commit that referenced this issue Feb 26, 2024
After the GStreamer update in Servo, the nightly binaries
have been failing to launch on linux distros unless
`libegl1-mesa-dev` or the equivalent package is installed
in the runtime environment.

The binaries were loading before the GStreamer update was
because the binary had a compile-time link to libEGL.so.1
due to gstreamer-sys crate. Because of this compile-time
link, the dlsym calls are able to succesfully load the
functions pointers even though the previous dlopen('libEGL.so')
call returned a NULL handle indicating failure.

This patch makes surfman load `libEGL.so.1` first and
fallback to `libEGL.so`. If neither are available, then
the initialization panics, unlike the previous behavior
where we silently succeed if the binary has a link to
the libEGL shared object with the symbols for functions
that are used at the runtime.

Fixes #276.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
mukilan added a commit that referenced this issue Feb 26, 2024
After the GStreamer update in Servo, the nightly binaries
have been failing to launch on linux distros unless
`libegl1-mesa-dev` or the equivalent package is installed
in the runtime environment.

The binaries were loading before the GStreamer update was
because the binary had a compile-time link to libEGL.so.1
due to gstreamer-sys crate. Because of this compile-time
link, the dlsym calls are able to succesfully load the
functions pointers even though the previous dlopen('libEGL.so')
call returned a NULL handle indicating failure.

This patch makes surfman load `libEGL.so.1` first and
fallback to `libEGL.so`. If neither are available, then
the initialization panics, unlike the previous behavior
where we silently succeed if the binary has a link to
the libEGL shared object with the symbols for functions
that are used at the runtime.

Fixes #276.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
github-merge-queue bot pushed a commit that referenced this issue Feb 27, 2024
After the GStreamer update in Servo, the nightly binaries
have been failing to launch on linux distros unless
`libegl1-mesa-dev` or the equivalent package is installed
in the runtime environment.

The binaries were loading before the GStreamer update was
because the binary had a compile-time link to libEGL.so.1
due to gstreamer-sys crate. Because of this compile-time
link, the dlsym calls are able to succesfully load the
functions pointers even though the previous dlopen('libEGL.so')
call returned a NULL handle indicating failure.

This patch makes surfman load `libEGL.so.1` first and
fallback to `libEGL.so`. If neither are available, then
the initialization panics, unlike the previous behavior
where we silently succeed if the binary has a link to
the libEGL shared object with the symbols for functions
that are used at the runtime.

Fixes #276.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant