-
Notifications
You must be signed in to change notification settings - Fork 390
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
Save corpus continuously while fuzzing #1047
Conversation
ac34896
to
b849924
Compare
|
||
-- save to corpus in the background while tests are running | ||
-- returns a channel that gets sent () when the process is done | ||
runCorpusSaver :: Env -> IO (Chan ()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use MVar instead of Chan here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to wait for MVar to be written to without doing an infinite loop? I used a Chan because you can wait for it using readChan
instead of getting locked in a while (thead is not finished)
loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it should be possible
nworkers :: Int | ||
nworkers = fromIntegral $ fromMaybe 1 env.cfg.campaignConf.workers | ||
|
||
loop !dir !chan !workersAlive = when (workersAlive > 0) $ do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have some logic duplication here but we can refactor this with the subscribe system we talked about
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate PR for that subscribe system? I could add it to this PR if you want
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do it in this PR then
b849924
to
0bd1450
Compare
This PR adds a process which continuously saves corpus as new coverage/reproducers are discovered (#1045). This makes echidna crashes less inconvenient, and shortens the corpus saving time at the end.
It also makes the NewCoverage event include the list of transactions as part of the event, since this is needed when saving corpus info.