Skip to main content

CVM crash at Garbage Collection

3 replies [Last post]
Joined: 2008-03-12

I got an intersting crash scenario in CVM to debug with ,but need some help from CVM and C experts to proceed with .The BT full trace and my analysis is given below

bt full trace for the crash is as follows

#0 0x005c48b2 in CVMassertHook(filename=,lineno=,
at ../../src/share/javavm/runtime/interpreter.c:2945

No locals

#1 0x005b968c in CVMgenSemispaceFilteredGrayObject(thisgen=0xfdbae8,refPtr=0x2aef8980,
at ../../src/share/javavm/runtime/gc/generational/gen_semispace.c:641
__PRETTY_FUNTION__ = "CVMgenSemispaceFilteredGrayObject"

#2 0x005b9994 in CVMgenSemispaceBlackenObjectFull (thisGEn=0xfdbae8,ee=0x2e8770b8,
gcOpts=0x3b8e8c58, ref=0x2aef8960,refCb=0x2aef8960)
at ../../src/share/javavm/runtime/gc/generational/gen_semispace.c:720
bigmap =
manPtr =
mapEnd =
otherRefPtr =
flags =
map =
refPtr =(CVMObject **) 0x2aef8980
cb_ =
__PRETTY_FUNTION__ = "CVMgenSemispaceBlackenObjectFull"

#3 0x005b9e8e in CVMgenSemispaceFollowRootWithBlackener ( thisGen =0xfdbae8,
ee = 0x2e8770b8,gcOpts =0x3b8e8c58,
balckener=0x5b97a0 )
at ../../src/share/javavm/runtime/gc/generational/gen_semispace.c:761
obj =
objCb = (CVMClassBlock *) 0x10d6048
objSize = 56
copyBase = (CVMUint32 *) 0x2aef8960
__PRETTY_FUNTION__ = "CVMgenSemispaceFollowRootsWithBlackener"

#4 0x005ba794 in CVMgenSemispaceCollect (gen = 0xfdbae8,ee=0x2e8770b8,numBytes =44,
at ../../src/share/javavm/runtime/gc/generation/gen_semispace.c:789
No locals.

#5 0x005c18ca in CVMgcimplDoGC (ee=0x2e8770b8,numBytes=44)

CVMgenSemispaceFollowRootWithBlackener in frame #3 is passing
objCb = (CVMClassBlock *) 0x10d6048
obj=copyBase = (CVMUint32 *) 0x2aef8960
to function CVMgenSemispaceBlackenObjectFull #2
and is received in refCb and ref
but interestingly
refCb and ref are both same and equal to 0x2aef8960 at CVMgenSemispaceBlackenObjectFull(frame #2).

and this caused wrong class block and inturn gcmap for finding object references in the given object.
which inturn caused considering non object for graying which caused assert error at CVM at CVMpreloaderReallyInROM(obj) at gen_semispace.c:
line no : 641
Function name:CVMgenSemispaceFilteredGrayObject

This all things happend just because of some error which caused correct obj and objCb passed by frame#3 recieved with corruption at frame#2(that too with both argument as same)

What all can cause this kind of error to happen?
1)Frame corruption by some other thread can cause this error or(only GC safe thread is running at this time),
2)Is it beacause (R4-R7 argument ) loading in the library went wrong due to some corruption or
3)Will wrong code in marshaling activity done in JVM at JNI invokaton at one thread can cause GC thread C stack to behave like this?

Look forward for valuable suggestions for further debuging this bug .

Thanks in advance


Reply viewing options

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

Which source base are you using? The line numbers don't match up with the latest OSS source. It would be best if that is what you used.

What OS and CPU are you using?

Does it happen with the JIT off (build with CVM_JIT=false or run with -Xjit:compile=none).

Can you rebuild with CVM with CVM_DEBUG=true and still reproduce it. GDB can lie to you about the value in locals when you use an optimized build.

Can you provide a test case?


Joined: 2008-03-12

Hi Chris,

I am using CDC 1.0 ,i started development with that ....
This happens when jit is off and on....
This crash occur only after 12 to 24 hrs of run of third party application(java +jni).

Mostly this kind of crash happen at GC and when debugged it was some sort of corruption of locals.The crash is reproducible but it differ in way corruption occur.

Also from code analysis it was seen that only GC safe thread will running when GC is running and all other thread will be suspended,as JNI and classloaders are GC safe threads i suspect some of these threads causing corruption(not sure ,i want i/p from you in this regard).

I dont have any test application which produce this kind of crashes...
and unfortunately due to licensing issue i cant share the third party applications

Thanks and regards

Joined: 2006-10-16

We really need to have you on current sources to help you with this kind of problem. It's very possible that this is a CDC bug that has been fixed, but so much time as passed since CDC 1.0 shipped that we can't possibly go back and look at all fixes since then and suggest one for you.

For CDC 1.0, if you are a licensee you should work with Licensee Engineering to resolve this.