I'm currently having trouble debugging some Android code which relies on a native library. One native call in particular seems prone to this "spin on suspend" error. It generally manifests like so:
threadid=2: spin on suspend #2 threadid=48 (pcf=3)
Thus far I haven't been able to determine exactly what's failing here, except that after about 10 of these messages, my application encounters a SIGSTKFLT and exits. Every time, the first thread is the GC, and the second thread is whatever thread is currently executing the native code. The portion of the stack printed along with this message always has a native method at the top of the stack.
What exactly is happening when Dalvik complains about this, and how can I begin to debug the cause so I can fix it?
EDIT: An interesting wrinkle -- after the native developer made some changes, I now also see the following error sometimes:
PopFrame missed the break
VM aborting
Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1)
It's also extremely odd to me that the thread dump shows my native method at the top of the stack, yet the thread state is RUNNABLE, not NATIVE -- how can that be possible?