Skip to content
This repository has been archived by the owner on Feb 23, 2018. It is now read-only.

Exception thrown when running runWithoutDDA on class with clinit methods. #6

Closed
flankerhqd opened this issue Nov 30, 2014 · 1 comment

Comments

@flankerhqd
Copy link

Errors thrown when analyzing apk with clinit, at the step of socket.runWithoutDDA.
Output and traces are as below:

[CRITICAL]####file:/media/DATA/TestWebview.apk#####
[NORMAL]entrypoints--->Set(com.example.testwebview.MainActivity, com.example.testwebview.MyService, com.example.testwebview.TestActivity)
[NORMAL]packagename--->com.example.testwebview
[NORMAL]permissions--->Set(android.permission.INTERNET)
[NORMAL]intentDB------>Map(com.example.testwebview.MainActivity -> Set(component: com.example.testwebview.MainActivity (actions: Set(android.intent.action.MAIN) categorys: Set(android.intent.category.LAUNCHER) datas: schemes= Set() authorities= Set() path= Set() pathPrefix= Set() pathPattern= Set() mimeType= Set())), com.example.testwebview.TestActivity -> Set(component: com.example.testwebview.TestActivity (actions: Set(android.intent.action.MAIN) categorys: Set(android.intent.category.LAUNCHER) datas: schemes= Set() authorities= Set() path= Set() pathPrefix= Set() pathPattern= Set() mithorwmeType= Set())))
[NORMAL]Generate environment for com.example.testwebview.MainActivity
[NORMAL]environment code:
procedure `void` `com.example.testwebview.MainActivity.envMain`(`android.content.Intent` r0 @type `object`) @owner `com.example.testwebview.MainActivity` @signature `Lcom/example/testwebview/MainActivity;.envMain:(Landroid/content/Intent;)V` @Access `STATIC` {
    temp;
    RandomCoinToss;
    head;
    x;
    `com.example.testwebview.MainActivity` r1;
    `android.app.ContextImpl` r2;
    `android.os.Bundle` r3;

  #Label0.

  #Label1.
  #L0. if RandomCoinToss == head  then goto Label13;
  #L1. r1:= new `com.example.testwebview.MainActivity` ;
  #L2. call temp:= `com.example.testwebview.MainActivity.<init>`(r1) @signature `Lcom/example/testwebview/MainActivity;.<init>:()V` @type `direct`;
  #L3. if RandomCoinToss == head  then goto Label12;
  #L4. r2:= new `android.app.ContextImpl` ;
  #L5. call temp:= `android.app.ContextImpl.<init>`(r2) @signature `Landroid/app/ContextImpl;.<init>:()V` @type `direct`;
  #L6. r1.`android.view.ContextThemeWrapper.mBase`:= r2 @type `object`;
  #L7. call temp:= `android.app.Activity.setIntent`(r1, r0) @signature `Landroid/app/Activity;.setIntent:(Landroid/content/Intent;)V` @type `virtual`;
  #Label2.
  #L8. r3:= new `android.os.Bundle` ;
  #L9. call temp:= `android.os.Bundle.<init>`(r3) @signature `Landroid/os/Bundle;.<init>:()V` @type `direct`;
  #L10. call temp:= `com.example.testwebview.MainActivity.onCreate`(r1, r3) @signature `Lcom/example/testwebview/MainActivity;.onCreate:(Landroid/os/Bundle;)V` @type `virtual`;
  #Label3.
  #L11. call temp:= `android.app.Activity.onStart`(r1) @signature `Landroid/app/Activity;.onStart:()V` @type `virtual`;
  #L12. call temp:= `android.app.Activity.onRestoreInstanceState`(r1, r3) @signature `Landroid/app/Activity;.onRestoreInstanceState:(Landroid/os/Bundle;)V` @type `virtual`;
  #L13. call temp:= `android.app.Activity.onPostCreate`(r1, r3) @signature `Landroid/app/Activity;.onPostCreate:(Landroid/os/Bundle;)V` @type `virtual`;
  #Label4.
  #L14. call temp:= `android.app.Activity.onResume`(r1) @signature `Landroid/app/Activity;.onResume:()V` @type `virtual`;
  #L15. call temp:= `android.app.Activity.onPostResume`(r1) @signature `Landroid/app/Activity;.onPostResume:()V` @type `virtual`;
  #Label5.

  #Label6.

  #Label7.
  #L16. if RandomCoinToss == head  then goto Label5;
  #Label8.
  #L17. call temp:= `android.app.Activity.onPause`(r1) @signature `Landroid/app/Activity;.onPause:()V` @type `virtual`;
  #L18. call temp:= `android.app.Activity.onCreateDescription`(r1) @signature `Landroid/app/Activity;.onCreateDescription:()Ljava/lang/CharSequence;` @type `virtual`;
  #L19. call temp:= `android.app.Activity.onSaveInstanceState`(r1, r3) @signature `Landroid/app/Activity;.onSaveInstanceState:(Landroid/os/Bundle;)V` @type `virtual`;
  #L20. if RandomCoinToss == head  then goto Label9;
  #L21. if RandomCoinToss == head  then goto Label4;
  #L22. if RandomCoinToss == head  then goto Label2;
  #Label9.
  #L23. call temp:= `android.app.Activity.onStop`(r1) @signature `Landroid/app/Activity;.onStop:()V` @type `virtual`;
  #L24. if RandomCoinToss == head  then goto Label11;
  #L25. if RandomCoinToss == head  then goto Label10;
  #L26. if RandomCoinToss == head  then goto Label2;
  #Label10.
  #L27. call temp:= `android.app.Activity.onRestart`(r1) @signature `Landroid/app/Activity;.onRestart:()V` @type `virtual`;
  #L28. goto Label3;
  #Label11.
  #L29. call temp:= `android.app.Activity.onDestroy`(r1) @signature `Landroid/app/Activity;.onDestroy:()V` @type `virtual`;
  #L30. if RandomCoinToss == head  then goto Label12;
  #Label12.

  #Label13.

  #Label14.
  #L31. if RandomCoinToss == head  then goto Label0;
  #L32. return @void;
}
[NORMAL]Entry point calculation done.
[CRITICAL]--------------Component Lcom/example/testwebview/MainActivity;.envMain:(Landroid/content/Intent;)V--------------
[CRITICAL]total: 1, oversize: 0, haveResult: 0
[CRITICAL]************************************

java.util.NoSuchElementException: key not found: Entry@(<clinit>,<clinit>)(envMain,L1)
    at scala.collection.MapLike$class.default(MapLike.scala:228)
    at scala.collection.AbstractMap.default(Map.scala:59)
    at scala.collection.mutable.HashMap.apply(HashMap.scala:65)
    at org.sireum.jawa.alir.interProcedural.InterProceduralGraph$$anon$1.scala$collection$mutable$SynchronizedMap$$super$apply(InterProceduralGraph.scala:57)
    at scala.collection.mutable.SynchronizedMap$class.apply(SynchronizedMap.scala:48)
    at org.sireum.jawa.alir.interProcedural.InterProceduralGraph$$anon$1.apply(InterProceduralGraph.scala:57)
    at org.sireum.jawa.alir.controlFlowGraph.InterproceduralControlFlowGraph.getCGEntryNode(InterproceduralControlFlowGraph.scala:632)
    at org.sireum.amandroid.alir.reachingFactsAnalysis.AndroidReachingFactsAnalysisBuilder.checkAndLoadClassFromHierarchy(AndroidReachingFactsAnalysis.scala:89)
    at org.sireum.amandroid.alir.reachingFactsAnalysis.AndroidReachingFactsAnalysisBuilder.org$sireum$amandroid$alir$reachingFactsAnalysis$AndroidReachingFactsAnalysisBuilder$$checkClass(AndroidReachingFactsAnalysis.scala:101)
    at org.sireum.amandroid.alir.reachingFactsAnalysis.AndroidReachingFactsAnalysisBuilder$$anonfun$checkAndLoadClasses$2.apply(AndroidReachingFactsAnalysis.scala:135)
    at org.sireum.amandroid.alir.reachingFactsAnalysis.AndroidReachingFactsAnalysisBuilder$$anonfun$checkAndLoadClasses$2.apply(AndroidReachingFactsAnalysis.scala:123)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at org.sireum.amandroid.alir.reachingFactsAnalysis.AndroidReachingFactsAnalysisBuilder.checkAndLoadClasses(AndroidReachingFactsAnalysis.scala:122)
    at org.sireum.amandroid.alir.reachingFactsAnalysis.AndroidReachingFactsAnalysisBuilder$Gen.apply(AndroidReachingFactsAnalysis.scala:247)
    at org.sireum.jawa.alir.interProcedural.InterProceduralMonotoneDataFlowAnalysisFramework$IMdaf$1.fA(InterProceduralMonotoneDataFlowAnalysisFramework.scala:159)
    at org.sireum.jawa.alir.interProcedural.InterProceduralMonotoneDataFlowAnalysisFramework$IMdaf$1.actionF(InterProceduralMonotoneDataFlowAnalysisFramework.scala:172)
    at org.sireum.jawa.alir.interProcedural.InterProceduralMonotoneDataFlowAnalysisFramework$IMdaf$1.visitForward(InterProceduralMonotoneDataFlowAnalysisFramework.scala:498)
    at org.sireum.jawa.alir.interProcedural.InterProceduralMonotoneDataFlowAnalysisFramework$IMdaf$1.caculateResult(InterProceduralMonotoneDataFlowAnalysisFramework.scala:518)
    at org.sireum.jawa.alir.interProcedural.InterProceduralMonotoneDataFlowAnalysisFramework$IMdaf$1.visit(InterProceduralMonotoneDataFlowAnalysisFramework.scala:523)
    at org.sireum.jawa.alir.interProcedural.InterProceduralMonotoneDataFlowAnalysisFramework$.org$sireum$jawa$alir$interProcedural$InterProceduralMonotoneDataFlowAnalysisFramework$$process$1(InterProceduralMonotoneDataFlowAnalysisFramework.scala:565)
    at org.sireum.jawa.alir.interProcedural.InterProceduralMonotoneDataFlowAnalysisFramework$.build(InterProceduralMonotoneDataFlowAnalysisFramework.scala:591)
    at org.sireum.jawa.alir.interProcedural.InterProceduralMonotoneDataFlowAnalysisFramework$$anonfun$apply$1.apply(InterProceduralMonotoneDataFlowAnalysisFramework.scala:74)
    at org.sireum.jawa.alir.interProcedural.InterProceduralMonotoneDataFlowAnalysisFramework$$anonfun$apply$1.apply(InterProceduralMonotoneDataFlowAnalysisFramework.scala:74)
    at org.sireum.amandroid.alir.reachingFactsAnalysis.AndroidReachingFactsAnalysisBuilder.build(AndroidReachingFactsAnalysis.scala:67)
    at org.sireum.amandroid.alir.reachingFactsAnalysis.AndroidReachingFactsAnalysis$.apply(AndroidReachingFactsAnalysis.scala:665)
    at org.sireum.amandroid.security.AmandroidSocket$$anonfun$runWithoutDDA$1.apply(AmandroidSocket.scala:168)
    at org.sireum.amandroid.security.AmandroidSocket$$anonfun$runWithoutDDA$1.apply(AmandroidSocket.scala:164)
    at scala.collection.Iterator$class.foreach(Iterator.scala:743)
    at scala.collection.parallel.immutable.ParHashSet$ParHashSetIterator.foreach(ParHashSet.scala:77)
    at scala.collection.parallel.ParIterableLike$Foreach.leaf(ParIterableLike.scala:971)
    at scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply$mcV$sp(Tasks.scala:49)
    at scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply(Tasks.scala:48)
    at scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply(Tasks.scala:48)
    at scala.collection.parallel.Task$class.tryLeaf(Tasks.scala:51)
    at scala.collection.parallel.ParIterableLike$Foreach.tryLeaf(ParIterableLike.scala:968)
    at scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask$class.compute(Tasks.scala:152)
    at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$WrappedTask.compute(Tasks.scala:443)
    at scala.concurrent.forkjoin.RecursiveAction.exec(RecursiveAction.java:160)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Test apk at : http://box.myqsc.com/-82089460

@flankerhqd
Copy link
Author

I found it's fixed in develop, so closing it now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant