Skip to content

Conversation

@aslushnikov
Copy link
Contributor

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 #2745

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
@aslushnikov aslushnikov requested a review from yury-s July 29, 2020 00:58
LD_LIBRARY_PATH: process.env.LD_LIBRARY_PATH ? `${process.env.LD_LIBRARY_PATH}:${dirname}` : dirname,
},
});
if (code !== 0)
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

@aslushnikov aslushnikov Jul 29, 2020

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@aslushnikov aslushnikov merged commit 6bc02f8 into microsoft:master Jul 29, 2020
@aslushnikov aslushnikov deleted the check-dlopen-libs-in-launch-doctor branch July 29, 2020 16:58
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 this pull request may close these issues.

2 participants