[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Type Error (12) occurs at specific classes.
Hello.
I got "Type Error(12)" and some strange err messgage like "$stack1#6[java.lang.Object(1)<->XXX(21)]". (XXX is phantom class in our example)
We tested our analyzer on thousands classes, it worked well. but for some classes, this error(Type Error(12)) occured. and they are all XXXXXX_Stub classes generated by EJB server(IBM websphere). And these _Stub classes heavily depend on java reflection and RMI(Remote method invoke).
Following is source code that cause Type Error(12) when soot try to get this class's method body by soot.SootMethod.retrieveActiveBody. In testing environment, com.ibm.ejs.wlm.client.WLMClientImpl is Phantom class. (at Class.forName("com.ibm.ejs.wlm.client.WLMClientImpl");)
// DO NOT MODIFY - This file generated by wlmsg.
public final class _ContractSession_Stub extends _ContractSession_BaseStub {
public static final int __wlmsgMarkerField__ = 0;
private transient boolean initialized = false;
private transient String _WLM_sid = null;
transient Object wlmClient = null;
// We auto-initialize on the first method call
// rather than do the initialize in the constructor
// since all user key in the stub's IOR, which we need
// is not available until the constructor completes.
private synchronized void initializeOnce() {
if (!initialized) {
initialized = true;
try {
Class wlmClass = Class.forName("com.ibm.ejs.wlm.client.WLMClientImpl");
java.lang.reflect.Method m = wlmClass.getMethod("getInstance", null);
wlmClient = m.invoke(null, null);
_WLM_sid = ((com.ibm.ejs.wlm.client.WLMClient) wlmClient).initialize(this, TelematicsContractSession.class);
} catch (Exception e) {
}
}
}
I searched it on this mailling list. and found following.
"This error means that there is not enough information about the type
hierarchy to even construct the Jimple. --Ondrej", http://www.sable.mcgill.ca/listarchives/soot-list/msg00620.html
I think some phantom classes cause this problem.
I know this occur during process to decide type of local variables. but, Intra method analysis is enought for my purpose. and the analysis doesn't need type information except some types (String and StringBuffer). So typing for unknown type is not essential for my purpose.
Is there any way to skip typing for Unknown type? Is there any workaround for this problem?
Sincerely yours.
PS. Following is full error message.
Warning: com.ibm.ejs.wlm.client.WLMClient is a phantom class!
Warning: com.sun.corba.ee.internal.util.JDKBridge is a phantom class!
(com.ibm.ejs.wlm.client.WLMClient) $stack1#6[java.lang.Object(1)<->com.ibm.ejs.wlm.client.WLMClient(21)]
(com.ibm.ejs.wlm.client.WLMClient) $stack1#6[java.lang.Object(1)<->com.ibm.ejs.wlm.client.WLMClient(21)]
(com.ibm.ejs.wlm.client.WLMClient) $stack1#6[java.lang.Object(1)<->com.ibm.ejs.wlm.client.WLMClient(21)]
...
soot.jimple.toolkits.typing.TypeException: Type Error(12)
at soot.jimple.toolkits.typing.TypeVariable.error(TypeVariable.java:527)
at soot.jimple.toolkits.typing.TypeNode.lca(TypeNode.java:326)
at soot.jimple.toolkits.typing.ConstraintChecker.caseAssignStmt(ConstraintChecker.java:575)
at soot.jimple.internal.JAssignStmt.apply(JAssignStmt.java:222)
at soot.jimple.toolkits.typing.ConstraintChecker.check(ConstraintChecker.java:56)
at soot.jimple.toolkits.typing.TypeResolver.check_constraints(TypeResolver.java:802)
at soot.jimple.toolkits.typing.TypeResolver.resolve_step_1(TypeResolver.java:272)
at soot.jimple.toolkits.typing.TypeResolver.resolve(TypeResolver.java:177)
at soot.jimple.toolkits.typing.TypeAssigner.internalTransform(TypeAssigner.java:57)
at soot.BodyTransformer.transform(BodyTransformer.java:51)
at soot.Transform.apply(Transform.java:88)
at soot.JimpleBodyPack.applyPhaseOptions(JimpleBodyPack.java:68)
at soot.JimpleBodyPack.internalApply(JimpleBodyPack.java:91)
at soot.Pack.apply(Pack.java:113)
at soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:115)
at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:79)
at soot.SootMethod.retrieveActiveBody(SootMethod.java:274)
--
CSE, Hanyang Univ.
phone. 031)400-3781
email. jjkim@cse.hyu.ac.kr
msn. kimjungjoon@hotmail.com