-
-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow testcase syncing between fuzzers with different Input types #858
Comments
Also, we want something like "Sync pushing new testcases to the other fuzzer, never get new testcases from them" or viceversa |
It should be possible to a) send type information, b) select the specified type to deserialise, and c) if that type implements Into with T for the target-desired type, turn it into Some(T); if not, None |
sending type info is not possible as typeid et similar requires 'static and Input is not, and even if we force Input to be static the type ids may change in different binaries as the synced fuzzers may be different binaries |
I'm not suggesting using generated type data, but specified type data. Use something like inventory to maintain a compile-time list of available types, storing a string and a Fn, then, when deserialising, find matching type name (if available) and apply deserialisation Fn to remainder. When serialising, send type name, then type data. For then converting that type into whatever specified type we want, we need to make a trait (something like |
types registries (like inventory, that requires std and it is not compile-time but load-time as it uses constructors) require trait objects. We have a serializable trait objects registry, https://github.com/AFLplusplus/LibAFL/blob/main/libafl/src/bolts/serdeany.rs, but as I said this would force any Input to be 'static. |
I'm unclear as to why this would need to be static... At no point would this require TypeId. |
Also, for inventory, we don't need any specific type data. This would happen in dynamic dispatch. |
dyn Something forces Somthing to be static |
I don't think it does, no -- it requires it to be indirectly allocated, though. trait Thing {
fn do_thing(&self);
}
struct First;
struct Second;
impl Thing for First {
fn do_thing(&self) {
println!("First");
}
}
impl Thing for Second {
fn do_thing(&self) {
println!("Second");
}
}
fn main() {
let first: Box<dyn Thing> = Box::new(First);
let second: Box<dyn Thing> = Box::new(Second);
first.do_thing();
second.do_thing();
} |
Yes sorry I meant dyn Any, for the downcast |
Gotcha. I'll make a quick demo of the solution I'm suggesting to show you what I mean, which won't require any downcasting. |
Didn't implemented quite how I was originally thinking (I didn't consider that I would need a generic where I couldn't have one), but this works without 'static. |
This is done, right? |
ATM, event managers can allow the share of testcases only if all the nodes have the same Input type.
Possible implementations are:
The text was updated successfully, but these errors were encountered: