Skip to main content

Query regarding Romization with PhoneME advance

3 replies [Last post]
neerajsol
Offline
Joined: 2012-10-17
Points: 0

Hi All,
I have enabled the romization in phoneME build and i have removed the "sharedCP" option from JCC build options. Now, when i run the TCK signature test with phoneME code, it is getting signal 11 (i.e. seg fault).
After checking more, found that exceptionTypes for implemented interface for class is coming null. As i know, "sharedCP" option enables the shared constant pool for Java code compact.
But not getting clue, why test crashes without "sharedCP" (or "NO_CODE_COMPACTION=true").
Please check and give your opinion.

Regards

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
cjplummer
Offline
Joined: 2006-10-16
Points: 0

NO_CODE_COMPACTION=true has never been a supported option. It was never included in builds that were tested and has been known to be broken at times. Unless you have a really need for it, don't use it. If you have a real need for it, plan on debugging it and fixing any problems you come up with.

neerajsol
Offline
Joined: 2012-10-17
Points: 0

Hi,
Please find below the thread dump.
thread dump:
======================================
Thread 1: ee 0x09200668
JNI Frame java.lang.Object.wait(J)V(Native Method)
Java Frame java.lang.Object.wait()V(Unknown Source)
Java Frame com.sun.javatest.util.Timer.getNextEntry()Lcom/sun/javatest/util/Timer$Entry;(Unknown Source)
Java Frame com.sun.javatest.util.Timer.access$000(Lcom/sun/javatest/util/Timer;)Lcom/sun/javatest/util/Timer$Entry;(Unknown Source)
Java Frame com.sun.javatest.util.Timer$1.run()V(Unknown Source)
Java Frame java.lang.Thread.startup(Z)V(Unknown Source)
Transition Frame java.lang.Thread.startup(Z)V(Transition Method)
Free List Frame (JNI Local Frame)
======================================
Thread 2: ee 0x091f10c0
Java Frame java.lang.reflect.Method.copy([Ljava/lang/Class;)[Ljava/lang/Class;(Unknown Source)
Java Frame java.lang.reflect.Method.getExceptionTypes()[Ljava/lang/Class;(Unknown Source)
Java Frame com.sun.tdk.signaturetest.FullItemDescription.(Ljava/lang/reflect/Method;)V(Unknown Source)
Java Frame com.sun.tdk.signaturetest.ReflClassDescription.getDeclaredMethods()[Lcom/sun/tdk/signaturetest/FullItemDescription;(Unknown Source)
Java Frame com.sun.tdk.signaturetest.ClassDescrLoader.getMembers(Lcom/sun/tdk/signaturetest/ClassDescription;)Lcom/sun/tdk/signaturetest/ClassCollection;(Unknown Source)
Java Frame com.sun.tdk.signaturetest.ClassDescrLoader.createMembers(Lcom/sun/tdk/signaturetest/ClassDescription;Z)V(Unknown Source)
Java Frame com.sun.tdk.signaturetest.SignatureTest.verifyClass(Lcom/sun/tdk/signaturetest/ClassDescription;)Z(Unknown Source)
Java Frame com.sun.tdk.signaturetest.SignatureTest.check()Z(Unknown Source)
Java Frame com.sun.tdk.signaturetest.SignatureTest.run([Ljava/lang/String;Ljava/io/PrintWriter;Ljava/io/PrintWriter;)V(Unknown Source)
Java Frame com.sun.tdk.signaturetest.Test.run([Ljava/lang/String;Ljava/io/PrintWriter;Ljava/io/PrintWriter;)Lcom/sun/javatest/Status;(Unknown Source)
Java Frame com.sun.jck.lib.ExecJCKTestSameJVMCmd$Version3Test.execute([Ljava/lang/String;Ljava/io/PrintWriter;Ljava/io/PrintWriter;)Lcom/sun/javatest/Status;(Unknown Source)
Java Frame com.sun.jck.lib.ExecJCKTestSameJVMCmd$StandardTest.run([Ljava/lang/String;Ljava/io/PrintWriter;Ljava/io/PrintWriter;)Lcom/sun/javatest/Status;(Unknown Source)
Java Frame com.sun.jck.lib.ExecJCKTestSameJVMCmd.execute(Ljava/lang/ClassLoader;Ljava/lang/String;[Ljava/lang/String;Ljava/io/PrintWriter;Ljava/io/PrintWriter;I)Lcom/sun/javatest/Status;(Unknown Source)
Java Frame com.sun.jck.lib.ExecJCKTestSameJVMCmd.run([Ljava/lang/String;Ljava/io/PrintWriter;Ljava/io/PrintWriter;)Lcom/sun/javatest/Status;(Unknown Source)
Java Frame com.sun.javatest.agent.Agent$Task.executeCommand(Ljava/lang/Class;[Ljava/lang/String;Ljava/io/PrintWriter;Ljava/io/PrintWriter;Ljava/lang/ClassLoader;)Lcom/sun/javatest/Status;(Unknown Source)
Java Frame com.sun.javatest.agent.Agent$Task.execute()Lcom/sun/javatest/Status;(Unknown Source)
Java Frame com.sun.javatest.agent.Agent$Task.handleRequest()V(Unknown Source)
Java Frame com.sun.javatest.agent.Agent.handleRequestsUntilClosed()V(Unknown Source)
Java Frame com.sun.javatest.agent.Agent.access$000(Lcom/sun/javatest/agent/Agent;)V(Unknown Source)
Java Frame com.sun.javatest.agent.Agent$1.run()V(Unknown Source)
Java Frame java.lang.Thread.run()V(Unknown Source)
Java Frame java.lang.Thread.startup(Z)V(Unknown Source)
Transition Frame java.lang.Thread.startup(Z)V(Transition Method)
Free List Frame (JNI Local Frame)
======================================
Thread 3: ee 0x091fe5c8
JNI Frame java.lang.Object.wait(J)V(Native Method)
Java Frame java.lang.Object.wait()V(Unknown Source)
Java Frame com.sun.javatest.util.Timer.getNextEntry()Lcom/sun/javatest/util/Timer$Entry;(Unknown Source)
Java Frame com.sun.javatest.util.Timer.access$000(Lcom/sun/javatest/util/Timer;)Lcom/sun/javatest/util/Timer$Entry;(Unknown Source)
Java Frame com.sun.javatest.util.Timer$1.run()V(Unknown Source)
Java Frame java.lang.Thread.startup(Z)V(Unknown Source)
Transition Frame java.lang.Thread.startup(Z)V(Transition Method)
Free List Frame (JNI Local Frame)
======================================
Thread 4: ee 0x091c8270
JNI Frame java.lang.Object.wait(J)V(Native Method)
Java Frame java.lang.Object.wait()V(Unknown Source)
Java Frame java.lang.ref.Reference$ReferenceHandler.run()V(Unknown Source)
Java Frame java.lang.Thread.startup(Z)V(Unknown Source)
Transition Frame java.lang.Thread.startup(Z)V(Transition Method)
Free List Frame (JNI Local Frame)
======================================
Thread 5: ee 0x091c1d00
JNI Frame java.lang.Object.wait(J)V(Native Method)
Java Frame java.lang.ref.ReferenceQueue.remove(J)Ljava/lang/ref/Reference;(Unknown Source)
Java Frame java.lang.ref.ReferenceQueue.remove()Ljava/lang/ref/Reference;(Unknown Source)
Java Frame java.lang.ref.TaskFinalizer$TaskFinalizerThread.run()V(Unknown Source)
Java Frame java.lang.Thread.startup(Z)V(Unknown Source)
Transition Frame java.lang.Thread.startup(Z)V(Transition Method)
Free List Frame (JNI Local Frame)
======================================
Thread 6: ee 0x082f4360
JNI Frame java.lang.Object.wait(J)V(Native Method)
Java Frame java.lang.Object.wait()V(Unknown Source)
Java Frame com.sun.javatest.agent.Agent.run()V(Unknown Source)
Java Frame com.sun.javatest.agent.AgentMain.run([Ljava/lang/String;)V(Unknown Source)
Java Frame com.sun.javatest.agent.AgentMain.runAndExit([Ljava/lang/String;)V(Unknown Source)
Java Frame com.sun.javatest.agent.AgentMain.main([Ljava/lang/String;)V(Unknown Source)
Transition Frame com.sun.javatest.agent.AgentMain.main([Ljava/lang/String;)V(Transition Method)
Java Frame java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
Java Frame sun.misc.CVM.runMain()V(Unknown Source)
Transition Frame sun.misc.CVM.runMain()V(Transition Method)
Free List Frame (JNI Local Frame)
======================================
End thread dump

Process #17668 received signal 11, suspending

After analysis, found the following call back trace while executing the test case.

toString() (cdc/src/share/javavm/classes/java/lang/reflect/Method.java)

In this method It is trying to access the exceptions[] in the following loop.
for (int k = 0; k < exceptions.length; k++) {
It is trying to get the name of Exception type thrown by each method of
"public abstract java.net.DatagramSocketImpl" class
and Interface It implemented, which is "SocketOptions" by reflection mechanism.
For Every method of java.net.DatagramSocketImpl, "exceptionTypes" is coming proper as given in "DatagramSocketImpl.java" file but when It tries to access the exceptiontype of the interface "socketOption", It is coming NULL instead of "SocketException".

we can see when "sharedCP" option is enabled, it is explicitly adding info for exceptions thrown by class methods.
-------File - "cdc/src/share/javavm/jcc/JavaCodeCompact.java" and Function - "mergeConstantsIntoSharedPool()" --------
// update exception table (catchType)
// and also thrown exceptions table
for (int i = 0; i < cinfo.methods.length; i++) {
MethodInfo mi = cinfo.methods[i];

// NOTE: Investigate the possibility of removing this scan
// of the exception tables. Since references to exception
// classes from the exception tables are already counted in
// the individual class' constant pool, adding the constants
// from the class' constant pool should be adequate. We
// might not need to scan these exception tables anymore.
if ( mi.exceptionTable != null) {
for (int j = 0; j < mi.exceptionTable.length; j++) {
ClassConstant cc = mi.exceptionTable[j].catchType;
if (cc != null) {
mi.exceptionTable[j].catchType =
(ClassConstant)sharedCP.add(cc);
}
}
}
if (mi.exceptionsThrown != null) {
for (int j = 0; j < mi.exceptionsThrown.length; j++) {
ClassConstant cc = mi.exceptionsThrown[j];
mi.exceptionsThrown[j] =
(ClassConstant) sharedCP.add(cc);
}
}
}
------------------------------------------------------------

So, currently, not getting idea why the "exceptiontype" of the interface "socketOption" is coming NULL instead of "SocketException" and where this infomration is being updated (when "sharedCP" is disabled).

Regards,
Neeraj

hinkmond
Offline
Joined: 2003-12-01
Points: 0

Hi neerajsol,

Try running the TCK test with a debug version of phoneME Advance instead. With a debug build, you should see more information in the crash instead of just a sig 11 (which is what is shown for non-debug builds as just a placeholder).

Let us know what the debug build says during the crash.

Hinkmond