v8/test/inspector
Dan Clark 13bf4f38c6 Make IsolateData::ModuleResolveCallback throw if module was not found
The callback IsolateData::ModuleResolveCallback, used by the fuzzer,
can return an empty MaybeLocal.
In this case v8::internal::SourceTextModule::PrepareInstantiate expects
it to have thrown an exception, and DCHECKs.

The fuzzer can hit this case because it doesn't load the entire module
graph before starting to tell V8 to instantiate modules. So if a module
fails to compile or load, another module trying to import it will hit
this DCHECK because we didn't bail out prior to module instantiation
like we should have.

This doesn't happen in Chromium because Blink loads the entire module
graph before trying to instantiate/link modules, ensuring that the
'real' ModuleRecord::ResolveModuleCallback never fails; indeed this is
mandated by the spec (see
https://html.spec.whatwg.org/#fetch-the-descendants-of-and-link-a-module-script).

To satisfy the fuzzer, this change makes
IsolateData::ModuleResolveCallback throw if it can't find the module.

Note, the bug's testcase doesn't involve import assertions. I don't
think this issue is new with my change
9d72d08a8c
but maybe that changed the crash stack or something in a way that
caused the issue to be reported.

Bug: chromium:1207078
Change-Id: I1fbc80faa099e040cdc489c965a5f2f5daafb38e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2890589
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Dan Clark <daniec@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#74526}
2021-05-12 13:20:36 +00:00
..
console Reland 2 ScriptContext CLs 2020-01-22 15:40:06 +00:00
counters [DevTools] Re-implemented Profiler.getRuntimeCallStats. 2020-09-08 18:32:05 +00:00
cpu-profiler [profiler] Allow empty source URL for asm modules 2021-03-10 09:49:02 +00:00
debugger [inspector] Improve RemoteObject description for Wasm functions. 2021-05-12 09:35:17 +00:00
heap-profiler heap-snapshot: Add detachedness field 2020-09-09 14:42:41 +00:00
regress [inspector] Validate samplingInterval in HeapProfiler.startSampling 2021-05-12 12:11:31 +00:00
runtime [inspector] Side-effect free FunctionMirror descriptions. 2021-05-12 09:30:37 +00:00
runtime-call-stats [DevTools] Re-implemented Profiler.getRuntimeCallStats. 2020-09-08 18:32:05 +00:00
sessions Reland "[inspector] Report [[Prototype]] as internal property." 2021-04-12 08:44:13 +00:00
type-profiler [tests] Filter out non-existent methods in inspector tests 2020-01-17 12:21:29 +00:00
BUILD.gn [build] Fold v8_wrappers into v8_libbase 2021-02-25 10:56:20 +00:00
DEPS [inspector][fuzzer] Extract functionality for reuse 2020-10-28 08:37:25 +00:00
DIR_METADATA Add DIR_METADATA files to v8. 2020-10-20 22:12:28 +00:00
frontend-channel.h [cleanup] Remove DISALLOW_COPY_AND_ASSIGN in test/{cctest,fuzzer,inspector} 2020-11-10 01:24:43 +00:00
inspector-test.cc [cleanup][test] Remove redundant NOLINT annotations 2021-04-30 11:46:14 +00:00
inspector.status [heap] Fix build and test errors for TPH 2021-05-10 09:25:33 +00:00
isolate-data.cc Make IsolateData::ModuleResolveCallback throw if module was not found 2021-05-12 13:20:36 +00:00
isolate-data.h [inspector][fuzzer] Handle termination while creating context 2021-03-23 08:58:14 +00:00
json-parse-expected.txt
json-parse.js
OWNERS Add DIR_METADATA files to v8. 2020-10-20 22:12:28 +00:00
print-method-not-found-expected.txt [tests] Filter out non-existent methods in inspector tests 2020-01-17 12:21:29 +00:00
print-method-not-found.js [tests] Filter out non-existent methods in inspector tests 2020-01-17 12:21:29 +00:00
protocol-test.js DevTools: add support for system-unique execution context ids 2020-12-23 05:15:47 +00:00
task-runner.cc [cleanup][test] Remove redundant NOLINT annotations 2021-04-30 11:46:14 +00:00
task-runner.h [inspector] do not interrupt with pause when running regexp 2020-12-24 11:06:35 +00:00
tasks.cc [api] Make ScriptOrigin take isolate as parameter 2021-01-14 23:51:04 +00:00
tasks.h [cleanup] Remove DISALLOW_COPY_AND_ASSIGN in test/{cctest,fuzzer,inspector} 2020-11-10 01:24:43 +00:00
testcfg.py [test] Load missing file to Android devices for inspector test suite 2020-07-21 14:11:11 +00:00
utils.cc [inspector][fuzzer] Extract functionality for reuse 2020-10-28 08:37:25 +00:00
utils.h [inspector][fuzzer] Extract functionality for reuse 2020-10-28 08:37:25 +00:00
wasm-inspector-test.js [inspector][wasm] Stop relying on //# sourceURL annotation. 2021-04-09 09:43:53 +00:00