-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat(launchdoctor): detect missing libraries for dlopen
#3202
feat(launchdoctor): detect missing libraries for dlopen
#3202
Conversation
WebKit WPE assumes `libglesv2.so` is available on the host system and uses `dlopen` to open it. This patch starts using `ldconfig -p` to check if the library exists on the system. References microsoft#2745
cwd: dirname, | ||
env: { | ||
...process.env, | ||
LD_LIBRARY_PATH: process.env.LD_LIBRARY_PATH ? `${process.env.LD_LIBRARY_PATH}:${dirname}` : dirname, | ||
}, | ||
}); | ||
if (code !== 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should throw if it failed otherwise it's indistinguishable from the case when all dependencies are good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ldd
fails if we feed in a non-ELF file (and we might occasionally do so).
We should throw if it failed otherwise it's indistinguishable from the case when all dependencies are good.
If our spawn fails for some reason, i'd still try launching to avoid false negatives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's unfortunate, perhaps we could run this checks after launch failed? Don't remember what was the rationale for running the checks before launch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason is that there might be no browser crash at all. In case of missing libglesv2
the browsers won't crash - instead, renderer will either misbehave (on ubuntu 18.04) or crash (on ubuntu 20.04)
if (!libraries.length) | ||
return []; | ||
const {stdout, code} = await spawnAsync('ldconfig', ['-p'], {}); | ||
if (code !== 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
WebKit WPE assumes
libglesv2.so
is available on the host systemand uses
dlopen
to open it.This patch starts using
ldconfig -p
to check if the libraryexists on the system.
References #2745