ishaq / OPA

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

Example Analysis Failed to run on Windows 10 #5

Closed yuquan1210 closed 2 years ago

yuquan1210 commented 2 years ago

I have imported the project onto Eclipse as specified, and modified default RT_PATH and JCE_PATH according to their locations on my system, but the following command still failed. Some discussions online suggest that Soot cannot handle classpath format like "-cp C:/A.jar:C:/B.jar" on Windows. Do you have any suggestion fix for it? Thank you!

Path modified in Main.java: RT_PATH = "C:\Program Files\Java\jre1.8.0_311\lib\rt.jar"; JCE_PATH = "C:\Program Files\Java\jre1.8.0_311\lib\jce.jar";

Command used: ./gradlew run --args='-c P -cp C:\Users\86138\Documents\GitHub\OPA\analysis-project\src\test\resources\programs\gcd\'

Error Message:

Task :run FAILED CLASSPATH: C:\Users\86138\Documents\GitHub\OPA\analysis-project\src\test\resources\programs\gcd\:C:\Program Files\Java\jre1.8.0_311\lib\rt.jar:C:\Program Files\Java\jre1.8.0_311\lib\jce.jar CLASS: P 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. Soot started on Sun Feb 20 17:54:03 EST 2022 soot.CompilationDeathException: Couldn't resolve classpath entry C:\Users\86138\Documents\GitHub\OPA\analysis-project\src\test\resources\programs\gcd\:C:\Program Files\Java\jre1.8.0_311\lib\rt.jar:C:\Program Files\Java\jre1.8.0_311\lib\jce.jar: java.io.IOException: ???????????????? at soot.SourceLocator.explodeClassPath(SourceLocator.java:167) at soot.SourceLocator.getClassSource(SourceLocator.java:178) at soot.Scene.tryLoadClass(Scene.java:959) at soot.Scene.loadBasicClasses(Scene.java:1700) at soot.Scene.loadNecessaryClasses(Scene.java:1799) at soot.Main.run(Main.java:241) at soot.Main.main(Main.java:141) at mixedProtocolsAnalysis.Main.performAnalysis(Main.java:68) at mixedProtocolsAnalysis.Main.main(Main.java:136)

yuquan1210 commented 2 years ago

There is also the following issue after the project was imported onto Eclipse. Not sure whether the two issues are related. Snipaste_2022-02-20_18-10-21

ishaq commented 2 years ago

For the first issue, Try using relative paths?

Regarding errors in Eclipse: all errors seems to stem from the test programs. I would not care too much if gradle works fine e.g. test the command

./gradlew run --args='-c P -cp ./src/test/resources/programs/gcd' 

If that works fine, then ignore Eclipse errors.

yuquan1210 commented 2 years ago

Problem solved. There are two things to note: One is that in Windows, the classpath separator should be ';' instead of ':', and use single backslash. Second, test programs must be compiled into .class file before testing.

ishaq commented 2 years ago

ah, right.

yeah, I am aware of the second problem. I think I have also mentioned this in the ReadMe.