Android Bug (iv)-Android app card dead problem

Source: Internet
Author: User

Do Android, unavoidable to run some running sub-program, common running sub-program has quadrant (Quadrant), Nbench, An and so on. As a system engineer, these running sub-procedures are very disdain, this can only be a non-objective reference, but customers like to take this comparison, so, each plant will be more or less to optimize for this (or even cheat or direct fraud), this is not what good phenomenon, grandiose, everywhere Sputnik, per MU million catty, All of us honest people are very passive. But that's not what's going on here. Domestic commonly used running sub-procedures, is the rabbit, but do not know everyone has found that the rabbit ran up, sometimes will be stuck, in addition to the return key and touch operation is useless.

When this problem occurs, the home key can exit and continue running other applications, indicating that the system is still normal at this time. Top,vmstat Look, there is no high cpu/io occupancy rate of the process, ps–t look, also did not find the D-state thread. However, <span style= "ps–t found a phenomenon:

app_47 9691 8787 610076 28768 ffffffff 2aac4424 S com.antutu.ABenchMarkapp_47 9706 9691 609060 24476 80061b00 2a ac5434 S Com.antutu.ABenchMark

A process with the same name has occurred! It's weird.
Look at the two processes of the parent process, one is zygote, the other, is Com.antutu.ABenchMark himself. It can be inferred that the latter process is the fork of the previous process, and after the fork has not been able to get an exec stuck.

Connect to the ADB and see the status of the two processes:

process:9691 (GDB) bt#0 read () at Bionic/libc/arch-mips/syscalls/read. S:13#1 0x2ad6d7d0 in Executeprocess (Env=0x1c7e60, Javacommands=0x2c118ab8, javaenvironment=0x0, javaWorkingDirectory =0x0, Indescriptor=0x2c118af0, outdescriptor=0x2c118b00, ERRDESCRIPTOR=0X2C118B10, redirectErrorStream=0 ' \000 ') at L Ibcore/luni/src/main/native/java_lang_processmanager.cpp:165#2 processmanager_exec (Env=0x1c7e60, javaCommands=     0x2c118ab8, javaenvironment=0x0, javaworkingdirectory=0x0, indescriptor=0x2c118af0, OutDescriptor=0x2c118b00, ERRDESCRIPTOR=0X2C118B10, redirecterrorstream=0 ' \000 ') at Libcore/luni/src/main/native/java_lang_ Processmanager.cpp:240#3 0x2b8cccc4 in Call_it () at External/libffi/src/mips/o32. S:145#4 0x0026eb78 in?? ()

Nothing special, it's really stuck in the fork of the process.

And look at process 9706.

(GDB) Info thread* 1 thread 9706  __futex_syscall4 () at Bionic/libc/arch-mips/bionic/atomics_mips. s:218 (GDB) bt#0  __futex_syscall4 () at Bionic/libc/arch-mips/bionic/atomics_mips. s:218#1  0x2aabc288 in _normal_lock (mutex=0x2ab2142c) at bionic/libc/bionic/pthread.c:951#2  Pthread_mutex _lock (mutex=0x2ab2142c) at bionic/libc/bionic/pthread.c:1041#3  0x2aabf848 in Dlmalloc (bytes=4096) at bionic/ libc/bionic/dlmalloc.c:4261#4  0x2aace004 in __smakebuf (fp=0x2ab21598) at bionic/libc/stdio/makebuf.c:62#5   0x2aad4658 in __swsetup (fp=0x2ab21598) @ bionic/libc/stdio/wsetup.c:73#6  0x2aace6a0 in putc_unlocked (c= Fp=<value optimized out>) at bionic/libc/stdio/putc.c:46#7  0x2aace744 in Putc (c=48, fp=0x2ab21598) at bio nic/libc/stdio/putc.c:64#8  0x2aae44c0 in Cpuacct_add (Uid=<value optimized out>) at bionic/libc/bionic/ cpuacct.c:55#9  0x2aae57b0 in fork () @ bionic/libc/bionic/fork.c:57#10 0x2ad6d764 in executeprocess (Env=0x1c7e60, Javacommands=0x2c118ab8, javaenvironment=0x0, javaworkingdirectory=0x0, INDESCRIPTOR=0X2C118AF0, Outdescriptor=0x2c118b00,     errdescriptor=0x2c118b10, redirecterrorstream=0 ' \000 ') at Libcore/luni /src/main/native/java_lang_processmanager.cpp:92#11 processmanager_exec (Env=0x1c7e60, JavaCommands=0x2c118ab8, javaenvironment=0x0, javaworkingdirectory=0x0, indescriptor=0x2c118af0, outdescriptor=0x2c118b00,      ERRDESCRIPTOR=0X2C118B10, redirecterrorstream=0 ' \000 ') at Libcore/luni/src/main/native/java_lang_ Processmanager.cpp:240#12 0x2b8cccc4 in Call_it () at External/libffi/src/mips/o32. S:145#13 0x0026eb78 in?? () (GDB)

Can see stop in Bionic Fork, the specific function is: Cpuacct_add (Getuid ()); In the fprintf. The cause of the error can be seen from BT, but also the problem of lock.

After finding the cause of the problem, the solution is not to spend any effort, direct Google, the problem and solutions are out:

https://code.google.com/p/android/issues/detail?id=19916
[email protected], Nov, 2011This issue have also been found on ICS.  Cpuacct_add should not being doing anything that calls malloc () or free (). Proposed fixes is here:
http://review.omapzoom.org/16579http://review.omapzoom.org/16573


Now more and more apk, will sneak the fork process, execute the system commands or dump debugging information, even if Skype, will fork a lot of their own written native service, watching is not very cool.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android Bug (iv)-Android app card dead problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.