Skip to main content

cvm (on XP) crashes when starting in debug mode

2 replies [Last post]
lua2010
Offline
Joined: 2006-11-16
Points: 0

Hi,

if i try to debug a simple Application, cvm terminates with
> exception c0000005 in main thread at pc 100bce66 addr 100bce66

Here is the command
cvm.exe -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=5000 -cp E:\lucon\ComfortSoft-X\workspace\testcdc\bin HelloWorld

I've debuged the cvm and got the following stacktrace:

cvmi.dll!CVMgcSafeClassRef2ClassBlock(CVMExecEnv * ee=0x104a7ea8, CVMObjectICell * clazz=0x00000000) Line 1151 + 0xc0 C
cvmi.dll!CVMjniFindClass(const JNINativeInterface * * env=0x104a7ed4, const char * name=0x103e3868) Line 659 + 0xd C
cvmi.dll!JNU_CallStaticMethodByName(const JNINativeInterface * * env=0x104a7ed4, unsigned char * hasException=0x0013f42f, const char * class_name=0x103e3868, const char * name=0x103e385c, const char * signature=0x103e3834, ...) Line 222 + 0x10 C
cvmi.dll!initializeEncoding(const JNINativeInterface * * env=0x104a7ed4) Line 585 + 0x20 C
cvmi.dll!JNU_GetStringPlatformChars(const JNINativeInterface * * env=0x104a7ed4, CVMObjectICell * jstr=0x0091587c, unsigned char * isCopy=0x00000000) Line 659 + 0x9 C
cvmi.dll!Java_java_lang_ClassLoader_00024NativeLibrary_load(const JNINativeInterface * * env=0x104a7ed4, CVMObjectICell * thisObj=0x00915878, CVMObjectICell * name=0x0091587c) Line 311 + 0xf C
cvmi.dll!_CVMjniInvokeNative() + 0xc7
cvmi.dll!CVMinvokeJNIHelper(CVMExecEnv * ee=0x104a7ea8, CVMMethodBlock * mb=0x10513b68) Line 4155 + 0x139 C
cvmi.dll!CVMgcUnsafeExecuteJavaMethod(CVMExecEnv * volatile ee=0x104a7ea8, CVMMethodBlock * mb=0x10513b68, unsigned int isStatic=0, unsigned int isVirtual=0) Line 3492 + 0xd C
cvmi.dll!CVMjniInvoke(const JNINativeInterface * * env=0x104a7ed4, CVMObjectICell * obj=0x1028d3e4, CVMMethodBlock * methodID=0x10512310, char (const JNINativeInterface * *, CVMterseSigIterator *, CVMFrame *, void *)* pushArguments=0x10073400, void * args=0x0013fb84, unsigned short info=779, jvalue * retValue=0x0013fb78) Line 2747 + 0x1ac C
cvmi.dll!CVMjniCallStaticObjectMethod(const JNINativeInterface * * env=0x104a7ed4, CVMObjectICell * clazz=0x1028d3e4, CVMMethodBlock * methodID=0x10512310, ...) Line 2873 + 0x2f C
cvmi.dll!CVMXrunHandleArgument(CVMXrunTable * Xrun_table=0x104a8374, const JNINativeInterface * * env=0x104a7ed4, char * arg=0x00032df6) Line 209 + 0x21 C
> cvmi.dll!JNI_CreateJavaVM(const JNIInvokeInterface * * * p_jvm=0x0013fe2c, void * * p_env=0x0013fe18, void * args=0x00032508) Line 4214 + 0x1b C
cvm.exe!ansiJavaMain(int argc=6, const char * * argv=0x00032db0, int (const JNIInvokeInterface * * *, void * *, void *)* JNI_CreateJavaVMFunc=0x10002bb2) Line 334 + 0xf C
cvm.exe!ansiJavaMain0(int argc=6, const char * * argv=0x00032db0, int (const JNIInvokeInterface * * *, void * *, void *)* f=0x10002bb2) Line 186 + 0x11 C
cvm.exe!main(int argc=6, char * * argv=0x00032db0) Line 421 + 0x11 C
cvm.exe!mainCRTStartup() Line 259 + 0x19 C
kernel32.dll!7c816fd7()
ntdll.dll!7c925b4f()

Without the debug options the application runs fine. I built the cvm with
make CVM_JVMDI=true CVM_JIT=false J2ME_CLASSLIB=foundation CVM_DEBUG=true

Andreas

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
billp
Offline
Joined: 2006-09-19
Points: 0

Hello Andreas,

This is a problem in System.initializeSystemClass. propProviders hashtable should be initialized *before* call to initProperties(). In anycase, someone is looking into that but in the meantime use the -agentlib commandline option which will not call into the offending code path:

-agentlib:jdwp=transport=dt_socket,server=y,address=5000 -cp E:\lucon\ComfortSoft-X\workspace\testcdc\bin HelloWorld

I was then able to successfully connect with netbeans to cvm and debug a program.

Since the debug agent is now using JVMTI we've added the newer commandline arguments -agentlib and -agentpath. We don't have any cvm specific doc on the new command lines but a good starting reference is the 5.0 doc:

http://java.sun.com/j2se/1.5.0/docs/guide/jpda/conninv.html#Invocation

bill

lua2010
Offline
Joined: 2006-11-16
Points: 0

Thank you!

with eclipse it also goes.

Andreas