-
Notifications
You must be signed in to change notification settings - Fork 114
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
having problem fuzzing - due to clojure loading #90
Comments
I'm able to run jqf-zest manually by: <JQF-PATH>/bin/jqf-zest -c .:$(<JQF-PATH>/scripts/classpath.sh):target/test-classes:$(cd src/main/clojure/com/comp && lein with-profile default classpath) examples.CompilerTest testWithString and getting the following output: Semantic Fuzzing with Zest
--------------------------
Test name: examples.CompilerTest#testWithString
Results directory: /home/<username>/java-clojure-example/fuzz-results
Elapsed time: 6s (no time limit)
Number of executions: 982
Valid inputs: 982 (100.00%)
Cycles completed: 0
Unique failures: 0
Queue size: 2 (0 favored last cycle)
Current parent input: 1 (favored) {1/720 mutations}
Execution speed: 756/sec now | 141/sec overall
Total coverage: 745 branches (1.14% of map)
Valid coverage: 745 branches (1.14% of map) but again, cannot do it with |
Thanks for the report! I see the root cause with the Maven plugin is the following:
I don't know much about |
Thanks for the reply! The user@user:java-clojure-example ‹master*›$ mvn test
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< examples:zest-tutorial >-----------------------
[INFO] Building zest-tutorial 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ zest-tutorial ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/<username>/java-clojure-example/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ zest-tutorial ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /home/<username>/java-clojure-example/target/classes
[INFO]
[INFO] --- clojure-maven-plugin:1.8.4:compile (compile 1) @ zest-tutorial ---
Compiling com.comp.src.app.app to /home/<username>/java-clojure-example/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ zest-tutorial ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/<username>/java-clojure-example/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ zest-tutorial ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /home/<username>/java-clojure-example/target/test-classes
[INFO]
[INFO] --- clojure-maven-plugin:1.8.4:testCompile (compile 2) @ zest-tutorial ---
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ zest-tutorial ---
[INFO] Surefire report directory: /home/<username>/java-clojure-example/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running examples.CompilerTest
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.993 sec
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.796 s
[INFO] Finished at: 2020-04-16T07:24:30+03:00
[INFO] ------------------------------------------------------------------------ |
That's very interesting. The JQF Maven plugin just reuses whatever classpath
The TEST resolution scope includes "compile + system + provided + runtime + test dependencies".
Normally, the answer is to add appropriate classpath entries to your |
I've added the clojure library as a dependency in my <dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
<version>1.10.1</version>
</dependency> I've tried debugging the plugin and see the content of <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>default-cli</id>
<phase>test-compile</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<outputDirectory>target/test-classes</outputDirectory>
</configuration>
</execution>
</executions>
</plugin> Another thing I tried to do is to print in the test the classpath using the following code: private void printClasspath() {
ClassLoader cl = ClassLoader.getSystemClassLoader();
URL[] urls = ((URLClassLoader)cl).getURLs();
for(URL url: urls){
System.out.println(url.getFile());
}
} And I get |
Hi,
I'm implementing a small java project which load and run clojure scripts on runtime.
I works fine.
I want to use jqf:fuzz to fuzz my application.
So i copied the files from the compiler tutorial of jqf and google closure compiler and modified it to my specs.
The project exists in here.
To run my program:
to fuzz:
the output:
the reproduction:
i'm running on ubuntu 18.04 64 bit, java 8
Thanks!
The text was updated successfully, but these errors were encountered: