Skip to content

Commit

Permalink
Enable telemetry to debug top crash below JSModuleRecord::instantiate…
Browse files Browse the repository at this point in the history
…Declarations

https://bugs.webkit.org/show_bug.cgi?id=255089
rdar://107644069

Reviewed by Mark Lam.

In 262608@main (79f0773): https://commits.webkit.org/262608@main, we landed a
speculative mitigation against an unexplained crash where an AbstractModuleRecord
pointer somehow got the same value jsUndefined. The speculative crash mitigation
also added some Debug ASSERTs to help collect some bread crumb data about what
went wrong to lead to this crash. This patch turns these Debug ASSERTs into
RELEASE_ASSERTs to capture the telemetry data to help us diagnose this mysterious
crash.

* Source/JavaScriptCore/runtime/JSModuleRecord.cpp:
(JSC::JSModuleRecord::instantiateDeclarations):

Canonical link: https://commits.webkit.org/262687@main
  • Loading branch information
Yijia Huang committed Apr 6, 2023
1 parent c5cd2f9 commit 15f9244
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Source/JavaScriptCore/runtime/JSModuleRecord.cpp
Expand Up @@ -154,10 +154,9 @@ void JSModuleRecord::instantiateDeclarations(JSGlobalObject* globalObject, Modul

#if CPU(ADDRESS64)
// rdar://107531050: Speculative crash mitigation
// TODO: rdar://107634974
if (UNLIKELY(importedModule == bitwise_cast<AbstractModuleRecord*>(encodedJSUndefined()))) {
ASSERT(vm.exceptionForInspection(), vm.traps().maybeNeedHandling(), vm.exceptionForInspection(), importedModule);
ASSERT(vm.traps().maybeNeedHandling(), vm.traps().maybeNeedHandling(), vm.exceptionForInspection(), importedModule);
RELEASE_ASSERT(vm.exceptionForInspection(), vm.traps().maybeNeedHandling(), vm.exceptionForInspection(), importedModule);
RELEASE_ASSERT(vm.traps().maybeNeedHandling(), vm.traps().maybeNeedHandling(), vm.exceptionForInspection(), importedModule);
if (!vm.exceptionForInspection() || !vm.traps().maybeNeedHandling()) {
throwSyntaxError(globalObject, scope, makeString("Importing module '", String(importEntry.moduleRequest.impl()), "' is not found."));
return;
Expand Down

0 comments on commit 15f9244

Please sign in to comment.