Skip to content

Commit

Permalink
enable stack minimization for all crash dumps (microsoft#705)
Browse files Browse the repository at this point in the history
This builds upon microsoft#591 to expand the stack minimization to crash reporting mechanisms.

Example (see microsoft#703 for an example without the new functionality):

```
$ onefuzz-agent local test-input /tmp/fuzz.exe /etc/passwd
{
  "crash_report": {
    "input_sha256": "a35b3ce1038750e9175a6dcd3f64c8d4e85720affb12cc11f5d0b6889274d06e",
    "executable": "/tmp/fuzz.exe",
    "crash_type": "SIGABRT",
    "crash_site": "0x7ffff7e0d18b in gsignal+0xcb (/usr/lib/x86_64-linux-gnu/libc-2.31.so+0x4618b)",
    "call_stack": [
      "#0 0x7ffff7e0d18b in gsignal+0xcb (/usr/lib/x86_64-linux-gnu/libc-2.31.so+0x4618b)",
      "#1 0x7ffff7dec859 in abort+0x12b (/usr/lib/x86_64-linux-gnu/libc-2.31.so+0x25859)",
      "#2 0x7ffff7e573ee in <unknown> (/usr/lib/x86_64-linux-gnu/libc-2.31.so+0x903ee)",
      "#3 0x7ffff7ef9b4a in __fortify_fail+0x2a (/usr/lib/x86_64-linux-gnu/libc-2.31.so+0x132b4a)",
      "#4 0x7ffff7ef83e6 in __chk_fail+0x16 (/usr/lib/x86_64-linux-gnu/libc-2.31.so+0x1313e6)",
      "#5 0x7ffff7ef7e09 in __strncpy_chk+0x19 (/usr/lib/x86_64-linux-gnu/libc-2.31.so+0x130e09)",
      "#6 0x400a54 in from_file+0xa4 (/tmp/fuzz.exe+0xa54)",
      "#7 0x7ffff7dee0b3 in __libc_start_main+0xf3 (/usr/lib/x86_64-linux-gnu/libc-2.31.so+0x270b3)",
      "#8 0x40077a in _start+0x2a (/tmp/fuzz.exe+0x77a)"
    ],
    "call_stack_sha256": "99625a7c103136e02910b65c7b60f1bbd1a7612242d6838da52d968369039409",
    "minimized_stack": [
      "__fortify_fail",
      "__chk_fail",
      "from_file"
    ],
    "minimized_stack_sha256": "237f13bfa384c6c2bc06369099373efbb36995a9ad00fd5469d354b5fc672ba1",
    "minimized_stack_function_names": [
      "__fortify_fail",
      "__chk_fail",
      "from_file"
    ],
    "minimized_stack_function_names_sha256": "237f13bfa384c6c2bc06369099373efbb36995a9ad00fd5469d354b5fc672ba1",
    "asan_log": "",
    "task_id": "00000000-0000-0000-0000-000000000000",
    "job_id": "00000000-0000-0000-0000-000000000000"
  }
}
$
```
  • Loading branch information
bmc-msft authored Mar 23, 2021
1 parent 8250007 commit b4e0d89
Show file tree
Hide file tree
Showing 133 changed files with 4,028 additions and 4,035 deletions.
1 change: 1 addition & 0 deletions src/agent/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 31 additions & 31 deletions src/agent/libclusterfuzz/data/parsed-traces/address_in_state.json
Original file line number Diff line number Diff line change
Expand Up @@ -602,37 +602,37 @@
}
],
"minimized_stack": [
"GetHandleVerifier+0x15a519c",
"GetHandleVerifier+0x159aec0",
"GetHandleVerifier+0x159d261",
"ovly_debug_event+0xf8af79",
"ovly_debug_event+0xf84d1c",
"ovly_debug_event+0xf84a42",
"ovly_debug_event+0xcebd4c",
"ovly_debug_event+0x2611204",
"ovly_debug_event+0x2635d94",
"ovly_debug_event+0x263110d",
"ovly_debug_event+0x26368fe",
"ovly_debug_event+0x2c6b3c7",
"ovly_debug_event+0x2cff4f7",
"ovly_debug_event+0x51ba6bf",
"ovly_debug_event+0x51b6166",
"ovly_debug_event+0x51b3e17",
"ChromeMain+0x28fe40",
"GetHandleVerifier+0xd5ac0",
"GetHandleVerifier+0xd5ac0",
"ChromeMain+0x4e66a9",
"ChromeMain+0x4e7c20",
"GetHandleVerifier+0xd7ff7",
"ChromeMain+0x4e54e6",
"GetHandleVerifier+0xd86ef",
"ChromeMain+0x4e4948",
"ovly_debug_event+0x54a91c7",
"ChromeMain+0x3e405f",
"ChromeMain+0x3e5e4c",
"ChromeMain+0x3e3c1b",
"ChromeMain+0x13f",
"MainDllLoader::Launch"
"#0 0x10c2323c in GetHandleVerifier+0x15a519c (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x1a9323c)",
"#1 0x10c18f60 in GetHandleVerifier+0x159aec0 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x1a88f60)",
"#2 0x10c1b301 in GetHandleVerifier+0x159d261 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x1a8b301)",
"#3 0x12055649 in ovly_debug_event+0xf8af79 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x2ec5649)",
"#4 0x1204f3ec in ovly_debug_event+0xf84d1c (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x2ebf3ec)",
"#5 0x1204f112 in ovly_debug_event+0xf84a42 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x2ebf112)",
"#6 0x11db641c in ovly_debug_event+0xcebd4c (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x2c2641c)",
"#7 0x136db8d4 in ovly_debug_event+0x2611204 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x454b8d4)",
"#8 0x13700464 in ovly_debug_event+0x2635d94 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x4570464)",
"#9 0x136fb7dd in ovly_debug_event+0x263110d (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x456b7dd)",
"#10 0x13700fce in ovly_debug_event+0x26368fe (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x4570fce)",
"#11 0x13d35a97 in ovly_debug_event+0x2c6b3c7 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x4ba5a97)",
"#12 0x13dc9bc7 in ovly_debug_event+0x2cff4f7 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x4c39bc7)",
"#14 0x16284d8f in ovly_debug_event+0x51ba6bf (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x70f4d8f)",
"#15 0x16280836 in ovly_debug_event+0x51b6166 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x70f0836)",
"#16 0x1627e4e7 in ovly_debug_event+0x51b3e17 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x70ee4e7)",
"#17 0xf420e40 in ChromeMain+0x28fe40 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x290e40)",
"#19 0xf753b60 in GetHandleVerifier+0xd5ac0 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x5c3b60)",
"#23 0xf753b60 in GetHandleVerifier+0xd5ac0 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x5c3b60)",
"#24 0xf6776a9 in ChromeMain+0x4e66a9 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x4e76a9)",
"#25 0xf678c20 in ChromeMain+0x4e7c20 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x4e8c20)",
"#26 0xf756097 in GetHandleVerifier+0xd7ff7 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x5c6097)",
"#27 0xf6764e6 in ChromeMain+0x4e54e6 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x4e64e6)",
"#28 0xf75678f in GetHandleVerifier+0xd86ef (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x5c678f)",
"#29 0xf675948 in ChromeMain+0x4e4948 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x4e5948)",
"#30 0x16573897 in ovly_debug_event+0x54a91c7 (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x73e3897)",
"#31 0xf57505f in ChromeMain+0x3e405f (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x3e505f)",
"#32 0xf576e4c in ChromeMain+0x3e5e4c (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x3e6e4c)",
"#33 0xf574c1b in ChromeMain+0x3e3c1b (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x3e4c1b)",
"#34 0xf19113f in ChromeMain+0x13f (C:\\clusterfuzz\\bot\\builds\\chrome-test-builds_media_win32-release\\revisions\\asan-win32-release-335593\\chrome_child.dll+0x113f)",
"#35 0x11d976c in MainDllLoader::Launch chrome/app/client_util.cc:252"
],
"minimized_stack_function_names": [
"GetHandleVerifier+0x15a519c",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@
}
],
"full_stack_names": [
"_JavaVM::AttachCurrentThread(_JNIEnv**, void*)",
"_JavaVM::AttachCurrentThread",
"javaAttachThread",
"android::AndroidRuntime::javaThreadShell(void*)",
"thread_data_t::trampoline(thread_data_t const*)",
"__asan::AsanThread::ThreadStart(unsigned long, __sanitizer::atomic_uintptr_t*)",
"asan_thread_start(void*)",
"__pthread_start(void*)",
"android::AndroidRuntime::javaThreadShell",
"thread_data_t::trampoline",
"__asan::AsanThread::ThreadStart",
"asan_thread_start",
"__pthread_start",
"__start_thread",
"__bionic_clone"
],
Expand Down Expand Up @@ -158,13 +158,13 @@
}
],
"minimized_stack": [
"_JavaVM::AttachCurrentThread(_JNIEnv**, void*)",
"javaAttachThread",
"android::AndroidRuntime::javaThreadShell(void*)",
"thread_data_t::trampoline(thread_data_t const*)",
"__pthread_start(void*)",
"__start_thread",
"__bionic_clone"
"#0 0xb2011bf4 in _JavaVM::AttachCurrentThread(_JNIEnv**, void*) libnativehelper/include/nativehelper/jni.h:1060",
"#1 0xb2011bf4 in javaAttachThread frameworks/base/core/jni/AndroidRuntime.cpp:1131",
"#2 0xb2011bf4 in android::AndroidRuntime::javaThreadShell(void*) frameworks/base/core/jni/AndroidRuntime.cpp:1169",
"#3 0xb1e188a9 in thread_data_t::trampoline(thread_data_t const*) system/core/libutils/Threads.cpp:99:16",
"#6 0xb1ec8404 in __pthread_start(void*) bionic/libc/bionic/pthread_create.cpp:198:18",
"#7 0xb1e73610 in __start_thread bionic/libc/bionic/clone.cpp:41:16",
"#8 0xb1e713c6 in __bionic_clone bionic/libc/arch-x86/bionic/__bionic_clone.S:54"
],
"minimized_stack_function_names": [
"_JavaVM::AttachCurrentThread",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@
}
],
"full_stack_names": [
"_JavaVM::AttachCurrentThread(_JNIEnv**, void*)",
"_JavaVM::AttachCurrentThread",
"javaAttachThread",
"android::AndroidRuntime::javaThreadShell(void*)",
"thread_data_t::trampoline(thread_data_t const*)",
"__asan::AsanThread::ThreadStart(unsigned long, __sanitizer::atomic_uintptr_t*)",
"asan_thread_start(void*)",
"__pthread_start(void*)",
"android::AndroidRuntime::javaThreadShell",
"thread_data_t::trampoline",
"__asan::AsanThread::ThreadStart",
"asan_thread_start",
"__pthread_start",
"__start_thread",
"__bionic_clone"
],
Expand Down Expand Up @@ -158,13 +158,13 @@
}
],
"minimized_stack": [
"_JavaVM::AttachCurrentThread(_JNIEnv**, void*)",
"javaAttachThread",
"android::AndroidRuntime::javaThreadShell(void*)",
"thread_data_t::trampoline(thread_data_t const*)",
"__pthread_start(void*)",
"__start_thread",
"__bionic_clone"
"#0 0xb2011bf4 in _JavaVM::AttachCurrentThread(_JNIEnv**, void*) libnativehelper/include/nativehelper/jni.h:1060",
"#1 0xb2011bf4 in javaAttachThread frameworks/base/core/jni/AndroidRuntime.cpp:1131",
"#2 0xb2011bf4 in android::AndroidRuntime::javaThreadShell(void*) frameworks/base/core/jni/AndroidRuntime.cpp:1169",
"#3 0xb1e188a9 in thread_data_t::trampoline(thread_data_t const*) system/core/libutils/Threads.cpp:99:16",
"#6 0xb1ec8404 in __pthread_start(void*) bionic/libc/bionic/pthread_create.cpp:198:18",
"#7 0xb1e73610 in __start_thread bionic/libc/bionic/clone.cpp:41:16",
"#8 0xb1e713c6 in __bionic_clone bionic/libc/arch-x86/bionic/__bionic_clone.S:54"
],
"minimized_stack_function_names": [
"_JavaVM::AttachCurrentThread",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,5 @@
"address": 2936234631,
"module_path": "strlen"
}
],
"minimized_stack_details": [
{
"line": "#0 0xaf036287 in strlen",
"address": 2936234631,
"module_path": "strlen"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@
}
],
"full_stack_names": [
"_JavaVM::AttachCurrentThread(_JNIEnv**, void*)",
"_JavaVM::AttachCurrentThread",
"javaAttachThread",
"android::AndroidRuntime::javaThreadShell(void*)",
"thread_data_t::trampoline(thread_data_t const*)",
"__asan::AsanThread::ThreadStart(unsigned long, __sanitizer::atomic_uintptr_t*)",
"asan_thread_start(void*)",
"__pthread_start(void*)",
"android::AndroidRuntime::javaThreadShell",
"thread_data_t::trampoline",
"__asan::AsanThread::ThreadStart",
"asan_thread_start",
"__pthread_start",
"__start_thread",
"__bionic_clone"
],
Expand Down Expand Up @@ -158,13 +158,13 @@
}
],
"minimized_stack": [
"_JavaVM::AttachCurrentThread(_JNIEnv**, void*)",
"javaAttachThread",
"android::AndroidRuntime::javaThreadShell(void*)",
"thread_data_t::trampoline(thread_data_t const*)",
"__pthread_start(void*)",
"__start_thread",
"__bionic_clone"
"#0 0xa843fbf4 in _JavaVM::AttachCurrentThread(_JNIEnv**, void*) libnativehelper/include/nativehelper/jni.h:1060",
"#1 0xa843fbf4 in javaAttachThread frameworks/base/core/jni/AndroidRuntime.cpp:1131",
"#2 0xa843fbf4 in android::AndroidRuntime::javaThreadShell(void*) frameworks/base/core/jni/AndroidRuntime.cpp:1169",
"#3 0xa83bc8a9 in thread_data_t::trampoline(thread_data_t const*) system/core/libutils/Threads.cpp:99:16",
"#6 0xa9a7f404 in __pthread_start(void*) bionic/libc/bionic/pthread_create.cpp:198:18",
"#7 0xa9a2a610 in __start_thread bionic/libc/bionic/clone.cpp:41:16",
"#8 0xa9a283c6 in __bionic_clone bionic/libc/arch-x86/bionic/__bionic_clone.S:54"
],
"minimized_stack_function_names": [
"_JavaVM::AttachCurrentThread",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@
}
],
"full_stack_names": [
"_JavaVM::AttachCurrentThread(_JNIEnv**, void*)",
"_JavaVM::AttachCurrentThread",
"javaAttachThread",
"android::AndroidRuntime::javaThreadShell(void*)",
"thread_data_t::trampoline(thread_data_t const*)",
"__asan::AsanThread::ThreadStart(unsigned long, __sanitizer::atomic_uintptr_t*)",
"asan_thread_start(void*)",
"__pthread_start(void*)",
"android::AndroidRuntime::javaThreadShell",
"thread_data_t::trampoline",
"__asan::AsanThread::ThreadStart",
"asan_thread_start",
"__pthread_start",
"__start_thread",
"__bionic_clone"
],
Expand Down Expand Up @@ -158,13 +158,13 @@
}
],
"minimized_stack": [
"_JavaVM::AttachCurrentThread(_JNIEnv**, void*)",
"javaAttachThread",
"android::AndroidRuntime::javaThreadShell(void*)",
"thread_data_t::trampoline(thread_data_t const*)",
"__pthread_start(void*)",
"__start_thread",
"__bionic_clone"
"#0 0xa843fbf4 in _JavaVM::AttachCurrentThread(_JNIEnv**, void*) libnativehelper/include/nativehelper/jni.h:1060",
"#1 0xa843fbf4 in javaAttachThread frameworks/base/core/jni/AndroidRuntime.cpp:1131",
"#2 0xa843fbf4 in android::AndroidRuntime::javaThreadShell(void*) frameworks/base/core/jni/AndroidRuntime.cpp:1169",
"#3 0xa83bc8a9 in thread_data_t::trampoline(thread_data_t const*) system/core/libutils/Threads.cpp:99:16",
"#6 0xa9a7f404 in __pthread_start(void*) bionic/libc/bionic/pthread_create.cpp:198:18",
"#7 0xa9a2a610 in __start_thread bionic/libc/bionic/clone.cpp:41:16",
"#8 0xa9a283c6 in __bionic_clone bionic/libc/arch-x86/bionic/__bionic_clone.S:54"
],
"minimized_stack_function_names": [
"_JavaVM::AttachCurrentThread",
Expand Down
Loading

0 comments on commit b4e0d89

Please sign in to comment.