Commit a4d17470 authored by Samuel Groß's avatar Samuel Groß Committed by V8 LUCI CQ

Reland "[sandbox] Also enable the sandbox outside of Chromium builds"

This is a reland of commit 5b9401dd

Now also skip tests that require large amounts of virtual address space
if tsan is enabled as tsan may cause V8 to create a smaller sandbox
which is then unable to allocate the required amount of memory.

Original change's description:
> [sandbox] Also enable the sandbox outside of Chromium builds
>
> Drive-by: include the right header in sandboxed-pointer-inl.h and fix
> missing sandbox initialization in generate-bytecode-expectations.cc.
>
> Bug: v8:10391
> Change-Id: Ic39ba04b7c98eaa58ea3943189c23b297f581f5a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3630082
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Samuel Groß <saelo@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#81216}

Bug: v8:10391
Change-Id: I141080fdf61a77ef48b22e353e3cfbc1ff816e5a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3716474Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81277}
parent f260308d
...@@ -501,8 +501,7 @@ if (v8_enable_sandbox == "") { ...@@ -501,8 +501,7 @@ if (v8_enable_sandbox == "") {
# once that is enabled everywhere by default. # once that is enabled everywhere by default.
# TODO(chromium:1325784) the sandbox is not currently supported in Chromium # TODO(chromium:1325784) the sandbox is not currently supported in Chromium
# on Fuchsia. # on Fuchsia.
v8_enable_sandbox = v8_enable_sandbox = v8_enable_pointer_compression_shared_cage &&
build_with_chromium && v8_enable_pointer_compression_shared_cage &&
v8_enable_external_code_space && target_os != "fuchsia" v8_enable_external_code_space && target_os != "fuchsia"
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define V8_SANDBOX_SANDBOXED_POINTER_INL_H_ #define V8_SANDBOX_SANDBOXED_POINTER_INL_H_
#include "include/v8-internal.h" #include "include/v8-internal.h"
#include "src/common/ptr-compr.h" #include "src/common/ptr-compr-inl.h"
#include "src/execution/isolate.h" #include "src/execution/isolate.h"
#include "src/sandbox/sandboxed-pointer.h" #include "src/sandbox/sandboxed-pointer.h"
......
...@@ -700,6 +700,11 @@ ...@@ -700,6 +700,11 @@
# BUG(v8:12920): Breaks on TSAN. # BUG(v8:12920): Breaks on TSAN.
'regress/regress-crbug-620253': [SKIP], 'regress/regress-crbug-620253': [SKIP],
# Skip tests that require a large amount of virtual address space (inside the
# sandbox if that is enabled) if tsan is enabled.
'wasm/many-memories': [SKIP],
'regress/wasm/regress-1010272': [SKIP],
}], # 'tsan == True' }], # 'tsan == True'
############################################################################## ##############################################################################
......
...@@ -347,6 +347,11 @@ V8InitializationScope::V8InitializationScope(const char* exec_path) ...@@ -347,6 +347,11 @@ V8InitializationScope::V8InitializationScope(const char* exec_path)
v8::V8::InitializeICUDefaultLocation(exec_path); v8::V8::InitializeICUDefaultLocation(exec_path);
v8::V8::InitializeExternalStartupData(exec_path); v8::V8::InitializeExternalStartupData(exec_path);
v8::V8::InitializePlatform(platform_.get()); v8::V8::InitializePlatform(platform_.get());
#ifdef V8_ENABLE_SANDBOX
if (!v8::V8::InitializeSandbox()) {
FATAL("Could not initialize the sandbox");
}
#endif
v8::V8::Initialize(); v8::V8::Initialize();
v8::Isolate::CreateParams create_params; v8::Isolate::CreateParams create_params;
......
...@@ -153,4 +153,11 @@ ...@@ -153,4 +153,11 @@
'simd*': [SKIP], 'simd*': [SKIP],
}], # no_simd_hardware == True }], # no_simd_hardware == True
##############################################################################
# Skip tests that require a large amount of virtual address space (inside the
# sandbox if that is enabled) if tsan is enabled.
['tsan == True', {
'memory_copy': [SKIP],
}],
] ]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment