0

I'm currently trying to set up a virtual machine emulating a ARMv7 Cortex-A8 on a x64 host running qemu. I've got a zImage which was built with the realview defconfig and a rootfs in cpio format.

When I run the following command:

$ qemu-system-arm -machine realview-pb-a8 -cpu cortex-a8 -m 256 -kernel zImage
pulseaudio: set_sink_input_volume() failed
pulseaudio: Reason: Invalid argument
pulseaudio: set_sink_input_mute() failed
pulseaudio: Reason: Invalid argument

I would expect the kernel to initialize and then crash because I do not specify the rootfs yet. Instead it gives no output and hangs there (, using 100% of the CPU core it's running on.

I found out (prepending strace to the command) that it is stuck in an infinite loop... Here is the looping part:

tgkill(14936, 14937, SIGUSR1)           = 0
futex(0x7faef8beb1e0, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
futex(0x7faef8beb1a0, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
futex(0x7faef8beb1a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7faef8beb1a4, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7faef8beb1e0, 254) = 0
recvmsg(10, 0x7ffe1d2a8dd0, 0)          = -1 EAGAIN (Resource temporarily unavailable)
select(11, [10], NULL, NULL, {0, 0})    = 0 (Timeout)
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
futex(0x7faef8beb1e0, FUTEX_WAKE_PRIVATE, 1) = 0
ppoll([{fd=4, events=POLLIN|POLLERR|POLLHUP}, {fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 3, {0, 29609869}, NULL, 8) = 1 ([{fd=5, revents=POLLIN}], left {0, 29606726})
write(6, "\1\0\0\0\0\0\0\0", 8)         = 8
read(5, "\1\0\0\0\0\0\0\0", 512)        = 8
ppoll([{fd=5, events=POLLIN|POLLERR|POLLHUP}], 1, {0, 0}, NULL, 8) = 0 (Timeout)
write(6, "\1\0\0\0\0\0\0\0", 8)         = 8
ppoll([{fd=4, events=POLLIN|POLLERR|POLLHUP}, {fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 3, {0, 0}, NULL, 8) = 1 ([{fd=6, revents=POLLIN}], left {0, 0})
ppoll([{fd=4, events=POLLIN|POLLERR|POLLHUP}, {fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 3, {0, 0}, NULL, 8) = 1 ([{fd=6, revents=POLLIN}], left {0, 0})
read(6, "\2\0\0\0\0\0\0\0", 16)         = 8
ppoll([{fd=4, events=POLLIN|POLLERR|POLLHUP}, {fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 3, {0, 0}, NULL, 8) = 0 (Timeout)

I have never debugged using strace, but "recvmsg(10, 0x7ffe1d2a8dd0, 0) = -1 EAGAIN (Resource temporarily unavailable)" doesn't look right...

Any idea ? Any help is welcome.

0

QEMU emulates synthetic machines which are not strict copies of their real counterparts. If Linux kernel dislikes something about that, it's possible that it will crash early or just hang because it is not aware of sudden changes in expected architecture.

You can try to aid the problem with early printk kernel mechanism and trying to redirect console to emulated serial device, if one is supported by target. See qemu-doc.html for details. Note that some very hackish kernels like android and openwrt are hard to deal with, even if they have early printk enabled, so they are expected to hang and not emulated properly if they do not target QEMU synthetic machines.

The strace recvmsg == EAGAIN error is nothing about the error, but expected behavior when there is no data available on socket to receive. You need to see to which object 10 fd of qemu process refers. Use lsof -p pid, where pid is a qemu pid to see opened fds and where they are from.

Some system calls which end with -1 errno are not errors but, by this way they indicate some events on objects the process deals with.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.