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

Coverage task does not maintain internal invariant on error #1031

Closed
ranweiler opened this issue Jun 30, 2021 · 0 comments · Fixed by #1033
Closed

Coverage task does not maintain internal invariant on error #1031

ranweiler opened this issue Jun 30, 2021 · 0 comments · Fixed by #1033
Assignees
Labels
bug Something isn't working

Comments

@ranweiler
Copy link
Member

OneFuzz: 2.23.1
OS: Windows

In the coverage task, the (blocking, non-async) recording itself occurs on a new OS thread, via spawn_blocking().

To avoid needing to use sync primitives, we just Option::take() the TaskContext's ModuleCache, and pass it to the worker thread, restoring it on completion. However, if recording fails, we now retry some number of times, as of #978. But recording can fail while the worker thread owns the ModuleCache, which it will drop on its return with Err. We will then early-exit TaskContext::record_impl(), without restoring the Option<ModuleCache>, which can result in a panic.

Switch to using threadsafe smart pointers, instead.

@ranweiler ranweiler added the bug Something isn't working label Jun 30, 2021
@ranweiler ranweiler self-assigned this Jun 30, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant