featurebase/roaring
Travis Turner aa17b8d725
Enable linter: stylecheck (#2317)
* Enable linter: stylecheck

This enabled the stylecheck linter, but excludes some staticchecks for
now. The following are ignored because they will take a bit of time to
address, but the intention is to address them and remove them from the
exclusion list.

ST1000: at least one file in a package should have a package comment
ST1003: golang naming standards
ST1008: error should be returned as the last argument
ST1016: methods on the same type should have the same receiver name
ST1020: comment on exported function

* Address ST1015

For some reason this failed in CI but not locally. I can't figure out
why that check isn't happening locally. This just moves the switch
statements around so that the `default` is the first (or last) item.

* Adjust error string in test to match case-adjusted error

* Remove TestCloseTimeout
2023-03-14 08:45:18 -05:00
..
benchpretty Updated dependency paths to reflect new repo location 2022-09-06 09:39:22 -07:00
testdata cleanup #1622 2018-09-06 16:27:10 -05:00
add.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
add_test.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
btree.go staticcheck fixes (#2278) 2022-11-15 11:33:10 -08:00
btree_test.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
container_archetypes.go Linters! (#2314) 2023-03-10 15:13:15 -06:00
container_stash.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
containers_btree.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
containers_slice.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
containers_test.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
filter.go Enable linter: stylecheck (#2317) 2023-03-14 08:45:18 -05:00
filter_internal_test.go Updated dependency paths to reflect new repo location 2022-09-06 09:39:22 -07:00
fuzz_test.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
fuzzer.go fix: updating code to meet linting requirements (#2171) 2022-09-29 12:34:29 -04:00
inst.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
naive.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
naive_test.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
nop_inst.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
printutil.go Updated dependency paths to reflect new repo location 2022-09-06 09:39:22 -07:00
printutil_test.go Updated dependency paths to reflect new repo location 2022-09-06 09:39:22 -07:00
README.md Fixed typo 2019-06-17 16:47:28 -05:00
roaring.go Linters! (#2314) 2023-03-10 15:13:15 -06:00
roaring_container_test.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
roaring_helpers_test.go staticcheck fixes (#2278) 2022-11-15 11:33:10 -08:00
roaring_internal_test.go drop anti-entropy feature, since it doesn't work 2022-11-15 11:31:13 -08:00
roaring_nop_paranoia.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
roaring_nop_sentinel.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
roaring_nop_stats.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
roaring_paranoia.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
roaring_sentinel.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00
roaring_stats.go Updated dependency paths to reflect new repo location 2022-09-06 09:39:22 -07:00
roaring_test.go staticcheck fixes (#2278) 2022-11-15 11:33:10 -08:00
unmarshal_binary.go Updated code to latest version for open-sourcing. 2022-09-02 13:23:39 -07:00

The Fuzzer

For complete documentation on go-fuzz, please see: https://github.com/dvyukov/go-fuzz

The fuzzer in relation to the roaring package checks the Bitmap.UnmarshalBinary function found in roaring.go. In order to use the fuzzer, you can follow these steps:

cd $GOPATH/src/github.com/pilosa/pilosa/roaring

go-fuzz-build ./

You must now make the workdir/corpus directory. This is achieved by:

mkdir workdir/corpus

The fuzzer needs some input to start the fuzzing with. Copy some sample Pilosa fragments into the workdir/corpus folder. For example:

cp ~/.pilosa/my-index/my-field/views/standard/fragments/0 workdir/corpus

Once you have copied your sample inputs, you are ready to run the fuzzer:

go-fuzz -bin=roaring-fuzz.zip -workdir=workdir -func=FuzzBitmapUnmarshalBinary

Understanding the Fuzzer Output

The fuzzer will output something similar to the follwoing:

2015/04/25 12:39:53 workers: 8, corpus: 124 (12s ago), crashers: 37, restarts: 1/15, execs: 35342 (2941/sec), cover: 403, uptime: 12s

The most important part of the output is the crashers and cover. The crashers records how many combinations were discovered that fail and the cover tells you how much code is being accessed. For a complete explanation of the output, please see: https://github.com/dvyukov/go-fuzz.

The fuzzer will document the crashers in a folder labeled "crashers." It will record the fragment and the error that was produced in two separate files within this folder. This is the final product.

Happy Fuzzing!