Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Decad3nce/593394 to your computer and use it in GitHub Desktop.
Save Decad3nce/593394 to your computer and use it in GitHub Desktop.
I/dalvikvm( 191): "Signal Catcher" daemon prio=5 tid=3 RUNNABLE
I/dalvikvm( 191): | group="system" sCount=0 dsCount=0 s=N obj=0x43e041e8 self=0x11fd88
I/dalvikvm( 191): | sysTid=193 nice=0 sched=0/0 cgrp=unknown handle=1157640
I/dalvikvm( 191): | schedstat=( 3041229258 10333740164 24961 )
I/dalvikvm( 191): at dalvik.system.NativeStart.run(Native Method)
I/dalvikvm( 191):
E/dalvikvm( 191): Failed to find cpu subsys
I/dalvikvm( 191): "Binder Thread #15" prio=5 tid=57 RUNNABLE
I/dalvikvm( 191): | group="main" sCount=1 dsCount=0 s=N obj=0x442cf120 self=0x4ff600
I/dalvikvm( 191): | sysTid=4303 nice=0 sched=0/0 cgrp=unknown handle=5240256
I/dalvikvm( 191): | schedstat=( 21431793329 1608072845366 68888 )
Followed by spam of
E/dalvikvm( 191): Failed to find cpu subsys
It seems that thread.c in the dalvikvm is failing to find a scheduler group, specifically in proc/<pid>/cgroup
FROM Thread.c in android.git for dalvikvm (http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=vm/Thread.c)
/*
* Try to get the scheduler group.
*
* The data from /proc/<pid>/cgroup looks (something) like:
* 2:cpu:/bg_non_interactive
* 1:cpuacct:/
*
* We return the part after the "/", which will be an empty string for
* the default cgroup. If the string is longer than "bufLen", the string
* will be truncated.
*
* TODO: this is cloned from a static function in libcutils; expose that?
*/
static int getSchedulerGroup(int tid, char* buf, size_t bufLen)
{
#ifdef HAVE_ANDROID_OS
char pathBuf[32];
char lineBuf[256];
FILE *fp;
snprintf(pathBuf, sizeof(pathBuf), "/proc/%d/cgroup", tid);
if (!(fp = fopen(pathBuf, "r"))) {
return -1;
}
while(fgets(lineBuf, sizeof(lineBuf) -1, fp)) {
char *next = lineBuf;
char *subsys;
char *grp;
size_t len;
/* Junk the first field */
if (!strsep(&next, ":")) {
goto out_bad_data;
}
if (!(subsys = strsep(&next, ":"))) {
goto out_bad_data;
}
if (strcmp(subsys, "cpu")) {
/* Not the subsys we're looking for */
continue;
}
if (!(grp = strsep(&next, ":"))) {
goto out_bad_data;
}
grp++; /* Drop the leading '/' */
len = strlen(grp);
grp[len-1] = '\0'; /* Drop the trailing '\n' */
if (bufLen <= len) {
len = bufLen - 1;
}
strncpy(buf, grp, len);
buf[len] = '\0';
fclose(fp);
return 0;
}
LOGE("Failed to find cpu subsys");
Nice to finally pinpoint this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment