v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
abort-mode.h
Go to the documentation of this file.
1// Copyright 2023 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_BASE_ABORT_MODE_H_
6#define V8_BASE_ABORT_MODE_H_
7
8// This file describes the way aborts are handled in OS::Abort and the way
9// DCHECKs are working.
10
12
13namespace v8 {
14namespace base {
15
16enum class AbortMode {
17 // Used for example for fuzzing when controlled crashes are harmless, such
18 // as for example for the sandbox. With this:
19 // - DCHECKs are turned into No-ops and as such V8 is allowed to continue
20 // execution. This way, the fuzzer can progress past them.
21 // - CHECKs, FATAL, etc. are turned into regular exits, which allows fuzzers
22 // to ignore them, as they are harmless in this context.
23 // - The exit code will either be zero (signaling success) or non-zero
24 // (signaling failure). The former is for example used in tests in which a
25 // controlled crash counts as success (for example in sandbox regression
26 // tests), the latter is typically used for fuzzing where samples that exit
27 // in this way should be discarded and not mutated further.
30
31 // DCHECKs, CHECKs, etc. use IMMEDIATE_CRASH() to signal abnormal program
32 // termination. See the --hard-abort flag for more details.
34
35 // CHECKs, DCHECKs, etc. use abort() to signal abnormal program termination.
37};
38
40
45
50
51} // namespace base
52} // namespace v8
53
54#endif // V8_BASE_ABORT_MODE_H_
#define V8_BASE_EXPORT
Definition base-export.h:26
@ kExitWithFailureAndIgnoreDcheckFailures
@ kExitWithSuccessAndIgnoreDcheckFailures
AbortMode g_abort_mode
Definition abort-mode.cc:10
V8_INLINE bool DcheckFailuresAreIgnored()
Definition abort-mode.h:46
V8_INLINE bool ControlledCrashesAreHarmless()
Definition abort-mode.h:41
#define V8_INLINE
Definition v8config.h:500