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

Defer coverage breakpoints #2832

Merged
merged 17 commits into from
Feb 14, 2023

Conversation

ranweiler
Copy link
Member

For each loaded module, defer setting coverage breakpoints until exit from certain known initialization functions (when present). Crucially, this lets us avoid breaking Address Sanitizer interceptor initialization, which will otherwise divergently fail execution by raising its own debug break exception.

With this PR, neither OneFuzz itself nor locally-debugging end users will need to use an allowlist to exclude ASan-intercepted functions from coverage recording.

This PR also fixes a bug in breakpoint setting, which would would prevent setting breakpoints whose offset collided with any other breakpoint's offset (ignoring base module). This would manifest in false negative coverage counts for colliding breakpoints.

@codecov-commenter
Copy link

codecov-commenter commented Feb 14, 2023

Codecov Report

Merging #2832 (c69edb9) into main (0c58a59) will decrease coverage by 0.06%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #2832      +/-   ##
==========================================
- Coverage   29.93%   29.87%   -0.06%     
==========================================
  Files         324      324              
  Lines       38994    39062      +68     
==========================================
  Hits        11671    11671              
- Misses      27323    27391      +68     
Impacted Files Coverage Δ
src/agent/coverage/src/record/windows.rs 0.00% <0.00%> (ø)
src/agent/debuggable-module/src/debuginfo.rs 0.00% <0.00%> (ø)

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

@ranweiler ranweiler merged commit 21374b3 into microsoft:main Feb 14, 2023
@ranweiler ranweiler deleted the defer-coverage-breakpoints branch February 14, 2023 18:52
@mgreisen mgreisen mentioned this pull request Mar 3, 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.

3 participants