fuzz: avoid panics in append_function on generic functions (fixes #21)#23
fuzz: avoid panics in append_function on generic functions (fixes #21)#23Gy-Hu wants to merge 1 commit into
Conversation
Closes BitsLabSec#21. The fuzzer previously aborted when probing generic functions whose fixed and derived type arguments disagreed (append.rs:113). The sibling `PartialFound` branch already handles the same class of conflict by returning `None`, so match that pattern here. Relax four adjacent fallible sites to the same `debug! + return None` pattern so the fuzzer can skip rather than crash when: - the function identifier is not in the ABI map - `gen_input_arg` fails to synthesise an initial value (two call sites) - a `balance`/`coin` parameter does not substitute to a struct Convert the two pattern-match `else` arms that guard just-constructed `MoveSequenceCall::Call` values to `unreachable!`, which better reflects the invariant. Verified by rerunning the saved flash_lender benchmark (`target/benchmarks/movy-flash-fuzz/args.json`, seed 1, 5s): corpus, objectives, and exec count match the pre-change run.
|
Thanks for checking. I took another look at v1.65.2-pending. If the goal is to cover the behavioral issue from #23 / #21, I don’t think it is fully covered yet. In the current branch, crates/movy-fuzz/src/mutators/sequence/append.rs still has the same panic path for conflicting type arguments: panic!("Conflicting type arguments for index {}", i); and the adjacent unwrap/panic paths that #23 relaxed also still seem to be present. Maybe there is another change in v1.65.2-pending that makes this path unreachable, but I could not confirm that from the code. For #24, most of it is typo/public identifier cleanup, so I understand if that is not the main concern for this branch. I did notice those typo fixes are not included yet, but they can be handled separately if you prefer. Since these PRs don’t seem to be aligned with the current development focus, I’ll close them for now. If they become useful later, I’m happy to reopen/rebase/split them as needed. |
Closes #21.
The fuzzer previously aborted when probing generic functions whose fixed and derived type arguments disagreed (
crates/movy-fuzz/src/mutators/sequence/append.rs:113). The siblingPartialFoundbranch already handles the same class of conflict by returningNone, so match that pattern here.Relax four adjacent fallible sites to the same
debug! + return Nonepattern so the fuzzer can skip rather than crash when:get_functionmiss)gen_input_argfails to synthesise an initial value (two call sites, one perConstructResultbranch)balance/coinparameter does not substitute to a structConvert the two pattern-match
elsearms that guard just-constructedMoveSequenceCall::Callvalues tounreachable!, which better reflects the invariant.Validation
Rebuilt
movyrelease and reran the saved flash_lender benchmark:Output matches the pre-change run:
corpus: 19, objectives: 1, executions: 3051with the sameProceedsOraclefinding. The change is a strict relaxation of panic paths; no existing behavior is altered on non-panicking inputs.Test plan
cargo build -p movy-fuzz --release— cleancargo build -p movy --release— clean