poky commit: 9de0ad47462c13ac4a2d73e12e92be6c1b4e0415 On my Fedora 19 system I'm unable to run qemu images if a bitbake core-image-sato. I do have libSDL-devel packages installed and the qemu binary does link to libSDL on my system. However if I bitbake core-image-minimal and run the minimal it does work, which is really wierd. I tried with two clean build dirs, no sstate each time just to be sure. WORKING: - start with a clean build dir (build1), no sstate: $ bitbake core-image-minimal Build Configuration: BB_VERSION = "1.19.1" BUILD_SYS = "x86_64-linux" NATIVELSBSTRING = "Fedora-19" TARGET_SYS = "x86_64-poky-linux" MACHINE = "qemux86-64" DISTRO = "poky" DISTRO_VERSION = "1.4+snapshot-20130801" TUNE_FEATURES = "m64" TARGET_FPU = "" meta meta-yocto meta-yocto-bsp = "master:9de0ad47462c13ac4a2d73e12e92be6c1b4e0415" runqemu qemux86-64 core-image-minimal Assuming core-image-minimal really means /mnt/back/yocto/poky/build/tmp/deploy/images/core-image-minimal-qemux86-64.ext3 Continuing with the following parameters: KERNEL: [/mnt/back/yocto/poky/build/tmp/deploy/images/bzImage-qemux86-64.bin] ROOTFS: [/mnt/back/yocto/poky/build/tmp/deploy/images/core-image-minimal-qemux86-64.ext3] FSTYPE: [ext3] Setting up tap interface under sudo Acquiring lockfile for tap0... Running qemu-system-x86_64... /mnt/back/yocto/poky/build/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-x86_64 -kernel /mnt/back/yocto/poky/build/tmp/deploy/images/bzImage-qemux86-64.bin -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=no,downscript=no -hda /mnt/back/yocto/poky/build/tmp/deploy/images/core-image-minimal-qemux86-64.ext3 -show-cursor -usb -usbdevice wacom-tablet -vga vmware -no-reboot -m 128 --append "vga=0 uvesafb.mode_option=640x480-32 root=/dev/hda rw mem=128M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 " $ ldd /mnt/back/yocto/poky/build/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-x86_64 | grep -i sdl libSDL-1.2.so.0 => /lib64/libSDL-1.2.so.0 (0x00007f6adebf8000) NOT WORKING: - start with another clean build dir (build2), no sstate bitbake core-image-sato runqemu qemux86-64 core-image-sato Assuming core-image-sato really means /mnt/back/yocto/poky2/build/tmp/deploy/images/core-image-sato-qemux86-64.ext3 Continuing with the following parameters: KERNEL: [/mnt/back/yocto/poky2/build/tmp/deploy/images/bzImage-qemux86-64.bin] ROOTFS: [/mnt/back/yocto/poky2/build/tmp/deploy/images/core-image-sato-qemux86-64.ext3] FSTYPE: [ext3] Setting up tap interface under sudo Acquiring lockfile for tap0... Running qemu-system-x86_64... /mnt/back/yocto/poky2/build/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-x86_64 -kernel /mnt/back/yocto/poky2/build/tmp/deploy/images/bzImage-qemux86-64.bin -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=no,downscript=no -hda /mnt/back/yocto/poky2/build/tmp/deploy/images/core-image-sato-qemux86-64.ext3 -show-cursor -usb -usbdevice wacom-tablet -vga vmware -no-reboot -m 128 --append "vga=0 uvesafb.mode_option=640x480-32 root=/dev/hda rw mem=128M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 " Could not initialize SDL(No available video device) - exiting Set 'tap0' nonpersistent Releasing lockfile of preconfigured tap device 'tap0' $ ldd /mnt/back/yocto/poky2/build/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-x86_64 |grep -i sdl libSDL-1.2.so.0 => /lib64/libSDL-1.2.so.0 (0x00007ff4c6b1b000)
At least you can replicate it on demand... I'd suggest putting a strace in runqemu-internal so you can get a log from qemu when it works and when it doesn't, and then diffing then.
Created attachment 1420 [details] strace for the first runqemu - minimal image
Created attachment 1421 [details] strace for second runqemu - sato image
The first strace is longer because qemu actually starts there, I've stopped it as soon as I could. Also, if a bitbake core-image-sato in the build dir where I've built core-image-minimal, none of them will work anymore, I need to wipe tmp and rebuild minimal I want to boot the image.
Well I have looked into this a little further, this is going to be fun! I put qemu under the debugger and the trigger that's causing it seems to be a memory corruption. I loaded the debuginfo for SDL and found that during the SDL_VideoInit-> SDL_X11_LoadSymbols(), the SDL_X11_HAVE_BASEXLIB seems to go from 1 to 0 and then a check later for BASEXLIB fails and causes our SDL Error. The change occurs during the SDL_X11_SYM(...) linkage I also installed the F19 qemu packages and ran the same and it worked correctly
after 'bitbake libxrandr-native', I can start qemu for qemux86 sato image. Double checking it.
I looked into this further and discovered that via the debugger, that when the SDL_X11_HAVE_BASEXLIB changes it's looking for the XMissingExtension() function in libXext, I am still not sure why, but it's not found with the system libXext.
BTW, I put a gdb "watch" on SDL_X11_HAVE_BASEXLIB and then set a break point in the SDL_LoadFunction (break if name="XMissingExtension"), and saw the dlsym's _dlerror_run() fail, I have not dug deeper yet.
When start qemu, it calls SDL_Init(), and finally calls SDL_LoadObject(). Then it calls dlopen to open 4 dynamic libraries: libX11.so.6, libXext.so.6, libXrender.so.1 and libXrandr.so.2. Unfortunately, it fails to dlopen libXext.so.6 then show sdl init failed. There is a undefined symbol `_XEatDataWords' in library libXext.so.6 (/lib64/libXext.so.6) which should be provided by libX11.so. File tmp/sysroot/*-native/usr/lib/libX11.so.6 is searched first and used. As we know, it is from package libx11-native-1.5.0. And it doesn't provides symbol `_XEatDataWords'. Symbol `_XEatDataWords' is from libx11 version 1.6.0 which version the Fedora 19 uses. Update libx11 to latest version 1.6.1 to fix this problem.
Fixed by http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=f0a690dd9daf8098306a9776975b537e28e07dfa
Marked as Verified.