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

Source code vs. Docker image #25

Open
jose opened this issue Jul 30, 2019 · 2 comments
Open

Source code vs. Docker image #25

jose opened this issue Jul 30, 2019 · 2 comments

Comments

@jose
Copy link
Contributor

jose commented Jul 30, 2019

Hi,

(This is a follow up of issue #19).

The execution of, for example, Nopol on Closure-51 produces a different outcome when executed from the source code or via the provided docker image.

Nopol generates the following patch in a few minutes when executed from RepairThemAll's source code:

+++ b/src/com/google/javascript/rhino/Node.java
@@ -1566,7 +1566,9 @@
       if (diff != null) {
-        return "Node tree inequality:" +
-            "\nTree1:\n" + toStringTree() +
-            "\n\nTree2:\n" + node2.toStringTree() +
-            "\n\nSubtree1: " + diff.nodeA.toStringTree() +
-            "\n\nSubtree2: " + diff.nodeB.toStringTree();
+        if ((node2.type) != (com.google.javascript.rhino.Node.this.type)) {
+          return "Node tree inequality:" +
+          "\nTree1:\n" + toStringTree() +
+          "\n\nTree2:\n" + node2.toStringTree() +
+          "\n\nSubtree1: " + diff.nodeA.toStringTree() +
+          "\n\nSubtree2: " + diff.nodeB.toStringTree();
+        }
       }

However, when Nopol is executed via the provided docker image it crashes:

...
18:14:34.750 [main] INFO  fr.inria.lille.repair.nopol.NoPol - Java version: 1.8.0_111
18:14:34.750 [main] INFO  fr.inria.lille.repair.nopol.NoPol - JAVA_HOME: /usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/
18:14:34.751 [main] INFO  fr.inria.lille.repair.nopol.NoPol - PATH: /usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/:/defects4j/framework/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:206)
	at fr.inria.lille.repair.Main.main(Main.java:106)
Caused by: java.lang.NullPointerException
	at com.gzoltar.core.GZoltar.run(GZoltar.java:51)
	at fr.inria.lille.localization.GZoltarFaultLocalizer.run(GZoltarFaultLocalizer.java:163)
	at fr.inria.lille.localization.GZoltarFaultLocalizer.<init>(GZoltarFaultLocalizer.java:94)
	at fr.inria.lille.localization.GZoltarFaultLocalizer.<init>(GZoltarFaultLocalizer.java:68)
	at fr.inria.lille.localization.GZoltarFaultLocalizer.createInstance(GZoltarFaultLocalizer.java:60)
	at fr.inria.lille.repair.nopol.NoPol.createLocalizer(NoPol.java:179)
	at fr.inria.lille.repair.nopol.NoPol.build(NoPol.java:131)
	at fr.inria.lille.repair.Main$1.call(Main.java:101)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Usage: java -jar nopol.jar
                          [(-m|--mode) <repair|ranking>] (-e|--type) <condition|precondition|pre_then_cond|loop|arithmetic> [(-o|--oracle) <angelic|symbolic>] [(-y|--synthesis) <smt|dynamoth>] [(-l|--solver) <z3|cvc4>] [(-p|--solver-path) <solverPath>] (-s|--source) source1:source2:...:sourceN  (-c|--classpath) <classpath> [(-t|--test) test1:test2:...:testN ] [--complianceLevel <complianceLevel>] [--maxTime <maxTime>] [--maxTimeType <maxTimeType>] [(-z|--flocal) < cocospoon|dumb|gzoltar>] [--output <outputFolder>] [--json[:<outputJson>]]
...

(here is the repair.log file)

The problem does not seem to be due to different classpaths (more info in here), and neither due to a different version of Java 8 (more info in here). The provided docker image might be (somehow) using a different version of Nopol... 🤷🏻‍♂️

--
Best,
Jose

@tdurieux
Copy link
Collaborator

tdurieux commented Aug 1, 2019

It is not a different version of nopol, we never changed it during the experiment and the docker image is really based on the content of this repo.

The error in the Docker image is triggered because no failing test case has been found thus the fault localization is failing.

Are you using oracle jdk locally or openjdk?

@jose
Copy link
Contributor Author

jose commented Aug 2, 2019

Are you using oracle jdk locally or openjdk?

I've tried Oracle JDK and OpenJDK in the Docker image and got the same NullPointerException.

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

2 participants