[Soot-list] Java 1.4 libraries and native methods

Ondrej LHOTAK olhotak at sable.mcgill.ca
Thu Feb 10 15:11:49 EST 2005


On Thu, Feb 10, 2005 at 11:38:22AM -0800, Manu Sridharan wrote:
> Hi,
> 
> It seems that the native method models in Soot (those in 
> soot.jimple.toolkits.pointer.nativemethods) are not for the Java 1.4 

That's correct; they are for the Java 1.3 libraries.

> libraries.  For example, java.lang.Class.newInstance0 is not a native 
> method in 1.4, but 
> sun.reflect.NativeConstructorAccessorImpl.newInstance0 is a native 
> method and is not modelled by Soot.  Is there any desire to update the 
> models to the 1.4 libraries, or will they be left in sync with the 1.3 
> libraries?  I'm guessing the 1.5 libraries might also be slightly 
> different than 1.4, so I'm not sure what the plan would be as far as 
> changing the models.  I'm glad to contribute to any planned update.  Thanks!

In anticipation of such an update, I have recently added the jdkver
option in the development version of Soot, which is intended to be used
to specify the library version being analyzed so that the correct
native method simulations can be selected. However, I don't foresee
having time to implement the simulations for 1.4 or 1.5 myself in the
near future, and I don't know of anyone else here interested in the
task. I would very much welcome a contribution of simulations of the
native methods in 1.4 or 1.5, even of only a subset of the methods.

I've thought a little bit about making the process of specifying
the effects of native methods easier and more general by building a
framework in which one simulates native methods by writing Jimple code
for them, rather than calling methods in the current NativeHelper. Since
some effects of native methods are unlikely to be expressible in Jimple,
these effects would still have to be handled specially by any analysis,
but hopefully there would only be a small number of them. However, this
whole idea is only in the idea stage, and it's probably more productive
to just try to simulate the effects of 1.4/1.5 native methods using the
current infrastructute, and only look at changing it once we come across
something that is not easily expressible.

Ondrej

> 
> -Manu
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://www.sable.mcgill.ca/mailman/listinfo/soot-list


More information about the Soot-list mailing list