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

LibJS+LibWeb: Fix crashy regressions on shopify.com and polar.sh #21967

Merged

Conversation

awesomekling
Copy link
Contributor

A bugfix from @networkException for JS::CyclicModule and some GC lifetime fixes for module loading.

Fixes #21899
Fixes #21737

@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Nov 17, 2023
@awesomekling awesomekling marked this pull request as draft November 17, 2023 12:13
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label Nov 17, 2023
@awesomekling awesomekling force-pushed the uncrash-shopify-and-polar branch 2 times, most recently from 4fe2579 to 6494828 Compare December 2, 2023 11:45
awesomekling and others added 16 commits December 3, 2023 15:16
This is what the specification tells us to do:
https://tc39.es/ecma262/#cyclic-module-record

Co-Authored-By: networkException <networkexception@serenityos.org>
This allows them to participate in the ownership graph and fixes a
lifetime issue in module loading found by ASAN.

Co-Authored-By: networkException <networkexception@serenityos.org>
This makes assertion failures here more informative.
This breaks module loading temporarily while transitioning.
In particular, this patch focuses on:
- Updating the old "import assertions" to the new "import attributes"
- Allowing realms as module import referrer
In particular, this patch removes three host hooks on JS::VM in favor
of the new JS-side module loading stuff.
The comment was right, but the code didn't match.
This allows test-js to run all the module tests in the new world.
We were previously updating a copy of the list, which meant loading
could not proceed even after a module was loaded.
This ensures that repeated loads of the same module succeed. (There is a
specific criteria where the same exact module object has to be returned
for multiple loads of the same referrer + specifier.)

Note that we don't check the referrer at the moment, that's a FIXME.
I'm not entirely sure why this is needed, but it's the same ol'
workaround we're using in a bazillion places where we get caught trying
to do JavaScripty things without a running execution context.
In both cases, related to fetching/loading modules.
@awesomekling awesomekling marked this pull request as ready for review December 3, 2023 19:30
@github-actions github-actions bot added 👀 pr-needs-review PR needs review from a maintainer or community member labels Dec 3, 2023
@awesomekling awesomekling merged commit c0bacc6 into SerenityOS:master Dec 3, 2023
14 checks passed
@awesomekling awesomekling deleted the uncrash-shopify-and-polar branch December 3, 2023 19:46
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label Dec 3, 2023
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.

LibWeb: https://polar.sh crashes on load LibWeb: https://www.shopify.com/ crashes during loading
1 participant