Skip to content
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

initial fuzzing harness #153

Merged
merged 13 commits into from
Apr 24, 2020
Merged

initial fuzzing harness #153

merged 13 commits into from
Apr 24, 2020

Conversation

willscott
Copy link
Contributor

@willscott willscott commented Mar 27, 2020

  • allow dynamic specification of harnessed datastore implementation
  • include closing / re-opening of datastore in the script

@willscott willscott marked this pull request as ready for review April 6, 2020 18:32
@willscott
Copy link
Contributor Author

@ribasushi if you have cycles, maybe you can take a first pass at review and see if this structure looks reasonable for a datastore fuzzing harness

Copy link

@ribasushi ribasushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty excellently written! The instructions worked out of the box ( I made one suggestion to add, no edits )

I do not know the tooling too well, but from what I was able to read + running this locally: LGTM

```golang
go-fuzz-build
go-fuzz
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a section at the very end:

If you have not installed the fuzzing tools yet, execute:

go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build

fuzz/fuzzer.go Outdated

// Fuzz is a go-fuzzer compatible input point for replaying
// data (interpreted as a script of commands)
// to kown ipfs datastore implementations

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// to kown ipfs datastore implementations
// to known ipfs datastore implementations

go.mod Outdated
github.com/google/uuid v1.1.1
github.com/ipfs/go-ds-badger v0.2.1
github.com/ipfs/go-ds-leveldb v0.4.2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to add these as hard deps? Perhaps the fuzz portion needs to become a sub-project? @Stebalien thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't. We should create a sub-module.

go 1.14

require (
github.com/ipfs/go-datastore v0.4.4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add a replace directive pointing to ../.

fuzz/README.md Outdated
```golang
go get github.com/ipfs/go-datastore
cd go-datastore/fuzz
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't going to work reliably (gopath, etc). I'd just remove it.

fuzzer "github.com/ipfs/go-datastore/fuzz"
dsq "github.com/ipfs/go-datastore/query"

"github.com/spf13/pflag"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd slightly prefer to use github.com/urfave/cli to be consistent with the other projects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that i'm not pulling in a full app/cli framework for these entry points, i'm going to defer on that for now.

@willscott willscott merged commit 3c50706 into master Apr 24, 2020
@willscott willscott deleted the fuzz branch April 24, 2020 18:10
@aschmahmann aschmahmann mentioned this pull request Sep 22, 2020
72 tasks
@Stebalien Stebalien mentioned this pull request May 11, 2021
27 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants