featurebase/roaring
Seebs cf97a0dcb8 overhaul: switch over to using QueryContext
We switch everything to use QueryContext/QueryRead/etc instead
of Qcx/Tx.

We drop the short_txkey subpackage (it's now handled by either
keys or querycontext).

We drop all the dbshard stuff, and all the tx/txfactory stuff.

We remove all the things that related to the old "Block" concept,
which was mostly used by the anti-entropy code, but had one
fragmentary usage left in the ImportRoaringOverwrite case of
ImportRoaring. That's replaced by using a rewriter that deletes
all bits (not just bits in specific columns) from an existing
thing, but writes in new bits. Actually we could probably do that
better with a custom "eradicate-rewriter" that doesn't try to
be clever, and just eliminates things.

This includes a number of minor bug fixes that were
exposed by getting the testing to work. For example:
* When checking whether an operation "requires write", we
  now consider a Delete a kind of a Write, because it is.
* Several tests were relying on the fact that writes through
  Qcx were being committed whether or not the Qcx was ever
  told to finish. With QueryContext, you actually have to
  reach a Commit() or the writes don't happen (except for
  special cases in Delete).
* Replaced a lot of panics with t.Fatalf in tests.

There's also some minor staticcheck fixes, like deleting the
unused "db" member of a boltdb transaction wrapper.
2023-01-11 12:57:56 -06:00
..
benchpretty Upgrade go.mod to featurebase/v3 2022-01-21 10:57:05 -07:00
testdata cleanup #1622 2018-09-06 16:27:10 -05:00
add.go add copyright notice back in 2021-12-10 11:01:04 -06:00
add_test.go add copyright notice back in 2021-12-10 11:01:04 -06:00
btree.go staticcheck fixes (#2278) 2022-11-07 10:51:55 -06:00
btree_test.go remove references to LICENSE and checks for it in source files 2021-11-19 10:38:06 -06:00
container_archetypes.go Mitigate 1 instance of potential integer overflow 2022-04-19 11:06:25 -04:00
container_stash.go implement RemakeContainerFrom and helper function for it 2022-04-12 12:24:22 -05:00
containers_btree.go add copyright notice back in 2021-12-10 11:01:04 -06:00
containers_slice.go add copyright notice back in 2021-12-10 11:01:04 -06:00
containers_test.go implement RemakeContainerFrom and helper function for it 2022-04-12 12:24:22 -05:00
filter.go overhaul: switch over to using QueryContext 2023-01-11 12:57:56 -06:00
filter_internal_test.go fix container key computation for UnionRows call 2022-06-23 08:12:31 -05:00
fuzz_test.go add copyright notice back in 2021-12-10 11:01:04 -06:00
fuzzer.go drop ioutil 2022-09-23 16:56:27 -05:00
inst.go add copyright notice back in 2021-12-10 11:01:04 -06:00
naive.go add copyright notice back in 2021-12-10 11:01:04 -06:00
naive_test.go add copyright notice back in 2021-12-10 11:01:04 -06:00
nop_inst.go add copyright notice back in 2021-12-10 11:01:04 -06:00
printutil.go Upgrade go.mod to featurebase/v3 2022-01-21 10:57:05 -07:00
printutil_test.go Upgrade go.mod to featurebase/v3 2022-01-21 10:57:05 -07:00
README.md Fixed typo 2019-06-17 16:47:28 -05:00
roaring.go overhaul: switch over to using QueryContext 2023-01-11 12:57:56 -06:00
roaring_container_test.go add copyright notice back in 2021-12-10 11:01:04 -06:00
roaring_helpers_test.go staticcheck fixes (#2278) 2022-11-07 10:51:55 -06:00
roaring_internal_test.go drop anti-entropy feature, since it doesn't work 2022-11-04 14:08:23 -05:00
roaring_nop_paranoia.go add copyright notice back in 2021-12-10 11:01:04 -06:00
roaring_nop_sentinel.go add copyright notice back in 2021-12-10 11:01:04 -06:00
roaring_nop_stats.go add copyright notice back in 2021-12-10 11:01:04 -06:00
roaring_paranoia.go add copyright notice back in 2021-12-10 11:01:04 -06:00
roaring_sentinel.go add copyright notice back in 2021-12-10 11:01:04 -06:00
roaring_stats.go Upgrade go.mod to featurebase/v3 2022-01-21 10:57:05 -07:00
roaring_test.go staticcheck fixes (#2278) 2022-11-07 10:51:55 -06:00
unmarshal_binary.go add copyright notice back in 2021-12-10 11:01:04 -06: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!