soot-oss / SootUp

A new version of Soot with a completely overhauled architecture
https://soot-oss.github.io/SootUp/
GNU Lesser General Public License v2.1
586 stars 78 forks source link

Integrate WALA's frontend #37

Closed linghuiluo closed 5 years ago

linghuiluo commented 6 years ago

@juliandolby AstMethod.getNumberOfParameters throws NullPointerException if symtab is null.
I will post all issues from WALA i find during implementation in this thread. I

linghuiluo commented 6 years ago

@juliandolby AbstractCFG.getInstructions() returns an array which can contain null.

@linghuiluo That should be true only for abstract methods, which do not have IR. There is an isAbstract() method that should tell you which methods are abstract.

linghuiluo commented 6 years ago

@juliandolby I checked wala from the master branch and ran mvn install -Dskip.Tests. I got the following error.


[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] WALA 1.5.1-SNAPSHOT ................................ SUCCESS [  2.176 s]
[INFO] targets ............................................ SUCCESS [  0.060 s]
[INFO] e47 ................................................ SUCCESS [  0.509 s]
[INFO] com.ibm.wala.util .................................. SUCCESS [ 12.850 s]
[INFO] com.ibm.wala.shrike ................................ SUCCESS [  8.153 s]
[INFO] com.ibm.wala.core .................................. SUCCESS [ 25.855 s]
[INFO] com.ibm.wala.cast .................................. SUCCESS [ 16.915 s]
[INFO] com.ibm.wala.cast.java ............................. SUCCESS [  3.678 s]
[INFO] com.ibm.wala_feature ............................... SUCCESS [  0.309 s]
[INFO] com.ibm.wala.core.testdata ......................... FAILURE [  9.156 s]
[INFO] com.ibm.wala.cast.java.ecj ......................... SKIPPED
[INFO] com.ibm.wala.ide ................................... SKIPPED
[INFO] com.ibm.wala.ide.jdt ............................... SKIPPED
[INFO] com.ibm.wala.core.tests ............................ SKIPPED
[INFO] com.ibm.wala.cast.test ............................. SKIPPED
[INFO] com.ibm.wala.cast.java.test ........................ SKIPPED
[INFO] com.ibm.wala.cast.java.test.data ................... SKIPPED
[INFO] com.ibm.wala.ide_feature ........................... SKIPPED
[INFO] com.ibm.wala.ide.tests ............................. SKIPPED
[INFO] com.ibm.wala.ide.jdt.test .......................... SKIPPED
[INFO] com.ibm.wala.cast.js ............................... SKIPPED
[INFO] com.ibm.wala.cast.js.rhino ......................... SKIPPED
[INFO] com.ibm.wala.cast.js.test.data ..................... SKIPPED
[INFO] com.ibm.wala.cast.js.test .......................... SKIPPED
[INFO] com.ibm.wala.cast.js.rhino.test .................... SKIPPED
[INFO] com.ibm.wala.cast.js.html.nu_validator ............. SKIPPED
[INFO] com.ibm.wala.cast.js.nodejs ........................ SKIPPED
[INFO] com.ibm.wala.cast.js.nodejs.test ................... SKIPPED
[INFO] com.ibm.wala.ide.jsdt .............................. SKIPPED
[INFO] com.ibm.wala.ide.jsdt.tests ........................ SKIPPED
[INFO] com.ibm.wala.dalvik ................................ SKIPPED
[INFO] com.ibm.wala.dalvik.test ........................... SKIPPED
[INFO] com.ibm.wala.scandroid ............................. SKIPPED
[INFO] com.ibm.wala-repository 1.5.1-SNAPSHOT ............. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:47 min
[INFO] Finished at: 2018-10-19T12:08:48+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (default) on project com.ibm.wala.core.testdata: An Ant BuildException has occured: The following error occurred while executing this line:
[ERROR] /Users/linghui/Documents/WALA/com.ibm.wala.core.testdata/build.xml:118: Execute failed: java.io.IOException: Cannot run program "wget" (in directory "/Users/linghui/Documents/WALA/com.ibm.wala.core.testdata/temp.folder"): error=2, No such file or directory
[ERROR] around Ant part ...<ant antfile="/Users/linghui/Documents/WALA/com.ibm.wala.core.testdata/build.xml" target="build.update.jar"/>... @ 5:112 in /Users/linghui/Documents/WALA/com.ibm.wala.core.testdata/target/antrun/build-main.xml
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :com.ibm.wala.core.testdata
juliandolby commented 6 years ago

Try again. That fetch seems to cause trouble sometimes.

On Fri, Oct 19, 2018, 06:15 Linghui Luo notifications@github.com wrote:

@juliandolby https://github.com/juliandolby I checked wala from the master branch and ran mvn install -Dskip.Tests. I got the following error.

[INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] WALA 1.5.1-SNAPSHOT ................................ SUCCESS [ 2.176 s] [INFO] targets ............................................ SUCCESS [ 0.060 s] [INFO] e47 ................................................ SUCCESS [ 0.509 s] [INFO] com.ibm.wala.util .................................. SUCCESS [ 12.850 s] [INFO] com.ibm.wala.shrike ................................ SUCCESS [ 8.153 s] [INFO] com.ibm.wala.core .................................. SUCCESS [ 25.855 s] [INFO] com.ibm.wala.cast .................................. SUCCESS [ 16.915 s] [INFO] com.ibm.wala.cast.java ............................. SUCCESS [ 3.678 s] [INFO] com.ibm.wala_feature ............................... SUCCESS [ 0.309 s] [INFO] com.ibm.wala.core.testdata ......................... FAILURE [ 9.156 s] [INFO] com.ibm.wala.cast.java.ecj ......................... SKIPPED [INFO] com.ibm.wala.ide ................................... SKIPPED [INFO] com.ibm.wala.ide.jdt ............................... SKIPPED [INFO] com.ibm.wala.core.tests ............................ SKIPPED [INFO] com.ibm.wala.cast.test ............................. SKIPPED [INFO] com.ibm.wala.cast.java.test ........................ SKIPPED [INFO] com.ibm.wala.cast.java.test.data ................... SKIPPED [INFO] com.ibm.wala.ide_feature ........................... SKIPPED [INFO] com.ibm.wala.ide.tests ............................. SKIPPED [INFO] com.ibm.wala.ide.jdt.test .......................... SKIPPED [INFO] com.ibm.wala.cast.js ............................... SKIPPED [INFO] com.ibm.wala.cast.js.rhino ......................... SKIPPED [INFO] com.ibm.wala.cast.js.test.data ..................... SKIPPED [INFO] com.ibm.wala.cast.js.test .......................... SKIPPED [INFO] com.ibm.wala.cast.js.rhino.test .................... SKIPPED [INFO] com.ibm.wala.cast.js.html.nu_validator ............. SKIPPED [INFO] com.ibm.wala.cast.js.nodejs ........................ SKIPPED [INFO] com.ibm.wala.cast.js.nodejs.test ................... SKIPPED [INFO] com.ibm.wala.ide.jsdt .............................. SKIPPED [INFO] com.ibm.wala.ide.jsdt.tests ........................ SKIPPED [INFO] com.ibm.wala.dalvik ................................ SKIPPED [INFO] com.ibm.wala.dalvik.test ........................... SKIPPED [INFO] com.ibm.wala.scandroid ............................. SKIPPED [INFO] com.ibm.wala-repository 1.5.1-SNAPSHOT ............. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:47 min [INFO] Finished at: 2018-10-19T12:08:48+02:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (default) on project com.ibm.wala.core.testdata: An Ant BuildException has occured: The following error occurred while executing this line: [ERROR] /Users/linghui/Documents/WALA/com.ibm.wala.core.testdata/build.xml:118: Execute failed: java.io.IOException: Cannot run program "wget" (in directory "/Users/linghui/Documents/WALA/com.ibm.wala.core.testdata/temp.folder"): error=2, No such file or directory [ERROR] around Ant part ...... @ 5:112 in /Users/linghui/Documents/WALA/com.ibm.wala.core.testdata/target/antrun/build-main.xml [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :com.ibm.wala.core.testdata

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/secure-software-engineering/soot-reloaded/issues/37#issuecomment-431315816, or mute the thread https://github.com/notifications/unsubscribe-auth/ABk3fguIkmy_nSQmQveuRCgErysMj8mpks5umaZbgaJpZM4VarcZ .

linghuiluo commented 6 years ago

JavaSourceAnalysisScope.setExclusions doesn't work with a exclusion file

@linghuiluo I have pushed changes so that now it should work.

juliandolby commented 6 years ago

it looks like you do not have wget, based on those error messages.

juliandolby commented 6 years ago

you are right about exclusions. i will fix that.

linghuiluo commented 6 years ago

@juliandolby SSAConditionalBranchInstruction.getType() returns null.

linghuiluo commented 6 years ago

@juliandolby add API for getting type information of uses and def in instructions.

linghuiluo commented 6 years ago

@juliandolby add support for converting EngclosingObjectReference

linghuiluo commented 6 years ago

@juliandolby add API for getting byte code style class names.

linghuiluo commented 6 years ago

@juliandolby "AstMethod.getNumberOfParameters" throws NullPointerException when symbolTable is null, should return 0 for such case.

@linghuiluo hmm... it definitely should not crash, but should it return 0? It is probably an abstract method, and should likely get its argument count from its method descriptor...

linghuiluo commented 6 years ago

@juliandolby SSACheckCastInstruction.getDeclaredResultTypes() returns wrong type of the result. You can run this de.upb.soot.frontends.SelectedInstructionConverstionTest.testCheckCastInstruction() as an example. In this example, the method SSACheckCastInstruction.getDeclaredResultTypes() should returns javaonepointfive.EnumSwitch$Palo, but it returns java.lang.Enum

@linghuiluo This example is complicated by the bizarre type erasure rules in how Java 5+ is translated. Do you know if we see the same bad behavior for an ordinary cast expression?

linghuiluo commented 6 years ago

@juliandolby use symbolTable to reture type information and modifier.

linghuiluo commented 5 years ago

@juliandolby wala source code front end generates a SSASwitchInstruction with iindex 3 and the target of a case points to itself for wala test class bugfixes.VarDeclInSwitch.java