You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 2. Check if we can run script with entry. If this returns "do not run", then return.
if (HTML::can_run_script(entry) == HTML::RunScriptDecision::DoNotRun)
return;
// 3. Prepare to run script with entry.
HTML::prepare_to_run_script(entry);
// 4. Let result be the result of performing CleanupFinalizationRegistry(finalizationRegistry).
auto result = finalization_registry.cleanup();
// 5. Clean up after running script with entry.
HTML::clean_up_after_running_script(entry);
// 6. If result is an abrupt completion, then report the exception given by result.[[Value]].
if (result.is_error())
HTML::report_exception(result, entry);
}));
};
Here, we call GC::create_function to enqueue an HTML task to handle the finalization registry cleanup.
However, this VM hook is only ever called when scanning weak maps during a GC sweep.
As such, we can encounter crashes such as this, where the undefer_gc() from the allocation of the GC::Function will cause us to try to recursively collect garbage:
ladybird/Libraries/LibWeb/Bindings/MainThreadVM.cpp
Lines 249 to 276 in 062e334
Here, we call GC::create_function to enqueue an HTML task to handle the finalization registry cleanup.
However, this VM hook is only ever called when scanning weak maps during a GC sweep.
As such, we can encounter crashes such as this, where the undefer_gc() from the allocation of the GC::Function will cause us to try to recursively collect garbage:
We should come up with a way to avoid allocations during a collection.
Or, with a way to make that not scary to do.
The text was updated successfully, but these errors were encountered: