Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Parse .NET exception stacks in crash output #2988

Merged
merged 1 commit into from
Apr 17, 2023
Merged

Conversation

Porges
Copy link
Member

@Porges Porges commented Apr 6, 2023

Closes #538.

Attempt to parse out .NET exception stack traces when we see them in crash log output.

  1. Summaries: when we detect a .NET stack trace in the output (given by lines starting with the literal string " at "), locate the exception messages and use them as the summary.
  2. Call stacks: also add the .NET stack frames (for the outer exception only) to the "top" of the call stack. This means we generate a call stack that is not entirely true, since there is additional ASAN stuff in between which is not really on the stack at the time the exception was generated, but it should still be more useful (and help with crash de-duplication).
    • A proper fix here might be that we allow multiple stack traces to be added to a crash report; this way the .NET trace would be distinct from the native/ASAN one (and we could then also provide the inner .NET stack traces as well).
  3. I found that there is some additional information that can be present in ASAN crash output (BuildId) which was breaking the ASAN parsing code. I've extended it to fix this and added a few test cases.
  4. If input tester failed due to not finding the executable, no good message was printed. I've improved this slightly, but not much.

@codecov-commenter
Copy link

codecov-commenter commented Apr 6, 2023

Codecov Report

Merging #2988 (00f312c) into main (2b1f400) will increase coverage by 0.27%.
The diff coverage is 83.65%.

@@            Coverage Diff             @@
##             main    #2988      +/-   ##
==========================================
+ Coverage   29.10%   29.37%   +0.27%     
==========================================
  Files         304      305       +1     
  Lines       36343    36489     +146     
==========================================
+ Hits        10576    10720     +144     
- Misses      25767    25769       +2     
Impacted Files Coverage Δ
src/agent/onefuzz/src/input_tester.rs 0.00% <0.00%> (ø)
src/agent/onefuzz/src/libfuzzer.rs 71.65% <0.00%> (-0.08%) ⬇️
src/agent/stacktrace-parser/src/asan.rs 100.00% <100.00%> (+0.44%) ⬆️
src/agent/stacktrace-parser/src/dotnet.rs 100.00% <100.00%> (ø)
src/agent/stacktrace-parser/src/lib.rs 88.94% <100.00%> (+0.29%) ⬆️

... and 17 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Porges Porges force-pushed the dotnet-exception-parsing branch from 00f312c to 7b63e05 Compare April 6, 2023 02:23
@Porges Porges requested review from chkeita and tevoinea April 10, 2023 22:27
@Porges Porges force-pushed the dotnet-exception-parsing branch from 7b63e05 to 97f8013 Compare April 11, 2023 22:28
@Porges Porges force-pushed the dotnet-exception-parsing branch from 97f8013 to e3e38cc Compare April 17, 2023 20:30
@Porges Porges merged commit 256f261 into main Apr 17, 2023
@Porges Porges deleted the dotnet-exception-parsing branch April 17, 2023 22:50
@Porges Porges mentioned this pull request Apr 18, 2023
4 tasks
@AdamL-Microsoft AdamL-Microsoft mentioned this pull request May 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libfuzzer-dotnet crash reports are not useful
3 participants