Skip to main content

objsync assertion

8 replies [Last post]
Anonymous

I am working on a Win32-based port of phoneME and I have recently
encountered a failed assertion while running a particular application. Many
of my other apps run just fine, but it seems that this one particular app is
tickling the VM a certain way and exposing a bug (probably in my port code).

Our port is sort of non-standard in that we do not use any of the existing
phoneME build targets. We are actually porting to an existing porting layer
that brings OCAP (tru2way) to set-top-boxes. Regardless, my current target
is win32-x86, so we are using the Windows ATOMIC_OPS implementation from
phoneME for fast locking.

I'm really only looking for some debugging guidance with respect to the
assertion failure I'm seeing. Is the bug most certainly in my thread/sync
port? Or are there other areas I might look at that could be causing this
bug? Can anyone give me a little background on what the assertion actually
means?

Thanks,
Greg

--------------------------------------------------
Assertion failed at line 797 in ../../src/share/javavm/runtime/objsync.c:
ee->objLocksPinnedCount < CVM_PINNED_OBJMON_COUNT
Java Frame
java.lang.StringBuffer.append(Ljava/lang/String;)Ljava/lang/StringBuffer;(St
ringBuffer.java:478)
Java Frame
java.lang.StackTraceElement.toString()Ljava/lang/String;(StackTraceElement.j
ava:152)
Java Frame
java.lang.String.valueOf(Ljava/lang/Object;)Ljava/lang/String;(String.java:2
310)
Java Frame
java.lang.StringBuffer.append(Ljava/lang/Object;)Ljava/lang/StringBuffer;(St
ringBuffer.java:454)
Java Frame
java.lang.Throwable.printStackTrace(Ljava/io/PrintStream;)V(Throwable.java:4
89)
Java Frame
java.lang.ThreadGroup.uncaughtException(Ljava/lang/Thread;Ljava/lang/Throwab
le;)V(ThreadGroup.java:961)
Java Frame
java.lang.ThreadGroup.uncaughtException(Ljava/lang/Thread;Ljava/lang/Throwab
le;)V(ThreadGroup.java:958)
Java Frame
java.lang.Thread.exit(Ljava/lang/Throwable;)V(Thread.java:736)
Java Frame java.lang.Thread.startup(Z)V(Thread.java:786)
Transition Frame java.lang.Thread.startup(Z)V(Transition Method)
Free List Frame (JNI Local Frame)

Program received signal SIGSEGV, Segmentation fault.
0x0b7e4f9e in CVMassertHook (filename=0xb91e04c
"../../src/share/javavm/runtime/objsync.c", lineno=797, expr=0xb91e230
"ee->objLocksPinnedCount < CVM_PINNED_OBJMON_COUNT") at
../../src/share/javavm/runtime/interpreter.c:3472
(gdb) where
#0 0x0b7e4f9e in CVMassertHook (filename=0xb91e04c
"../../src/share/javavm/runtime/objsync.c", lineno=797, expr=0xb91e230
"ee->objLocksPinnedCount < CVM_PINNED_OBJMON_COUNT") at
../../src/share/javavm/runtime/interpreter.c:3472
#1 0x0b7e898f in CVMobjMonitorPin (ee=0xf53c498, mon=0xf4449c8) at
../../src/share/javavm/runtime/objsync.c:797
#2 0x0b7e922f in CVMobjectInflate (ee=0xf53c498, indirectObj=0xf4a61a8) at
../../src/share/javavm/runtime/objsync.c:1127
#3 0x0b7e9659 in CVMfastLock (ee=0xf53c498, indirectObj=0xf4a61a8) at
../../src/share/javavm/runtime/objsync.c:1200
#4 0x0b8eb0fd in CVMgcUnsafeExecuteJavaMethod (ee=0xf53c498, mb=0xbc639b8,
isStatic=0, isVirtual=0) at
../../src/share/javavm/runtime/executejava_standard.c:3398
#5 0x0b8343a6 in CVMjniInvoke (env=0xf53c4c4, obj=0xf4a5fd4,
methodID=0xbc64880, pushArguments=0xb833826 ,
args=0x10e8fefc, info=258, retValue=0x0) at
../../src/share/javavm/runtime/jni_impl.c:2673
#6 0x0b835eeb in CVMjniCallVoidMethod (env=0xf53c4c4, obj=0xf4a5fd4,
methodID=0xbc64880) at ../../src/share/javavm/runtime/jni_impl.c:2893
#7 0x0b8440de in start_func (arg=0xf53c6b8) at
../../src/share/javavm/runtime/jvm.c:1879
#8 0x0a5bbc9c in threadStart (data=0xacb897c) at mpeos_thread.c:715
#9 0x77c3a3b0 in msvcrt!_endthreadex () from C:\WINDOWS\system32\MSVCRT.DLL
#10 0x7c80b683 in KERNEL32!GetModuleFileNameA () from
C:\WINDOWS\system32\kernel32.dll
#11 0x00000000 in ?? ()
--------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Dean

Great. We'll try to reproduce the problem and put in an official fix.

Dean

phonemeadvanced@mobileandembedded.org wrote:
>> We may have underestimated CVM_PINNED_OBJMON_COUNT for certain paths.
>> Try increasing it, then see if the problem goes away.
>
> I played around with this value a little yesterday. Its current value of 16 is obviously not enough. I tried 20 and it still wasn't enough. A value of 32 seems to fix the problem.
> [Message sent by forum member 'greg80303' (greg80303)]
>
> http://forums.java.net/jive/thread.jspa?messageID=289033
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
> For additional commands, e-mail: advanced-help@phoneme.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

xyzzy
Offline
Joined: 2006-08-30

The cause of the problem has been identified and the fix went in today. Thanks for reporting it.

Dean

Dean

We may have underestimated CVM_PINNED_OBJMON_COUNT for certain paths.
Try increasing it, then see if the problem goes away.

Dean

Greg Rutz wrote:
> I am working on a Win32-based port of phoneME and I have recently
> encountered a failed assertion while running a particular application. Many
> of my other apps run just fine, but it seems that this one particular app is
> tickling the VM a certain way and exposing a bug (probably in my port code).
>
> Our port is sort of non-standard in that we do not use any of the existing
> phoneME build targets. We are actually porting to an existing porting layer
> that brings OCAP (tru2way) to set-top-boxes. Regardless, my current target
> is win32-x86, so we are using the Windows ATOMIC_OPS implementation from
> phoneME for fast locking.
>
> I'm really only looking for some debugging guidance with respect to the
> assertion failure I'm seeing. Is the bug most certainly in my thread/sync
> port? Or are there other areas I might look at that could be causing this
> bug? Can anyone give me a little background on what the assertion actually
> means?
>
> Thanks,
> Greg
>
> --------------------------------------------------
> Assertion failed at line 797 in ../../src/share/javavm/runtime/objsync.c:
> ee->objLocksPinnedCount < CVM_PINNED_OBJMON_COUNT
> Java Frame
> java.lang.StringBuffer.append(Ljava/lang/String;)Ljava/lang/StringBuffer;(St
> ringBuffer.java:478)
> Java Frame
> java.lang.StackTraceElement.toString()Ljava/lang/String;(StackTraceElement.j
> ava:152)
> Java Frame
> java.lang.String.valueOf(Ljava/lang/Object;)Ljava/lang/String;(String.java:2
> 310)
> Java Frame
> java.lang.StringBuffer.append(Ljava/lang/Object;)Ljava/lang/StringBuffer;(St
> ringBuffer.java:454)
> Java Frame
> java.lang.Throwable.printStackTrace(Ljava/io/PrintStream;)V(Throwable.java:4
> 89)
> Java Frame
> java.lang.ThreadGroup.uncaughtException(Ljava/lang/Thread;Ljava/lang/Throwab
> le;)V(ThreadGroup.java:961)
> Java Frame
> java.lang.ThreadGroup.uncaughtException(Ljava/lang/Thread;Ljava/lang/Throwab
> le;)V(ThreadGroup.java:958)
> Java Frame
> java.lang.Thread.exit(Ljava/lang/Throwable;)V(Thread.java:736)
> Java Frame java.lang.Thread.startup(Z)V(Thread.java:786)
> Transition Frame java.lang.Thread.startup(Z)V(Transition Method)
> Free List Frame (JNI Local Frame)
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x0b7e4f9e in CVMassertHook (filename=0xb91e04c
> "../../src/share/javavm/runtime/objsync.c", lineno=797, expr=0xb91e230
> "ee->objLocksPinnedCount < CVM_PINNED_OBJMON_COUNT") at
> ../../src/share/javavm/runtime/interpreter.c:3472
> (gdb) where
> #0 0x0b7e4f9e in CVMassertHook (filename=0xb91e04c
> "../../src/share/javavm/runtime/objsync.c", lineno=797, expr=0xb91e230
> "ee->objLocksPinnedCount < CVM_PINNED_OBJMON_COUNT") at
> ../../src/share/javavm/runtime/interpreter.c:3472
> #1 0x0b7e898f in CVMobjMonitorPin (ee=0xf53c498, mon=0xf4449c8) at
> ../../src/share/javavm/runtime/objsync.c:797
> #2 0x0b7e922f in CVMobjectInflate (ee=0xf53c498, indirectObj=0xf4a61a8) at
> ../../src/share/javavm/runtime/objsync.c:1127
> #3 0x0b7e9659 in CVMfastLock (ee=0xf53c498, indirectObj=0xf4a61a8) at
> ../../src/share/javavm/runtime/objsync.c:1200
> #4 0x0b8eb0fd in CVMgcUnsafeExecuteJavaMethod (ee=0xf53c498, mb=0xbc639b8,
> isStatic=0, isVirtual=0) at
> ../../src/share/javavm/runtime/executejava_standard.c:3398
> #5 0x0b8343a6 in CVMjniInvoke (env=0xf53c4c4, obj=0xf4a5fd4,
> methodID=0xbc64880, pushArguments=0xb833826 ,
> args=0x10e8fefc, info=258, retValue=0x0) at
> ../../src/share/javavm/runtime/jni_impl.c:2673
> #6 0x0b835eeb in CVMjniCallVoidMethod (env=0xf53c4c4, obj=0xf4a5fd4,
> methodID=0xbc64880) at ../../src/share/javavm/runtime/jni_impl.c:2893
> #7 0x0b8440de in start_func (arg=0xf53c6b8) at
> ../../src/share/javavm/runtime/jvm.c:1879
> #8 0x0a5bbc9c in threadStart (data=0xacb897c) at mpeos_thread.c:715
> #9 0x77c3a3b0 in msvcrt!_endthreadex () from C:\WINDOWS\system32\MSVCRT.DLL
> #10 0x7c80b683 in KERNEL32!GetModuleFileNameA () from
> C:\WINDOWS\system32\kernel32.dll
> #11 0x00000000 in ?? ()
> --------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
> For additional commands, e-mail: advanced-help@phoneme.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

greg80303
Offline
Joined: 2008-07-03

> We may have underestimated CVM_PINNED_OBJMON_COUNT for certain paths.
> Try increasing it, then see if the problem goes away.

I played around with this value a little yesterday. Its current value of 16 is obviously not enough. I tried 20 and it still wasn't enough. A value of 32 seems to fix the problem.

cjplummer
Offline
Joined: 2006-10-16

I would be suspicious that you have a locking bug that is resulting in leaving monitors pinned. You should experiment on working ports to see how many are normally pinned, and compare this to what you are seeing with your port.

Chris

greg80303
Offline
Joined: 2008-07-03

OK -- the "<" in my stack traces was obviously being interpreted as HTML.

Assertion failed at line 797 in ../../src/share/javavm/runtime/objsync.c: ee->objLocksPinnedCount < CVM_PINNED_OBJMON_COUNT
Java Frame java.lang.StringBuffer.append(Ljava/lang/String;)Ljava/lang/StringBuffer;(StringBuffer.java:478)
Java Frame java.lang.StackTraceElement.toString()Ljava/lang/String;(StackTraceElement.java:152)
Java Frame java.lang.String.valueOf(Ljava/lang/Object;)Ljava/lang/String;(String.java:2310)
Java Frame java.lang.StringBuffer.append(Ljava/lang/Object;)Ljava/lang/StringBuffer;(StringBuffer.java:454)
Java Frame java.lang.Throwable.printStackTrace(Ljava/io/PrintStream;)V(Throwable.java:489)
Java Frame java.lang.ThreadGroup.uncaughtException(Ljava/lang/Thread;Ljava/lang/Throwable;)V(ThreadGroup.java:961)
Java Frame java.lang.ThreadGroup.uncaughtException(Ljava/lang/Thread;Ljava/lang/Throwable;)V(ThreadGroup.java:958)
Java Frame java.lang.Thread.exit(Ljava/lang/Throwable;)V(Thread.java:736)
Java Frame java.lang.Thread.startup(Z)V(Thread.java:786)
Transition Frame java.lang.Thread.startup(Z)V(Transition Method)
Free List Frame (JNI Local Frame)

Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 6908.0x1868]
0x0b7e4f9e in CVMassertHook (filename=0xb91e04c "../../src/share/javavm/runtime/objsync.c", lineno=797, expr=0xb91e230 "ee->objLocksPinnedCount < CVM_PINNED_OBJMON_COUNT") at ../../src/share/javavm/runtime/interpreter.c:3472
(gdb) where
#0 0x0b7e4f9e in CVMassertHook (filename=0xb91e04c "../../src/share/javavm/runtime/objsync.c", lineno=797, expr=0xb91e230 "ee->objLocksPinnedCount < CVM_PINNED_OBJMON_COUNT") at ../../src/share/javavm/runtime/interpreter.c:3472
#1 0x0b7e898f in CVMobjMonitorPin (ee=0xf53c498, mon=0xf4449c8) at ../../src/share/javavm/runtime/objsync.c:797
#2 0x0b7e922f in CVMobjectInflate (ee=0xf53c498, indirectObj=0xf4a61a8) at ../../src/share/javavm/runtime/objsync.c:1127
#3 0x0b7e9659 in CVMfastLock (ee=0xf53c498, indirectObj=0xf4a61a8) at ../../src/share/javavm/runtime/objsync.c:1200
#4 0x0b8eb0fd in CVMgcUnsafeExecuteJavaMethod (ee=0xf53c498, mb=0xbc639b8, isStatic=0, isVirtual=0) at ../../src/share/javavm/runtime/executejava_standard.c:3398
#5 0x0b8343a6 in CVMjniInvoke (env=0xf53c4c4, obj=0xf4a5fd4, methodID=0xbc64880, pushArguments=0xb833826 , args=0x10e8fefc, info=258, retValue=0x0) at ../../src/share/javavm/runtime/jni_impl.c:2673
#6 0x0b835eeb in CVMjniCallVoidMethod (env=0xf53c4c4, obj=0xf4a5fd4, methodID=0xbc64880) at ../../src/share/javavm/runtime/jni_impl.c:2893
#7 0x0b8440de in start_func (arg=0xf53c6b8) at ../../src/share/javavm/runtime/jvm.c:1879
#8 0x0a5bbc9c in threadStart (data=0xacb897c) at mpeos_thread.c:715
#9 0x77c3a3b0 in msvcrt!_endthreadex () from C:\WINDOWS\system32\MSVCRT.DLL
#10 0x7c80b683 in KERNEL32!GetModuleFileNameA () from C:\WINDOWS\system32\kernel32.dll
#11 0x00000000 in ?? ()
(gdb) quit
The program is running. Exit anyway? (y or n) [answered Y; input not from terminal]
Debugger finished

greg80303
Offline
Joined: 2008-07-03

Crap -- the forums are, for some reason, editing or ommitting parts of my stack trace printouts when I post. I'll see if I can get the full trace to post.

cjplummer
Offline
Joined: 2006-10-16

> Crap -- the forums are, for some reason, editing or
> ommitting parts of my stack trace printouts when I
> post. I'll see if I can get the full trace to post.

This seems to be a problem when posting source code or back traces. I just saw it on another posting with a lot of source code. Seems to be a new problem. However, the email notices that are sent out are fine.

Chris