[Soot-list] problem of points-to analysis using Spark when there is new String()

aiwu shi aiwu_shi at hotmail.com
Mon Dec 26 22:20:11 EST 2005


hi, 
    I am using Spark for points-to analysis,  in general, I can get correct result, but, there is a Exception when there is a new String() statement in the analyzed class. somebody can help solve this problem.
thanks
 
   Aiwu 

the Exception: 
Exception in thread "main" soot.AbstractSootMethodRef$ClassResolutionFailedException: Class java.lang.String$CaseInsensitiveComparator doesn't have method <init>([java.lang.String$1]) : void; failed to resolve in superclasses and interfacesLooking in java.lang.String$CaseInsensitiveComparator which has methods []

 at soot.AbstractSootMethodRef.resolve(AbstractSootMethodRef.java:136)
 at soot.AbstractSootMethodRef.resolve(AbstractSootMethodRef.java:95)
 at soot.jimple.internal.AbstractInvokeExpr.getMethod(AbstractInvokeExpr.java:55)
 at soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.getImplicitTargets(OnFlyCallGraphBuilder.java:235)
 at soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processNewMethod(OnFlyCallGraphBuilder.java:183)
 at soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processReachables(OnFlyCallGraphBuilder.java:81)
 at soot.jimple.spark.solver.OnFlyCallGraph.build(OnFlyCallGraph.java:69)
 at soot.jimple.spark.builder.ContextInsensitiveBuilder.build(ContextInsensitiveBuilder.java:78)
 at soot.jimple.spark.SparkTransformer.internalTransform(SparkTransformer.java:53)
 at soot.SceneTransformer.transform(SceneTransformer.java:39)
 at TestMain.main(TestMain.java:67)


my main class is:
public static void main(String[] args)  {
  Map options = new HashMap();
  SootField temp = null;
  List mList=new ArrayList();
  
    
        //load the analyzed class into Scene
  SootClass sc = Scene.v().loadClassAndSupport("SampleClass");
  sc.setApplicationClass();
    
  System.out.println(Scene.v().getApplicationClasses());
  System.out.println(Scene.v().getSootClassPath());
  Scene.v().setEntryPoints(sc.getMethods());
  
       
  //set the PointsToAnalysis with phase options
  options.put("enabled", "true");
  options.put("on-fly-cg", "true");
  options.put("set-impl", "hybrid");
  options.put("propagator", "worklist");
  options.put("verbose", "true");
  
  SparkTransformer.v().transform("cg.spark",options);
    ..............
...............

my analyzed SampleClass is:
public class SampleClass {
 static C z;
 public C f;
 
 public C f2(int i){
  C x;
  C y;
  String str=new String();    //if delete this statement, it works, if add it, the exception above is throw.
  x = new C();
  return x;
 }
 
 }


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20051226/055e6ead/attachment.htm


More information about the Soot-list mailing list