Skip to content
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

Set the -max_len argument in junit #885

Open
svdbtno opened this issue Nov 22, 2023 · 4 comments
Open

Set the -max_len argument in junit #885

svdbtno opened this issue Nov 22, 2023 · 4 comments

Comments

@svdbtno
Copy link

svdbtno commented Nov 22, 2023

We want to have more data available in the FuzzedDataProvider. Currently we only receive very few bytes. We would like to receive more therefore we want to set the -max_len for libFuzzer.
We currently get the following info log= INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes.

We tried setting it using the following command: JAZZER_FUZZ=1 mvn test -Dtest=ourTest#testMethod -Djazzer.internal.args.0="-max_len=50000" and we tried JAZZER_FUZZ=1 mvn test -Dtest=ourTest#testMethod -Dmax_len=50000 both did not work. Any suggestions?

PS. jazzer.internal.args.0 is used, since we saw the following:

private static List<String> getLibFuzzerArgs(ExtensionContext extensionContext) {
List<String> args = new ArrayList<>();
for (int i = 0; ; i++) {
Optional<String> arg = extensionContext.getConfigurationParameter("jazzer.internal.arg." + i);
if (!arg.isPresent()) {
break;
}
args.add(arg.get());
}
return args;
}

@yawkat
Copy link
Contributor

yawkat commented Dec 19, 2023

the junit integration in general is missing a bunch of features that make it unusable for some of our fuzz targets. e.g. setting the instrumented classes or the corpus.

It would be nice to have some generic, non-internal way of adding jazzer parameters to a FuzzTest.

@ramzanzan
Copy link

Add into junit-platform.properties lines:
jazzer.internal.arg.0=fakeArgv
jazzer.internal.arg.1=-lib_fuzzer_opt1=val1
jazzer.internal.arg.2=-lib_fuzzer_opt2=val2

@ghost
Copy link

ghost commented Feb 26, 2024

@yawkat - Good feedback!
Sorry for our late reply. We made some strategic changes and pivoted to working on Jazzer updates as closed source only. We can give you more detailed support on a call/over email and try other options for you. Just need to understand in detail what you are trying to achieve, and we can give the best options to solve.
Ping me? david[dot]merian [at] code-intelligence[dot]com

@ghost
Copy link

ghost commented Feb 26, 2024

@ramzanzan and @svdbtno - same as I wrote to @yawkat above, happy to chat with you all too about your specific wishes/challenges!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants