[Soot-list] [Paddle] No method void register(java.lang.Object) in class java.lang.ref.Finalizer

Ondrej Lhotak olhotak at uwaterloo.ca
Wed Sep 26 09:56:40 EDT 2007


The Sun VM, whenever it creates an object with a finalize method, calls
register(), passing in that object. This method puts the object on a
queue of objects to be finalized when they are garbage collected.

Replacing the register() method with runFinalization() will not work,
because runFinalization() does not have a parameter, but Paddle will
simulate passing the newly-created object to the method.

The proper solution is to determine what mechanism the IBM VM uses to
ensure that finalize methods are called, then simulate that mechanism
in Paddle.

A simpler but unsound workaround is to remove the code that adds the
FINALIZE edge to the register method. As a result, Paddle will not
include finalize() methods in the call graph and will ignore their
effects. This is unsound, but hopefully only a little bit.

Ondrej

On Tue, Sep 25, 2007 at 10:21:00PM +0800, Yao Qi wrote:
> 
> Soot developers,
> 
> When I run Paddle(nightly build) on IBM JDK, I get such error,
> 
> [20:38][qiyao at qiyaows:~/SourceCode/Soot/soot-2708/tutorial/guide/examples/poi
> ntsto/bin]$ java -cp .:../lib/polyglot-1.3.3.jar:../lib/sootclasses.jar:../li
> b/paddle-20070925.jar:../lib/jedd-runtime.jar dk.brics.paddle.PointsToAnalysis paddle Test1
> [paddle] Starting analysis ...
> Soot version string: 2.2.3
> Exception in thread "main" java.lang.RuntimeException: No method void register(java.lang.Object) in class java.lang.ref.Finalizer
>         at soot.SootClass.getMethod(SootClass.java:299)
>         at soot.jimple.paddle.TradStaticCallBuilder.processMethod(TradStaticCallBuilder.java:200)
>         at soot.jimple.paddle.TradStaticCallBuilder.update(TradStaticCallBuilder.java:44)
>         at soot.jimple.paddle.DependencyManager.update(DependencyManager.java:76)
>         at soot.jimple.paddle.OFCGScene.solve(OFCGScene.java:168)
>         at soot.jimple.paddle.OFCGConfig.solve(OFCGConfig.java:35)
>         at soot.jimple.paddle.PaddleScene.solve(PaddleScene.java:1390)
>         at soot.jimple.paddle.PaddleTransformer.solve(PaddleTransformer.java:99)
>         at dk.brics.paddle.PointsToAnalysis.setPaddlePointsToAnalysis(PointsToAnalysis.java:139)
>         at dk.brics.paddle.PointsToAnalysis.main(PointsToAnalysis.java:62)
> 
> 
> I checked java.lang.ref.Finalizer in IBM JDK, and find that there is no
> such method register(Object), while there is such method in SUN
> JDK.  (This case could work on SUN JDK)
> 
> Can I replace 
> 
> protected final NumberedString sigRegister = Scene.v().getSubSigNumberer().
>         findOrAdd( "void register(java.lang.Object)" );
> 
> by 
> 
> protected final NumberedString sigRegister = Scene.v().getSubSigNumberer().
>         findOrAdd( "void runFinalization()" );
> 
> in soot.jimple.paddle.TradStaticCallBuilder?
> 
> Because, runFinalization() could be found in both SUN IDK and IBM JDK.
> 
> I am a newbie on Paddle and point-to analysis, and just want to make
> this example run at first.  Not sure that this change brings problems 
> to Paddle or not.  Any comments?  Thanks.
> 
> Best Regards
> 
> -- 
> Yao Qi <qiyaoltc AT gmail DOT com>    GNU/Linux Developer
> http://duewayqi.googlepages.com/
> 
> linux: No such file or directory
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> 


More information about the Soot-list mailing list