-
Notifications
You must be signed in to change notification settings - Fork 596
Fix unknown ubsan crash types #5133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+89
−10
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5968274
Fix unknown ubsan crash type
ViniciustCosta 89e81be
Fix lint
ViniciustCosta 5f0573b
Fix correct ubsan crash types
ViniciustCosta 9beff28
Add unit tests
ViniciustCosta d9cb34c
Add test data
ViniciustCosta c717782
Change security flag
ViniciustCosta 496e0d4
Up golang step
ViniciustCosta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...ests/core/crash_analysis/stack_parsing/stack_analyzer_data/ubsan_assumption_violation.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /src/project/include/test++/impl/f.inl:1234:2: runtime error: assumption is violated during execution | ||
| #0 0x5d4761e1112b in project::v3::impl::func_ex::func::f_key() /src/project/include/test++/impl/f.inl:1234:4 | ||
| #1 0x5d4761e0e123 in project::v3::impl::func_ex::func::f_header() /src/project/include/test++/impl/f.inl:1111:5 | ||
| #2 0x5d4761e0caab in project::v3::impl::func_ex::func::f_document() /src/project/include/test++/impl/f.inl:1111:44 | ||
| #3 0x5d4761e0bf3c in project::v3::impl::func_ex::func::func(project::v3::impl::reader_interface&&) /src/project/include/test++/impl/f.inl:4321:5 | ||
| #4 0x5d4761e09c42 in do_func /src/project/include/test++/impl/f.inl:1234:10 | ||
| #5 0x5d4761e09c42 in project::v3::ex::func(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_string_view<char, std::__1::char_traits<char>>) /src/project/include/test++/impl/f.inl:1234:10 | ||
| #6 0x5d4761e099e3 in LLVMFuzzerTestOneInput /src/project/fuzzing/test_fuzzer.cpp:20:33 | ||
| #7 0x5d4761d6087d in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:619:13 | ||
| #8 0x5d4761d4b602 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:329:6 | ||
| #9 0x5d4761d514d0 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:865:9 | ||
| #10 0x5d4761d7cff2 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10 | ||
| #11 0x7b4fad7ea1c9 in __libc_start_call_main sysdeps/nptl/libc_start_call_main.h:58:16 | ||
| #12 0x7b4fad7ea28a in __libc_start_main csu/libc-start.c:360:3 | ||
| #13 0x5d4761d446e4 in _start | ||
|
|
||
| SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /src/project/include/test++/impl/f.inl:1234:4 |
24 changes: 24 additions & 0 deletions
24
...ts/core/crash_analysis/stack_parsing/stack_analyzer_data/ubsan_upcast_of_null_pointer.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| src/test.cpp:777:44: runtime error: upcast of null pointer of type 'Type::Exp' | ||
| #0 0x56f7022adc48 in Test::Ex::operator()(Test::List*) /src/lib/src/test.cpp:777:27 | ||
| #1 0x56f7022ca6a6 in Test::Ex::operator()(Test::Function_Call*) /src/lib/src/test.cpp:1234:22 | ||
| #2 0x56f7022ad260 in Test::Ex::operator()(Test::List*) /src/lib/src/test.cpp:777:27 | ||
| #3 0x56f70230f0cb in Test::Expemple::operator()(Test::Declaration*) /src/lib/src/exemple.cpp:123:31 | ||
| #4 0x56f702306083 in Test::Exemple::aaaaa(Test::BBBB*) /src/lib/src/exemple.cpp:123:32 | ||
| #5 0x56f7023057af in Test::Exemple::operator()(Test::BBBB*) /src/lib/src/exemple.cpp:321:11 | ||
| #6 0x56f702308297 in Test::Exemple::operator()(Test::SSSS*) /src/lib/src/exemple.cpp:432:27 | ||
| #7 0x56f702306083 in Test::Exemple::aaaaa(Test::BBBB*) /src/lib/src/exemple.cpp:123:32 | ||
| #8 0x56f7023057af in Test::Exemple::operator()(Test::BBBB*) /src/lib/src/exemple.cpp:321:11 | ||
| #9 0x56f702115ffa in Test::Context::compile() /src/lib/src/context.cpp:653:12 | ||
| #10 0x56f702115249 in Test::Data_Context::parse() /src/lib/src/context.cpp:624:12 | ||
| #11 0x56f70204c1c6 in Test::test_block(T_Comp*) /src/lib/src/test_context.cpp:182:31 | ||
| #12 0x56f70204bfbe in test_parse /src/lib/src/test_context.cpp:436:22 | ||
| #13 0x56f70204bc67 in test_context(Test_Context*, Test::Context*) /src/lib/src/test_context.cpp:319:7 | ||
| #14 0x56f70204a5ed in LLVMFuzzerTestOneInput /src/test_fuzzer.cc:22:1 | ||
| #15 0x56f701fa18ed in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:619:13 | ||
| #16 0x56f701f8c662 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:329:6 | ||
| #17 0x56f701f92530 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:865:9 | ||
| #18 0x56f701fbe062 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10 | ||
| #19 0x79e011082082 in __libc_start_main /build/glibc-B3wQXB/glibc-2.31/csu/libc-start.c:308:16 | ||
| #20 0x56f701f8574d in _start | ||
|
|
||
| SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/test.cpp:777:18 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -615,6 +615,17 @@ def parse(self, stacktrace: str) -> CrashInfo: | |
| new_type='Bad-cast', | ||
| new_frame_count=0) | ||
|
|
||
| # Golang stacktraces. Needs to be done before the other UBSan crash as | ||
| # it uses the same pattern of "runtime error:". | ||
| if state.is_golang: | ||
| for golang_crash_regex, golang_crash_type in GOLANG_CRASH_TYPES_MAP: | ||
| if self.update_state_on_match( | ||
| golang_crash_regex, line, state, new_type=golang_crash_type): | ||
| state.found_golang_crash = True | ||
| state.crash_state = '' | ||
| state.frame_count = 0 | ||
| continue | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hope this doesn't break anything. |
||
| # Other UndefinedBehavior Sanitizer crash. | ||
| ubsan_runtime_match = UBSAN_RUNTIME_ERROR_REGEX.match(line) | ||
| if ubsan_runtime_match and not state.crash_type and self.include_ubsan: | ||
|
|
@@ -642,16 +653,6 @@ def parse(self, stacktrace: str) -> CrashInfo: | |
| reset=True, | ||
| address_from_group=2) | ||
|
|
||
| # Golang stacktraces. | ||
| if state.is_golang: | ||
| for golang_crash_regex, golang_crash_type in GOLANG_CRASH_TYPES_MAP: | ||
| if self.update_state_on_match( | ||
| golang_crash_regex, line, state, new_type=golang_crash_type): | ||
| state.found_golang_crash = True | ||
| state.crash_state = '' | ||
| state.frame_count = 0 | ||
| continue | ||
|
|
||
| # Python stacktraces. | ||
| if state.is_python: | ||
| for python_crash_regex, python_crash_type in PYTHON_CRASH_TYPES_MAP: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.