Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm

fuzzing crashes with jemalloc 😱😱😱😱

Changed files
+11 -5
ufos
fuzz
+1
Cargo.lock
···
dependencies = [
"jetstream",
"libfuzzer-sys",
+
"tikv-jemallocator",
"ufos",
+3
ufos/fuzz/Cargo.toml
···
[dependencies.jetstream]
path = "../../jetstream"
+
[target.'cfg(not(target_env = "msvc"))'.dependencies]
+
tikv-jemallocator = "0.6.0"
+
[[bin]]
name = "counts_value"
path = "fuzz_targets/counts_value.rs"
+7 -5
ufos/fuzz/fuzz_targets/counts_value.rs
···
use ufos::store_types::CountsValue;
use libfuzzer_sys::fuzz_target;
+
#[cfg(not(target_env = "msvc"))]
+
use tikv_jemallocator::Jemalloc;
+
+
#[cfg(not(target_env = "msvc"))]
+
#[global_allocator]
+
static GLOBAL: Jemalloc = Jemalloc;
+
fuzz_target!(|data: &[u8]| {
if let Ok((counts_value, n)) = CountsValue::from_db_bytes(data) {
assert!(n <= data.len());
···
assert_eq!(n_again, n);
assert_eq!(and_back.records(), counts_value.records());
assert_eq!(and_back.dids().estimate(), counts_value.dids().estimate());
-
// assert_eq!(serialized, data[..n]);
-
// counts_value.prefix.0 += 1;
-
// counts_value.suffix.0.insert(&Did::new("did:plc:blah".to_string()).unwrap());
-
// assert!(counts_value.records() > 0);
-
// assert!(counts_value.dids().estimate() > 0);
}
});