On Dec 29, 12:54 pm, Shashank <[email protected]> wrote: > One of the example is, we run a perl script that install/uninstall > multiple apks on device using adb. As install process adb daemon > (adbd) on the device forks another child process to handle this new > install request. In the failure case I saw that this new adbd child > process was sleeping in the futex queue, because of which adb request > on host was just waiting for reply back. This scenario is very random. [snip]
This sounds like bionic's fork() bug. There's currently a fix in the master branch of bionic: commit 177ba8cb42ed6d232e7c8bcad5e6ee21fc51a0e8 Author: Rabin Vincent <[email protected]> Date: Fri Apr 8 08:50:48 2011 +0200 Prevent deadlock when using fork When forking of a new process in bionic, it is critical that it does not allocate any memory according to the comment in java_lang_ProcessManager.c: "Note: We cannot malloc() or free() after this point! A no-longer-running thread may be holding on to the heap lock, and an attempt to malloc() or free() would result in deadlock." However, as fork is using standard lib calls when tracing it a bit, they might allocate memory, and thus causing the deadlock. This is a rewrite so that the function cpuacct_add, that fork calls, will use system calls instead of standard lib calls. Signed-off-by: christian bejram <[email protected]> Change-Id: Iff22ea6b424ce9f9bf0ac8e9c76593f689e0cc86 -gabriel -- unsubscribe: [email protected] website: http://groups.google.com/group/android-porting
