Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8e137e1
MOD-13577 support Homogenues array floating point forcing(deserializa…
AvivDavid23 Feb 5, 2026
bfd678b
add fallback option
AvivDavid23 Feb 9, 2026
2079a68
export FPHAConfig
AvivDavid23 Feb 9, 2026
cec89cf
docs
AvivDavid23 Feb 9, 2026
bc60e68
fmt
AvivDavid23 Feb 9, 2026
931d520
comments
AvivDavid23 Feb 9, 2026
3ba050f
lower fuzz time
AvivDavid23 Feb 9, 2026
8cd9ddf
bring back old code
AvivDavid23 Feb 9, 2026
3cfee7d
change to lossy push
AvivDavid23 Feb 9, 2026
f166310
Binary encoder/decoder
AvivDavid23 Feb 19, 2026
fa80dbe
remove fallback from FPHAConfig
AvivDavid23 Feb 19, 2026
6780eac
more fuzz tests
AvivDavid23 Feb 19, 2026
86e63be
tag to enum
AvivDavid23 Feb 19, 2026
746ac87
update fuzz parameters in ci
AvivDavid23 Feb 19, 2026
f3d275d
fmt
AvivDavid23 Feb 19, 2026
954fa38
remove print in fuzz
AvivDavid23 Feb 19, 2026
8222832
wrap with zstd compression
AvivDavid23 Feb 19, 2026
4bfdfec
misc
AvivDavid23 Feb 19, 2026
b6e1ac7
move to cbor based implementation
AvivDavid23 Feb 22, 2026
2a547e2
.
AvivDavid23 Feb 22, 2026
b40b8d8
fmt
AvivDavid23 Feb 22, 2026
043b76c
CR
AvivDavid23 Feb 22, 2026
8fdfd04
move to fork of ciborium
AvivDavid23 Feb 26, 2026
2351ace
fix CR
AvivDavid23 Feb 26, 2026
a62bd2d
fmt
AvivDavid23 Feb 26, 2026
00cefdc
misc: JsonValue in fuzz tests to use serde
AvivDavid23 Feb 26, 2026
be16c77
fmt
AvivDavid23 Feb 26, 2026
432f62e
revert to manual string in fuzz, fix push_with_fp case
AvivDavid23 Mar 1, 2026
0d11fe8
cr
AvivDavid23 Mar 1, 2026
ebcad76
remove dead code
AvivDavid23 Mar 1, 2026
c1ff908
.
AvivDavid23 Mar 1, 2026
95369f0
CR
AvivDavid23 Mar 3, 2026
9675e63
move to arbitrary-json crate in fuzz tests
AvivDavid23 Mar 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/fuzz_tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
fuzz_time:
description: 'Maximum time in seconds to run fuzzing'
required: false
default: '180'
default: '300'
cargo_fuzz_version:
description: 'Version of cargo-fuzz to install'
required: false
Expand All @@ -26,5 +26,5 @@ runs:
- name: Run Fuzz Tests
shell: bash
working-directory: fuzz
run: cargo fuzz run ${{ inputs.fuzz_target }} --release -- -max_total_time=${{ inputs.fuzz_time }}
run: cargo fuzz run ${{ inputs.fuzz_target }} --release -- -max_total_time=${{ inputs.fuzz_time }} -ignore_ooms=1 -rss_limit_mb=0

3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ jobs:
matrix:
fuzz_target:
- fuzz_json_de
# Add more fuzz targets here as needed
- fuzz_cbor_decode
- fuzz_cbor_roundtrip
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ serde = { workspace = true }
serde_json = { workspace = true }
ctor = { version = "0.1.16", optional = true }
paste = "1.0.15"
half = "2.0.0"
ciborium = { git = "https://github.com/AvivDavid23/ciborium", branch = "main" }
ciborium-ll = { git = "https://github.com/AvivDavid23/ciborium", branch = "main" }
bytemuck = "1"
half = { version = "2.0.0", features = ["bytemuck"] }
thiserror = "2.0.18"
zstd = "0.13"

[dev-dependencies]
mockalloc = "0.1.2"
ctor = "0.1.16"
rand = "0.8.4"

zstd = "0.13"
21 changes: 20 additions & 1 deletion fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ edition = "2021"
[package.metadata]
cargo-fuzz = true

[lib]
name = "ijson_fuzz"
path = "src/lib.rs"

[dependencies]
libfuzzer-sys = "0.4"
arbitrary = { version = "1.3", features = ["derive"] }
serde = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
arbitrary-json = "=0.1.1"

[dependencies.ijson]
path = ".."
Expand All @@ -22,3 +27,17 @@ path = "fuzz_targets/fuzz_json_de.rs"
test = false
doc = false
bench = false

[[bin]]
name = "fuzz_cbor_decode"
path = "fuzz_targets/fuzz_cbor_decode.rs"
test = false
doc = false
bench = false

[[bin]]
name = "fuzz_cbor_roundtrip"
path = "fuzz_targets/fuzz_cbor_roundtrip.rs"
test = false
doc = false
bench = false
8 changes: 8 additions & 0 deletions fuzz/fuzz_targets/fuzz_cbor_decode.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#![no_main]

use ijson::cbor::decode;
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: &[u8]| {
let _ = decode(data);
});
22 changes: 22 additions & 0 deletions fuzz/fuzz_targets/fuzz_cbor_roundtrip.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#![no_main]

use arbitrary_json::ArbitraryValue;
use ijson::{cbor, IValue};
use libfuzzer_sys::fuzz_target;
use serde::Deserialize;

fuzz_target!(|value: ArbitraryValue| {
let json_string = value.to_string();
let mut deserializer = serde_json::Deserializer::from_str(&json_string);
let Ok(original) = IValue::deserialize(&mut deserializer) else {
return;
};

let encoded = cbor::encode(&original);
let decoded = cbor::decode(&encoded).expect("encode->decode round-trip must not fail");

assert_eq!(
original, decoded,
"round-trip mismatch for input: {json_string}"
);
});
48 changes: 3 additions & 45 deletions fuzz/fuzz_targets/fuzz_json_de.rs
Original file line number Diff line number Diff line change
@@ -1,54 +1,12 @@
#![no_main]

use arbitrary::Arbitrary;
use arbitrary_json::ArbitraryValue;
use ijson::IValue;
use libfuzzer_sys::fuzz_target;
use serde::Deserialize;
use std::collections::HashMap;

#[derive(Arbitrary, Debug)]
enum JsonValue {
Null,
Bool(bool),
Number(f64),
String(String),
Array(Vec<JsonValue>),
Object(HashMap<String, JsonValue>),
}

impl JsonValue {
fn to_json_string(&self) -> String {
match self {
JsonValue::Null => "null".to_string(),
JsonValue::Bool(b) => b.to_string(),
JsonValue::Number(n) => {
if n.is_finite() {
n.to_string()
} else {
"0".to_string()
}
}
JsonValue::String(s) => format!("\"{}\"", s),
JsonValue::Array(arr) => {
let items: Vec<String> = arr.iter().map(|v| v.to_json_string()).collect();
format!("[{}]", items.join(","))
}
JsonValue::Object(obj) => {
let items: Vec<String> = obj
.iter()
.map(|(k, v)| {
let key = k.clone();
format!("\"{}\":{}", key, v.to_json_string())
})
.collect();
format!("{{{}}}", items.join(","))
}
}
}
}

fuzz_target!(|value: JsonValue| {
let json_string = value.to_json_string();
fuzz_target!(|value: ArbitraryValue| {
let json_string = value.to_string();
let mut deserializer = serde_json::Deserializer::from_str(&json_string);
let _ = IValue::deserialize(&mut deserializer);
});
1 change: 1 addition & 0 deletions fuzz/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading
Loading