Bug 12493

Summary: Confusing output when qemu fails to run.
Product: [QA/Testing] Runtime Testing Reporter: Richard Purdie <richard.purdie>
Component: generalAssignee: Robert Yang <liezhi.yang>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: liezhi.yang
Version: 2.6   
Target Milestone: 2.6 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Richard Purdie 2018-01-17 16:24:17 UTC
https://autobuilder.yoctoproject.org/main/builders/nightly-x86/builds/1277/steps/Running%20Sanity%20Tests/logs/stdio shows confusing output from qemurunner.py:

NOTE: recipe core-image-sato-sdk-1.0-r0: task do_testimage: Failed
ERROR: Task (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-x86/build/meta/recipes-sato/images/core-image-sato-sdk.bb:do_testimage) failed with exit code '1'
ERROR: core-image-minimal-1.0-r0 do_testimage: Didn't receive a console connection from qemu. Here is the qemu command line used:
powerpc-poky-linux-gcc -mno-spe -fuse-ld=bfd -ffile-prefix-map=/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-ppc-lsb/build/build/tmp/work-shared/qemuppc/kernel-source=/kernel-source/ -Wp,-MD,arch/powerpc/mm/.mmap.o.d -nostdinc -isystem /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-ppc-lsb/build/build/tmp/work/qemuppc-poky-linux/linux-yocto/4.9.65+gitAUTOINC+4553798a3e_5174e51fa0-r0/recipe-sysroot-native/usr/bin/powerpc-poky-linux/../../lib/powerpc-poky-linux/gcc/powerpc-poky-linux/7.2.0/include -I/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-ppc-lsb/build/build/tmp/work-shared/qemuppc/kernel-source/arch/powerpc/include -I./arch/powerpc/include/generated/uapi -I./arch/powerpc/include/generated -I/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-ppc-lsb/build/build/tmp/work-shared/qemuppc/kernel-source/include -I./include -I/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-ppc-lsb/build/build/tmp/work-shared/qemuppc/kernel-source/arch/powerpc/include/uapi -I/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-ppc-lsb/build/build/tmp/work-shared/qemuppc/kernel-source/include/uapi -I./include/generated/uapi -include /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-ppc-lsb/build/build/tmp/work-shared/qemuppc/kernel-source/include/linux/kconfig.h -I/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-ppc-lsb/build/build/tmp/work-shared/qemuppc/kernel-source/arch/powerpc/mm -Iarch/powerpc/mm -D__KERNEL__ -I/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-ppc-lsb/build/build/tmp/work-shared/qemuppc/kernel-source/arch/powerpc -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -msoft-float -pipe -I/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-ppc-lsb/build/build/tmp/work-shared/qemuppc/kernel-source/arch/powerpc -ffixed-r2 -mmultiple -mno-altivec -mno-vsx -mno-spe -mspe=no -funit-at-a-time -fno-dwarf2-cfi-asm -mno-string -mcpu=powerpc -mno-sched-epilog -Wa,-maltivec -mbig-endian -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -O2 --param=allow-store-data-races=0 -DCC_HAVE_ASM_GOTO -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-var-tracking-assignments -g -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror -DKBUILD_BASENAME="mmap" -DKBUILD_MODNAME="mmap" -c -o arch/powerpc/mm/mmap.o /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-ppc-lsb/build/build/tmp/work-shared/qemuppc/kernel-source/arch/powerpc/mm/mmap.c 
and output from runqemu:
runqemu - INFO - Continuing with the following parameters:

runqemu - INFO - Using preconfigured tap device tap0
runqemu - INFO - If this is not intended, touch /tmp/qemu-tap-locks/tap0.skip to make runqemu skip tap0.
runqemu - INFO - Network configuration: 192.168.7.2::192.168.7.1:255.255.255.0
runqemu - INFO - Running /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-x86/build/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-i386 -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:02 -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -drive file=/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-x86/build/build/tmp/deploy/images/qemux86/core-image-minimal-qemux86.ext4,if=virtio,format=raw -vga vmware -show-cursor -usb -device usb-tablet -device virtio-rng-pci  -serial tcp:127.0.0.1:38655 -pidfile pidfile_23574  -cpu pentium2 -enable-kvm -m 256 -serial tcp:127.0.0.1:39061 -snapshot -kernel /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-x86/build/build/tmp/deploy/images/qemux86/bzImage--4.12.18+git0+b66a4f9730_558fe84d69-r0.2-qemux86-20180116144236.bin -append 'root=/dev/vda rw highres=off  clocksource=kvm-clock hpet=disable noapic nolapic mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 vga=0 uvesafb.mode_option=640x480-32 oprofile.timer=1 uvesafb.task_timeout=-1 console=tty1 console=ttyS0,115200n8 printk.time=1'

runqemu - ERROR - Failed to run qemu: ioctl(KVM_CREATE_VM) failed: 12 Cannot allocate memory
qemu-system-i386: failed to initialize KVM: Cannot allocate memory

runqemu - INFO - Releasing lockfile for tap device 'tap0'

I suspect that qemu exits immediately (or quickly) yet the timeout doesn't notice and the pid was recycled so the commandline is a ppc compile command instead. We should fix it to detect early exits from qemu and not display confusing commandlines.
Comment 3 Robert Yang 2018-07-27 02:46:51 UTC
Please ignore c68e4c6e3eb612bb7afd9d7f1e9a6dc295d44346, it should be c467bc856963d701e5a7d63f6e85e1361244489a