Hello folks,

we are experiencing a strange behavior while booting kvm-accelerated ICS 
image on some linux machines (both ubuntu & debian):

emulator-x86 -verbose -show-kernel -avd x86_4_0_3 -no-window -qemu 
-enable-kvm


The resulting log freezes after:

emulator: ping program: /opt/android-sdk-linux/tools/ddms


Therefore, we looked into the source code of the qemu / android emulator 
and stumbled over:

qemu-setup.c -> android_emulation_setup(...)

if (path_exists(tmp)) {
...

/* disable SIGALRM for the fork(), the periodic signal seems to

* interefere badly with the fork() implementation on Linux running

* under VMWare.

*/

BEGIN_NOSIGALRM

pid = fork();

if (pid == 0) {

int fd = open("/dev/null", O_WRONLY);

dup2(fd, 1);

dup2(fd, 2);

execl( tmp, _ANDROID_PING_PROGRAM, "ping", "emulator", VERSION_STRING, NULL 
);

}

END_NOSIGALRM

} 



We are pretty certain that the codes hangs while invoking fork().

Firing strace 

strace emulator-x86 -verbose -show-kernel -avd x86_4_0_3 -no-window -qemu 
-enable-kvm


spits out an endless continuation of 

clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0) = ? ERESTARTNOINTR (To be restarted) 
--- SIGIO (I/O possible) @ 0 (0) --- 
clock_gettime(CLOCK_MONOTONIC, {55232, 717872152}) = 0 sigreturn() = 120 
--- SIGIO (I/O possible) @ 0 (0) --- 
clock_gettime(CLOCK_MONOTONIC, {55232, 719018162}) = 0 sigreturn() = 120 
--- SIGIO (I/O possible) @ 0 (0) --- 
clock_gettime(CLOCK_MONOTONIC, {55232, 719310431}) = 0 sigreturn() = 120 
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0) = ? ERESTARTNOINTR (To be restarted) 



As a temporary workaround, the branch of code in qemu-setup.c triggering 
the fork() can be avoided by renaming the "ping program" (namely ddms) by

mv tools/ddms tools/ddms.fork.fix


However, we would like to avoid this "hack" in a productive system.


Any clues why the fork() in combinations with KVM keeps hanging?


Thanks so much!
-- erik




-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to