Skip to content

Commit 38e4f10

Browse files
authored
Fix detection of generic segfaults in V8 (#4688)
On non-sanitizer builds we just get the output `Received signal 11 <unknown> 000000000000` (see https://crbug.com/388616198). This adjusts the regular expression for generic segfaults to detect this.
1 parent 3bbcf12 commit 38e4f10

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[Environment] ASAN_OPTIONS=alloc_dealloc_mismatch=0:allocator_may_return_null=1:allow_user_segv_handler=0:check_malloc_usable_size=0:detect_leaks=0:detect_odr_violation=0:detect_stack_use_after_return=1:fast_unwind_on_fatal=1:handle_abort=1:handle_segv=1:handle_sigbus=1:handle_sigfpe=1:handle_sigill=1:print_scariness=1:print_summary=1:print_suppressions=0:redzone=128:strict_memcmp=0:symbolize=0:use_sigaltstack=1
2+
[Command line] /mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/d8 --fuzzing --fuzzing --expose-gc --allow-natives-syntax --debug-code --disable-abortjs --omit-quit --invoke-weak-callbacks --enable-slow-asserts --verify-heap --fuzzing --fuzzing --expose-gc --allow-natives-syntax --debug-code --harmony --disable-abortjs --omit-quit --invoke-weak-callbacks --enable-slow-asserts --verify-heap --no-liftoff --no-enable-sse4_2 /mnt/scratch0/clusterfuzz/bot/inputs/disk/clusterfuzz-testcase-4798270517739520.js
3+
4+
+----------------------------------------Debug Build Stacktrace----------------------------------------+
5+
Calling export
6+
Received signal 11 <unknown> 000000000000
7+
8+
==== C stack trace ===============================
9+
10+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/libv8_libbase.so(_ZN2v84base5debug10StackTraceC1Ev+0x1f)[0xf29b845f]
11+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/libv8_libbase.so(+0x49376)[0xf29b8376]
12+
linux-gate.so.1(__kernel_rt_sigreturn+0x0)[0xf7f80560]
13+
[0x3c13f38d]
14+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/libv8.so(+0x1bb7325)[0xf457a325]
15+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/libv8.so(+0x2128b41)[0xf4aebb41]
16+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/libv8.so(+0x184c71d)[0xf420f71d]
17+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/libv8.so(+0x1844c79)[0xf4207c79]
18+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/libv8.so(+0x1844aa1)[0xf4207aa1]
19+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/libv8.so(+0x287aa81)[0xf523da81]
20+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/libv8.so(_ZN2v88internal9Execution10CallScriptEPNS0_7IsolateENS0_12DirectHandleINS0_10JSFunctionEEENS4_INS0_6ObjectEEES8_+0x36a)[0xf523f06a]
21+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/libv8.so(_ZN2v86Script3RunENS_5LocalINS_7ContextEEENS1_INS_4DataEEE+0x603)[0xf4d43ca3]
22+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/libv8.so(_ZN2v86Script3RunENS_5LocalINS_7ContextEEE+0x2c)[0xf4d4368c]
23+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/d8(_ZN2v85Shell13ExecuteStringEPNS_7IsolateENS_5LocalINS_6StringEEES5_NS0_16ReportExceptionsEPNS_6GlobalINS_5ValueEEE+0x5a2)[0x566754d2]
24+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/d8(_ZN2v811SourceGroup7ExecuteEPNS_7IsolateE+0x2bb)[0x5669421b]
25+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/d8(_ZN2v85Shell14RunMainIsolateEPNS_7IsolateEb+0x144)[0x56699374]
26+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/d8(_ZN2v85Shell7RunMainEPNS_7IsolateEb+0x113)[0x56698f43]
27+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/d8(_ZN2v85Shell4MainEiPPc+0x113a)[0x5669af3a]
28+
/mnt/scratch0/clusterfuzz/bot/builds/v8-asan_linux32-debug_0536c6cee91964742660111d92ce7f5517350a4a/revisions/d8(main+0x1f)[0x5669b4af]
29+
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0xf2211ed5]
30+
[end of stack trace]

src/clusterfuzz/_internal/tests/core/crash_analysis/stack_parsing/stack_analyzer_test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,6 +1266,21 @@ def test_v8_csa_dcheck(self):
12661266
expected_state, expected_stacktrace,
12671267
expected_security_flag)
12681268

1269+
def test_v8_generic_segfault(self):
1270+
"""Test a generic segfault from V8 (see https://crbug.com/388616198).
1271+
Set a mock fuzz target name to be used as the state instead of 'NULL'."""
1272+
os.environ['FUZZ_TARGET'] = 'mock-fuzz-target'
1273+
data = self._read_test_data('v8_generic_segfault.txt')
1274+
expected_type = 'Null-dereference'
1275+
expected_address = '0x000000000000'
1276+
expected_state = 'mock-fuzz-target\n'
1277+
expected_stacktrace = data
1278+
expected_security_flag = False
1279+
1280+
self._validate_get_crash_data(data, expected_type, expected_address,
1281+
expected_state, expected_stacktrace,
1282+
expected_security_flag)
1283+
12691284
def test_generic_segv(self):
12701285
"""Test a SEGV caught by a generic signal handler."""
12711286
data = self._read_test_data('generic_segv.txt')

src/clusterfuzz/stacktraces/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
FUZZER_EXIT_REGEX = re.compile(r'^\s*(?:#0|#1) 0x.*(?:fuzzer|fuzz/|/fuzz)',
123123
re.IGNORECASE)
124124
GENERIC_SEGV_HANDLER_REGEX = re.compile(
125-
'Received signal 11 SEGV_[A-Z]+ ([0-9a-f]*)')
125+
'Received signal 11 (?:SEGV_[A-Z]+|<unknown>) ([0-9a-f]*)')
126126
GOOGLE_CHECK_FAILURE_REGEX = re.compile(GOOGLE_LOG_FATAL_PREFIX +
127127
r'\s*Check failed[:]\s*(.*)')
128128
GOOGLE_LOG_FATAL_REGEX = re.compile(GOOGLE_LOG_FATAL_PREFIX + r'\s*(.*)')

0 commit comments

Comments
 (0)