nus-apr / cerberus

Research Acceleration Platform that provides interface to multiple state-of-the-art program analysis tools including but not limited to fuzzing, static analysis and program repair.
MIT License
66 stars 30 forks source link

Nopol Defects4j JUnit Jar missing #203

Open NietroMiner00 opened 3 days ago

NietroMiner00 commented 3 days ago

Hello,

I tried to run the defects4j benchmark with the nopol repair tool on Bug ID 1. Cerberus runs without errors, but later in the logs of the container, it seems like JUnit binaries are missing. How could one resolve that?

To even come to this point, I had to checkout the master branch of defects4j, as the metadata was incompatible, like in #201 comment and change the groupid to 999 like in this comment.

This is the only combination of repair tool and benchmark I even got to work. Everything else is also running into incompatible metadata or undescriptive errors, when starting from a fresh git clone with ssh. HTTPs cloning did not work, like described in #38.

We would really appreciate your help. Thanks in advance! Let me know, if you need more information to resolve this bug.

Here are the logs:

TP1-nopol-Chart-1-output.log

Tue 19 Nov 2024 13:53:51 PM
java.lang.IllegalArgumentException: File does not exist in: '/experiment/defects4j/Chart/Chart-1/deps/lib/junit-4.11.jar'
    at xxl.java.library.FileLibrary.fail(FileLibrary.java:129)
    at xxl.java.library.FileLibrary.openFrom(FileLibrary.java:29)
    at xxl.java.library.FileLibrary.urlFrom(FileLibrary.java:100)
    at xxl.java.library.JavaLibrary.classpathFrom(JavaLibrary.java:84)
    at fr.inria.lille.repair.Main.main(Main.java:37)

Simulation:
-----------
    $ java -cp <nopol-jar-file> fr.inria.lille.repair.nopol.NoPolLauncher z3|cvc4 <solver-path>

NOTE: This simulation looks for a folder named "/misc" in the same location as the jar file. 

Loop analysis
-------------
    $ java -cp <nopol-jar-file> fr.inria.lille.repair.infinitel.InfinitelDiagnostician <source path> <class path>

Execution:
----------
    $ java -jar <nopol-jar-file> infinitel <source path> <class path> z3|cvc4 <solver-path> [iteration-limit]

    $ java -jar <nopol-jar-file> nopol <source path> <class path> z3|cvc4 <solver-path> [<test-class-name>...]

References:
-----------
-    <nopol-jar-file>   path to nopol *.jar file
-    <source path>      path to file/folder containing source code to be fixed
-    <class path>       path(s) to folder(s) with class files (separated by colon ':')
-    z3|cvc4            either one of these solvers
-    <solver-path>      path to chosen solver binary

Tue 19 Nov 2024 13:53:52 PM
Marti2203 commented 3 days ago

Hi, The current master branch uses a new benchmark metadata format, and I haven't had time to update all the benchmarks to conform to it. Commit 9cbb0400 is a stable version that works with the old dataset format. In relation to the Defects4J issue, I will try to push a patch today that copies over the dependencies from the benchmark into the corresponding directory.

NietroMiner00 commented 2 days ago

Commit 9cbb040 is a stable version that works with the old dataset format.

Thank you very much. This information is gold. Maybe I didn't see it, when this stood somewhere else, but when not, this should maybe be written into the README or tagged as stable release.

Another thing, is there some documentation on which bugs are patchable by which tool and how long it takes? I tried all bugs, that are presented in the examples, but none generate a patch. I assume that is also not right.

This is the log file from one repair I tried with extractfix and volnloc bug 1: log-Nov_22_14_07.log

Marti2203 commented 1 day ago

Hi, In relation to the ExtractFix issue - Vulnloc's dependencies were documented in a deps.sh script which is invoked when an image is built. In the case of ExtractFix, they override the tool's custom packages and break it. On the dev branch I will push a commit that disables the installation for ExtractFix.