More Details on Soot and -allow-phantom-refs

In the previous post I mentioned that I’m trying to create a call graph of all of DrJava using Soot. Since DrJava is a cross-platform application, there are classes that get compiled and used only on certain operating systems. The classes in the package, for instance, are only used on the Mac.

That means that Soot doesn’t normally find these classes when generating the call graph with Sun JDKs:

resolving [from .class]: edu.rice.cs.drjava.platform.MacPlatform$1
Exception in thread "main" java.lang.RuntimeException:
couldn't find class:
(is your soot-class-path set properly?)
    at soot.SootResolver.bringToHierarchy(
    at soot.SootResolver.bringToSignatures(
    at soot.SootResolver.bringToBodies(
    at soot.SootResolver.processResolveWorklist(
    at soot.SootResolver.resolveClass(
    at soot.Scene.loadClass(
    at soot.Scene.loadClassAndSupport(
    at soot.Scene.loadNecessaryClasses(
    at soot.Main.main(

Setting the Soot -allow-phantom-refs option doesn’t really help; it gets past the initial stages, but later still has errors:

Exception in thread "main" soot.AbstractSootMethodRef$ClassResolutionFailedException:
Class doesn't have method setHandled([boolean]) : void;
failed to resolve in superclasses and interfacesLooking in
which has methods []
    at soot.AbstractSootMethodRef.resolve(
    at soot.AbstractSootMethodRef.resolve(
    at soot.jimple.internal.AbstractInvokeExpr.getMethod(
    at soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.getImplicitTargets
    at soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processNewMethod
    at soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.processReachables
    at soot.jimple.toolkits.callgraph.CHATransformer.internalTransform(
    at soot.SceneTransformer.transform(
    at soot.SceneTransformer.transform(
    at soot.SceneTransformer.transform(
    at dk.brics.soot.callgraphs.CallGraphExample$2.internalTransform(
    at soot.SceneTransformer.transform(
    at soot.Transform.apply(
    at soot.ScenePack.internalApply(
    at soot.Pack.apply(
    at soot.PackManager.runWholeProgramPacks(
    at soot.PackManager.runPacks(
    at soot.Main.main(

What I did instead was make the Apple classes available on Windows and Linux as well, just on the Soot classpath (they aren’t actually loaded by the JVM), but then I run into an 8-year-old Java bug in the garbage collector. Fixing Soot is more likely than fixing the JVM.


After checking out Soot from the svn repository and building it from scratch, the Soot problem has gone away, but now I still run into the 8-year-old Java bug in the garbage collector.


About Mathias

Software development engineer. Principal developer of DrJava. Recent Ph.D. graduate from the Department of Computer Science at Rice University.
This entry was posted in Concurrent Unit Testing, DrJava. Bookmark the permalink.

One Response to More Details on Soot and -allow-phantom-refs

  1. Pingback: A Concurrent Affair » Blog Archive » Soot Build Instructions

Leave a Reply