Search code examples
androiddebuggingadbandroid-debugandroid-anr-dialog

What does sCount=2 dsCount=1 mean in android ANR file?


I have some problem with an ANR files, I got a SUSPENDED lable in main thread, somebody say the reason maybe GC , Debugger, infinite loop, so I have try Debugger and infinite loop, and I got the SUSPENDED , but the difference is when I use Debugger to get ANR, I got sCount=2 dsCount=1, and when I use infinite loop to get ANR, i got sCount=1 dsCount=0.. so What does it mean in an ANR file?
Following is the screenshot of the ANR


Solution

  • As you can judge from sources:

    dvmPrintDebugMessage(target, " | group=\"%s\" sCount=%d dsCount=%d s=%c obj=%p 
                         self=%p\n", 
                         groupName, thread->suspendCount, thread->dbgSuspendCount, 
                         thread->isSuspended ? 'Y' : 'N', thread->threadObj, thread);
    

    So, to answer your question:

    sCount stands for thread->suspendCount, dsCount stands for thread->dbgSuspendCount.