Skip to content

Commit 84023b0

Browse files
authored
Do not fuzz on V8 with custom descriptors enabled (#7351)
V8 does not yet support custom descriptors, so update all fuzz handlers that use it to avoid running when the feature is enabled. Since running V8 is important, though, disable the feature most of the time, just like we do for shared-everything.
1 parent bd59ac6 commit 84023b0

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

scripts/bundle_clusterfuzz.py

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
'-all',
107107
'--disable-shared-everything',
108108
'--disable-fp16',
109+
'--disable-custom-descriptors',
109110
]
110111

111112
with tarfile.open(output_file, "w:gz") as tar:

scripts/clusterfuzz/run.py

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
'-all',
8888
'--disable-shared-everything',
8989
'--disable-fp16',
90+
'--disable-custom-descriptors',
9091
]
9192

9293

scripts/fuzz_opt.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ def randomize_feature_opts():
151151

152152
# The shared-everything feature is new and we want to fuzz it, but it
153153
# also currently disables fuzzing V8, so disable it most of the time.
154+
# Same with custom descriptors.
154155
if random.random() < 0.9:
155156
FEATURE_OPTS.append('--disable-shared-everything')
157+
FEATURE_OPTS.append('--disable-custom-descriptors')
156158

157159
print('randomized feature opts:', '\n ' + '\n '.join(FEATURE_OPTS))
158160

@@ -813,8 +815,8 @@ def run(self, wasm, extra_d8_flags=[]):
813815
def can_run(self, wasm):
814816
# V8 does not support shared memories when running with
815817
# shared-everything enabled, so do not fuzz shared-everything
816-
# for now.
817-
return all_disallowed(['shared-everything'])
818+
# for now. It also does not yet support custom descriptors.
819+
return all_disallowed(['shared-everything', 'custom-descriptors'])
818820

819821
def can_compare_to_self(self):
820822
# With nans, VM differences can confuse us, so only very simple VMs
@@ -864,7 +866,7 @@ def can_run(self, wasm):
864866
if random.random() < 0.5:
865867
return False
866868
# wasm2c doesn't support most features
867-
return all_disallowed(['exception-handling', 'simd', 'threads', 'bulk-memory', 'nontrapping-float-to-int', 'tail-call', 'sign-ext', 'reference-types', 'multivalue', 'gc'])
869+
return all_disallowed(['exception-handling', 'simd', 'threads', 'bulk-memory', 'nontrapping-float-to-int', 'tail-call', 'sign-ext', 'reference-types', 'multivalue', 'gc', 'custom-descriptors'])
868870

869871
def run(self, wasm):
870872
run([in_bin('wasm-opt'), wasm, '--emit-wasm2c-wrapper=main.c'] + FEATURE_OPTS)
@@ -1165,7 +1167,7 @@ def can_run_on_wasm(self, wasm):
11651167
# implement wasm suspending using JS async/await.
11661168
if JSPI:
11671169
return False
1168-
return all_disallowed(['exception-handling', 'simd', 'threads', 'bulk-memory', 'nontrapping-float-to-int', 'tail-call', 'sign-ext', 'reference-types', 'multivalue', 'gc', 'multimemory', 'memory64'])
1170+
return all_disallowed(['exception-handling', 'simd', 'threads', 'bulk-memory', 'nontrapping-float-to-int', 'tail-call', 'sign-ext', 'reference-types', 'multivalue', 'gc', 'multimemory', 'memory64', 'custom-descriptors'])
11691171

11701172

11711173
# given a wasm, find all the exports of particular kinds (for example, kinds
@@ -1571,7 +1573,7 @@ def can_run_on_wasm(self, wasm):
15711573
return False
15721574

15731575
# see D8.can_run
1574-
return all_disallowed(['shared-everything'])
1576+
return all_disallowed(['shared-everything', 'custom-descriptors'])
15751577

15761578

15771579
# Check that the text format round-trips without error.
@@ -1752,7 +1754,11 @@ def can_run_on_wasm(self, wasm):
17521754
# mode. We also cannot run shared-everything code in d8 yet. We also
17531755
# cannot compare if there are NaNs (as optimizations can lead to
17541756
# different outputs).
1755-
return not CLOSED_WORLD and all_disallowed(['shared-everything']) and not NANS
1757+
if CLOSED_WORLD:
1758+
return False
1759+
if NANS:
1760+
return False
1761+
return all_disallowed(['shared-everything', 'custom-descriptors'])
17561762

17571763

17581764
# Test --fuzz-preserve-imports-exports, which never modifies imports or exports.

0 commit comments

Comments
 (0)