ishaq / OPA

Efficient MPC via Program Analysis: A Framework for Efficient Optimal Mixing
MIT License
5 stars 1 forks source link

Running Test.java #1

Closed hamsterz0 closed 4 years ago

hamsterz0 commented 4 years ago

Hi,

When I run Tests.java, I get the following error.

mixedProtocolsAnalysis.UnsupportedFeatureException: Can't handle the node: r3 = (MPCAnnotationImpl) r1

This happens here at Analysis.java Line:300

if(n.nodeType == Node.NodeType.INVALID_NODE) { throw new UnsupportedFeatureException("Can't handle the node: " + u); }

I tried going over the code line by line but couldn't find the exact reason why we are getting an INVALID_NODE.

This is being tried on the GCD example. Kmeans also gives a similar error, where some node type is INVALID_NODE.

Any idea how I can fix this error or where I might be going wrong?

Thank you, Sincerely, hamsterz0

hamsterz0 commented 4 years ago

mixedProtocolsAnalysis.UnsupportedFeatureException: Can't handle the node: r3 = (MPCAnnotationImpl) r1
    at mixedProtocolsAnalysis.Analysis.verifyAllNodesAreValid(Analysis.java:293)
    at mixedProtocolsAnalysis.Analysis.internalTransform(Analysis.java:196)
    at soot.BodyTransformer.transform(BodyTransformer.java:51)
    at soot.Transform.apply(Transform.java:120)
    at soot.BodyPack.internalApply(BodyPack.java:50)
    at soot.Pack.apply(Pack.java:125)
    at soot.PackManager.runBodyPacks(PackManager.java:989)
    at soot.PackManager.lambda$runBodyPacks$0(PackManager.java:660)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Unhandled expr: (MPCAnnotationImpl) r1 of type: class soot.jimple.internal.JCastExpr
inside method: <P: void <init>()>
Soot finished on Fri Jan 17 18:12:42 PST 2020
Soot has run for 0 min. 21 sec.

java.lang.RuntimeException: the results map is empty

    at mixedProtocolsAnalysis.Analysis.showResult(Analysis.java:241)
    at mixedProtocolsAnalysis.Main.main(Main.java:38)
    at mixedProtocolsAnalysis.Tests.test2(Tests.java:59)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at junit.framework.TestCase.runTest(TestCase.java:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:243)
    at junit.framework.TestSuite.run(TestSuite.java:238)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

This is the entire error message that I'm getting.

ishaq commented 4 years ago

hmm. looks like the java compiler is inserting a JCast instruction for MPCAnnotationImpl. are you running it on a compiled .class file or source java?

ishaq commented 4 years ago

I just did a clone on a new machine and have started seeing the same error. In fact, now running Soot on compiled .class files produces even more exceptions. The issue has to do with Java SDK updates and this project using an older Soot. I'll investigate it further and get back.

ishaq commented 4 years ago

I just updated the soot jar. Please compile your test programs to a .class file first (in this case javac P.java inside the GCD or kmeans directory). It would save you a few of the errors due to incompatibility between installed java and soot front end.

It should work now, let me know if it doesn't.

note to self: use Maven or some other dependency management tool for jars.

hamsterz0 commented 4 years ago

It works now! Thanks. :-)

Best, Arnav Garg