cargo mutants: missed mutants in vortex-fuzz
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by reviewing the listed surviving mutants in fuzz/fuzz_targets/file_io.rs and fuzz/corruption.rs, then run the corresponding cargo mutants commands included in the issue. Add or adjust fuzz tests so the relevant behavior is exercised and these mutants are caught. Done when the affected mutations no longer survive the fuzz test suite.
索引モデルが issue の本文から書いたものです。
説明
The nightly run at fdb9507c04e2939724aa39c298653a8ea3fd3b49 found 7 mutants in vortex-fuzz that survive the tests. They are in code that changed during the last day.
Artifacts:
- mutants-0
- mutants-2
- mutants-13
- mutants-1
- mutants-3
- mutants-6
- mutants-10
- mutants-5
- mutants-4
- mutants-11
- mutants-9
- mutants-12
- mutants-15
- mutants-14
fuzz/fuzz_targets/file_io.rs:93:9
replace FileRoundTrip::check -> bool with true
--- fuzz/fuzz_targets/file_io.rs
+++ replace FileRoundTrip::check -> bool with true
@@ -85,106 +85,17 @@
}
Ok(Self::File(u.arbitrary()?))
}
}
impl FileRoundTrip {
/// Writes, reopens, and scans the file. Returns false for unsupported schemas.
fn check(self) -> bool {
- let (array_data, split_at, projection_expr, filter_expr, write_options) = match self {
- Self::File(action) => (
- action.array,
- None,
- action.projection_expr,
- action.filter_expr,
- action.write_settings.write_options(),
- ),
- Self::Variant { array, split_at } => {
- (array, split_at, None, None, SESSION.write_options())
- }
- };
- if has_duplicate_field_names(array_data.dtype()) {
- return false;
- }
-
- let mut ctx = SESSION.create_execution_ctx();
- let expected_array = if filter_expr.is_none() && projection_expr.is_none() {
- array_data.clone()
- } else {
- let bool_mask = array_data
- .clone()
- .apply(&filter_expr.clone().unwrap_or_else(|| lit(true)))
- .vortex_expect("filter expression evaluation should succeed in fuzz test");
- let bool_mask_bool = bool_mask
- .execute::<BoolArray>(&mut ctx)
- .vortex_expect("execute bool");
- let mask = bool_mask_bool
- .to_mask_fill_null_false(&mut ctx)
- .vortex_expect("fill nulls of the filter mask");
- let filtered = array_data
- .filter(mask)
- .vortex_expect("filter operation should succeed in fuzz test");
- filtered
- .apply(&projection_expr.clone().unwrap_or_else(root))
- .vortex_expect("projection expression evaluation should succeed in fuzz test")
- };
-
- let input = if let Some(split) = split_at {
- let first = array_data.slice(0..split).vortex_expect("valid split");
- let second = array_data
- .slice(split..array_data.len())
- .vortex_expect("valid split");
- ChunkedArray::from_iter([first, second]).into_array()
- } else {
- array_data
- };
-
- let mut full_buff = Vec::new();
- let _footer = write_options
- .blocking(&*RUNTIME)
- .write(&mut full_buff, input.to_array_iterator())
- .vortex_expect("file write should succeed in fuzz test");
-
- let file = SESSION
- .open_options()
- .open_buffer(full_buff)
- .vortex_expect("open_buffer should succeed in fuzz test");
- let projection = projection_expr
- .unwrap_or_else(root)
- .bind(file.dtype())
- .and_then(|expr| expr.optimize_recursive())
- .vortex_expect("projection should bind in fuzz test");
- let filter = filter_expr
- .map(|filter| {
- filter
- .bind(file.dtype())
- .and_then(|expr| expr.optimize_recursive())
- })
- .transpose()
- .vortex_expect("filter should bind in fuzz test");
- let mut output = file
- .scan()
- .vortex_expect("scan should succeed in fuzz test")
- .with_projection(projection)
- .with_some_filter(filter)
- .into_array_iter(&*RUNTIME)
- .vortex_expect("into_array_iter should succeed in fuzz test")
- .try_collect::<_, Vec<_>, _>()
- .vortex_expect("collect should succeed in fuzz test");
-
- let output_array = match output.len() {
- 0 => Canonical::empty(expected_array.dtype()).into_array(),
- 1 => output.pop().vortex_expect("one output"),
- _ => ChunkedArray::from_iter(output).into_array(),
- };
-
- assert_arrays_eq!(output_array, expected_array, &mut ctx);
-
- true
+ true /* ~ changed by cargo-mutants ~ */
}
}
fuzz_target!(|fuzz: FileRoundTrip| -> Corpus {
if fuzz.check() {
Corpus::Keep
} else {
Corpus::Reject
cargo mutants -f fuzz/fuzz_targets/file_io.rs -F ':93:9:'
fuzz/corruption.rs:210:5
replace run_prepared_corruption with ()
--- fuzz/corruption.rs
+++ replace run_prepared_corruption with ()
@@ -202,22 +202,17 @@
});
pub fn run_prepared_corruption(data: &[u8], read: ReadCorrupted) {
// This is a hack to unblock fuzzer. Inputs like this, including empty
// data, make fuzzer immediately crash with an OOM which is a genuine bug
// but doesn't help discover other errors. Remove when this is fixed:
// https://github.com/vortex-data/vortex/issues/12173
// https://github.com/vortex-data/vortex/issues/12244
- if data.len() <= size_of::<u16>() {
- return;
- }
- let (selector, seed): (u16, u64) = Unstructured::new(data).arbitrary().unwrap_or_default();
- let (file, targets) = &FILES[usize::from(selector) % FILES.len()];
- read_corruption_sets(file, targets, seed, read);
+ () /* ~ changed by cargo-mutants ~ */
}
fn read_corruption_sets(file: &[u8], targets: &Targets, seed: u64, read: ReadCorrupted) {
report_on_panic(|| {
for (position, corruption) in CURRENT_SET.get().into_iter().flatten() {
eprintln!("corruption {position} {corruption:?}");
}
});
cargo mutants -f fuzz/corruption.rs -F ':210:5:'
fuzz/corruption.rs:210:19
replace <= with > in run_prepared_corruption
--- fuzz/corruption.rs
+++ replace <= with > in run_prepared_corruption
@@ -202,17 +202,17 @@
});
pub fn run_prepared_corruption(data: &[u8], read: ReadCorrupted) {
// This is a hack to unblock fuzzer. Inputs like this, including empty
// data, make fuzzer immediately crash with an OOM which is a genuine bug
// but doesn't help discover other errors. Remove when this is fixed:
// https://github.com/vortex-data/vortex/issues/12173
// https://github.com/vortex-data/vortex/issues/12244
- if data.len() <= size_of::<u16>() {
+ if data.len() > /* ~ changed by cargo-mutants ~ */ size_of::<u16>() {
return;
}
let (selector, seed): (u16, u64) = Unstructured::new(data).arbitrary().unwrap_or_default();
let (file, targets) = &FILES[usize::from(selector) % FILES.len()];
read_corruption_sets(file, targets, seed, read);
}
fn read_corruption_sets(file: &[u8], targets: &Targets, seed: u64, read: ReadCorrupted) {
cargo mutants -f fuzz/corruption.rs -F ':210:19:'
fuzz/corruption.rs:214:56
replace % with / in run_prepared_corruption
--- fuzz/corruption.rs
+++ replace % with / in run_prepared_corruption
@@ -206,17 +206,17 @@
// data, make fuzzer immediately crash with an OOM which is a genuine bug
// but doesn't help discover other errors. Remove when this is fixed:
// https://github.com/vortex-data/vortex/issues/12173
// https://github.com/vortex-data/vortex/issues/12244
if data.len() <= size_of::<u16>() {
return;
}
let (selector, seed): (u16, u64) = Unstructured::new(data).arbitrary().unwrap_or_default();
- let (file, targets) = &FILES[usize::from(selector) % FILES.len()];
+ let (file, targets) = &FILES[usize::from(selector) / /* ~ changed by cargo-mutants ~ */ FILES.len()];
read_corruption_sets(file, targets, seed, read);
}
fn read_corruption_sets(file: &[u8], targets: &Targets, seed: u64, read: ReadCorrupted) {
report_on_panic(|| {
for (position, corruption) in CURRENT_SET.get().into_iter().flatten() {
eprintln!("corruption {position} {corruption:?}");
}
cargo mutants -f fuzz/corruption.rs -F ':214:56:'
fuzz/corruption.rs:214:56
replace % with + in run_prepared_corruption
--- fuzz/corruption.rs
+++ replace % with + in run_prepared_corruption
@@ -206,17 +206,17 @@
// data, make fuzzer immediately crash with an OOM which is a genuine bug
// but doesn't help discover other errors. Remove when this is fixed:
// https://github.com/vortex-data/vortex/issues/12173
// https://github.com/vortex-data/vortex/issues/12244
if data.len() <= size_of::<u16>() {
return;
}
let (selector, seed): (u16, u64) = Unstructured::new(data).arbitrary().unwrap_or_default();
- let (file, targets) = &FILES[usize::from(selector) % FILES.len()];
+ let (file, targets) = &FILES[usize::from(selector) + /* ~ changed by cargo-mutants ~ */ FILES.len()];
read_corruption_sets(file, targets, seed, read);
}
fn read_corruption_sets(file: &[u8], targets: &Targets, seed: u64, read: ReadCorrupted) {
report_on_panic(|| {
for (position, corruption) in CURRENT_SET.get().into_iter().flatten() {
eprintln!("corruption {position} {corruption:?}");
}
cargo mutants -f fuzz/corruption.rs -F ':214:56:'
fuzz/corruption.rs:219:5
replace read_corruption_sets with ()
--- fuzz/corruption.rs
+++ replace read_corruption_sets with ()
@@ -211,44 +211,17 @@
return;
}
let (selector, seed): (u16, u64) = Unstructured::new(data).arbitrary().unwrap_or_default();
let (file, targets) = &FILES[usize::from(selector) % FILES.len()];
read_corruption_sets(file, targets, seed, read);
}
fn read_corruption_sets(file: &[u8], targets: &Targets, seed: u64, read: ReadCorrupted) {
- report_on_panic(|| {
- for (position, corruption) in CURRENT_SET.get().into_iter().flatten() {
- eprintln!("corruption {position} {corruption:?}");
- }
- });
-
- // Technically this approach makes fuzzer mutator useless as any seed
- // change implies completely different corruptions. However, in this
- // fuzzer we don't actually care about composing corruptions. We do care
- // about speed. Seed + rng compared to a seed-only corruption solution
- // finds roughly 3x more errors during same fuzzing time
- let mut rng = Xoshiro256PlusPlus::seed_from_u64(seed);
- let mut ctx = SESSION.create_execution_ctx();
- for _ in 0..CORRUPTION_SETS {
- let mut entropy = [0u8; SET_ENTROPY_BYTES];
- rng.fill(&mut entropy);
- let mut u = Unstructured::new(&entropy);
- let mut corrupted = file.to_vec();
- let mut applied = [None; MAX_CORRUPTIONS];
- let len = u.int_in_range(1..=MAX_CORRUPTIONS).unwrap_or(1);
- for slot in applied.iter_mut().take(len) {
- let corruption = u.arbitrary().ok();
- *slot = corruption.and_then(|corruption| targets.apply(&mut corrupted, corruption));
- }
- CURRENT_SET.set(applied);
- read(&mut ctx, corrupted).ok();
- }
- CURRENT_SET.set([None; MAX_CORRUPTIONS]);
+ () /* ~ changed by cargo-mutants ~ */
}
fn postscript(file: &[u8]) -> Option<fb::Postscript<'_>> {
let eof_start = file.len() - EOF_SIZE;
let start = eof_start + VERSION_BYTES;
let end = start + POSTSCRIPT_LEN_BYTES;
let len_bytes: [u8; POSTSCRIPT_LEN_BYTES] = file.get(start..end)?.try_into().ok()?;
let postscript_len = usize::from(u16::from_le_bytes(len_bytes));
cargo mutants -f fuzz/corruption.rs -F ':219:5:'
fuzz/fuzz_targets/file_io.rs:93:9
replace FileRoundTrip::check -> bool with false
--- fuzz/fuzz_targets/file_io.rs
+++ replace FileRoundTrip::check -> bool with false
@@ -85,106 +85,17 @@
}
Ok(Self::File(u.arbitrary()?))
}
}
impl FileRoundTrip {
/// Writes, reopens, and scans the file. Returns false for unsupported schemas.
fn check(self) -> bool {
- let (array_data, split_at, projection_expr, filter_expr, write_options) = match self {
- Self::File(action) => (
- action.array,
- None,
- action.projection_expr,
- action.filter_expr,
- action.write_settings.write_options(),
- ),
- Self::Variant { array, split_at } => {
- (array, split_at, None, None, SESSION.write_options())
- }
- };
- if has_duplicate_field_names(array_data.dtype()) {
- return false;
- }
-
- let mut ctx = SESSION.create_execution_ctx();
- let expected_array = if filter_expr.is_none() && projection_expr.is_none() {
- array_data.clone()
- } else {
- let bool_mask = array_data
- .clone()
- .apply(&filter_expr.clone().unwrap_or_else(|| lit(true)))
- .vortex_expect("filter expression evaluation should succeed in fuzz test");
- let bool_mask_bool = bool_mask
- .execute::<BoolArray>(&mut ctx)
- .vortex_expect("execute bool");
- let mask = bool_mask_bool
- .to_mask_fill_null_false(&mut ctx)
- .vortex_expect("fill nulls of the filter mask");
- let filtered = array_data
- .filter(mask)
- .vortex_expect("filter operation should succeed in fuzz test");
- filtered
- .apply(&projection_expr.clone().unwrap_or_else(root))
- .vortex_expect("projection expression evaluation should succeed in fuzz test")
- };
-
- let input = if let Some(split) = split_at {
- let first = array_data.slice(0..split).vortex_expect("valid split");
- let second = array_data
- .slice(split..array_data.len())
- .vortex_expect("valid split");
- ChunkedArray::from_iter([first, second]).into_array()
- } else {
- array_data
- };
-
- let mut full_buff = Vec::new();
- let _footer = write_options
- .blocking(&*RUNTIME)
- .write(&mut full_buff, input.to_array_iterator())
- .vortex_expect("file write should succeed in fuzz test");
-
- let file = SESSION
- .open_options()
- .open_buffer(full_buff)
- .vortex_expect("open_buffer should succeed in fuzz test");
- let projection = projection_expr
- .unwrap_or_else(root)
- .bind(file.dtype())
- .and_then(|expr| expr.optimize_recursive())
- .vortex_expect("projection should bind in fuzz test");
- let filter = filter_expr
- .map(|filter| {
- filter
- .bind(file.dtype())
- .and_then(|expr| expr.optimize_recursive())
- })
- .transpose()
- .vortex_expect("filter should bind in fuzz test");
- let mut output = file
- .scan()
- .vortex_expect("scan should succeed in fuzz test")
- .with_projection(projection)
- .with_some_filter(filter)
- .into_array_iter(&*RUNTIME)
- .vortex_expect("into_array_iter should succeed in fuzz test")
- .try_collect::<_, Vec<_>, _>()
- .vortex_expect("collect should succeed in fuzz test");
-
- let output_array = match output.len() {
- 0 => Canonical::empty(expected_array.dtype()).into_array(),
- 1 => output.pop().vortex_expect("one output"),
- _ => ChunkedArray::from_iter(output).into_array(),
- };
-
- assert_arrays_eq!(output_array, expected_array, &mut ctx);
-
- true
+ false /* ~ changed by cargo-mutants ~ */
}
}
fuzz_target!(|fuzz: FileRoundTrip| -> Corpus {
if fuzz.check() {
Corpus::Keep
} else {
Corpus::Reject
cargo mutants -f fuzz/fuzz_targets/file_io.rs -F ':93:9:'
- 主要言語
- Rust
- スター
- 3.2k
- フォーク
- 239
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 684
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
vortex-data/vortex のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
vortex-data/vortex#12633 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
vortex-data/vortex#12628 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
vortex-data/vortex#12491 ·
メンテナーはふだん 1 日以内に返信
-
Fallible constructor for nested_case_when対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
vortex-data/vortex#11425 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
vortex-data/vortex#12635 ·
メンテナーはふだん 1 日以内に返信
vortex-data/vortex の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
marklauter/tsong#110 ·
-
docs enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
wasm-bindgen/wasm-bindgen#5503 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
marketing
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
area: engine bug needs milestone
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Mudcrab-Team/mudcrab#1197 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信