Bug 698

Summary: QEMU crash when using Ubuntu with NVIDIA proprietary Xorg driver
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Matias <matias.sundman>
Component: devtools / tool chainAssignee: Edwin Zhai <edwin.zhai>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: Medium CC: edwin.zhai, infras.ab.watcher, Infras.watcher, meta.mr.watcher, meta.watcher, sgw
Version: 1.0   
Target Milestone: 1.0 M4   
Hardware: x86   
OS: x86   
Whiteboard:
OS type for building Yocto: Ubuntu Type of Regression: ---
Verified: Documentation change: ---

Description Matias 2011-02-03 05:23:04 UTC
Hi,
I am running a Ubuntu 10.04 x86-64 on an ordinary x86 Nehalem machine.

After running the following commands;

$ wget http://www.yoctoproject.org/downloads/poky/poky-laverne-4.0.tar.bz2
$ tar xjf poky-laverne-4.0.tar.bz2
$ source poky-laverne-4.0/poky-init-build-env poky-4.0-build
$ poky-qemu qemux86


matias@matias-desktop:/local/yocto/poky-4.0-build$ poky-qemu qemux86
Continuing with the following parameters:
KERNEL: [/local/yocto/poky-4.0-build/tmp/deploy/images/bzImage-qemux86.bin]
ROOTFS: [/local/yocto/poky-4.0-build/tmp/deploy/images/poky-image-sato-qemux86.ext3]
FSTYPE: [ext3]
Setting up tap interface under sudo
Acquiring lockfile for tap0...
Warning: distccd not present, no distcc support loaded.
Running qemu...
/local/yocto/poky-4.0-build/tmp/sysroots/x86_64-linux/usr/bin/qemu -kernel /local/yocto/poky-4.0-build/tmp/deploy/images/bzImage-qemux86.bin -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=no,downscript=no -hda /local/yocto/poky-4.0-build/tmp/deploy/images/poky-image-sato-qemux86.ext3 -show-cursor -usb -usbdevice wacom-tablet -vga vmware -enable-gl -no-reboot --append "vga=0 root=/dev/hda mem=128M ip=192.168.7.2::192.168.7.1:255.255.255.0 "
Enabling opengl
/local/yocto/poky-laverne-4.0/scripts/..//scripts/poky-qemu-internal: line 445: 16569 Segmentation fault      $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT"
Set 'tap0' nonpersistent
Releasing lockfile of preconfigured tap device 'tap0'
matias@matias-desktop:/local/yocto/poky-4.0-build$ 


The qemu windows comes up for a moment but then dies due to the line 445: 16569 Segmentation fault.


Regards // Matias
Comment 1 Scott Garman 2011-02-03 11:28:45 UTC
Are you using the proprietary NVIDIA Xorg driver? There is a known issue with the openGL library it ships which can cause this behavior when qemu-native is compiled against it.
Comment 2 Matias 2011-02-03 11:35:39 UTC
This can be seen in the kernel log,
Feb  3 20:33:17 matias-desktop kernel: [43914.197990] qemu[18471]: segfault at 329bd4e ip 000000000329bd4e sp 00007fff4a6dfa00 error 15

I've tried to start both qemux86-64 and qemux86 and both fails with the same fault.
Comment 3 Matias 2011-02-03 13:00:21 UTC
(In reply to comment #1)
> Are you using the proprietary NVIDIA Xorg driver? There is a known issue with
> the openGL library it ships which can cause this behavior when qemu-native is
> compiled against it.

Yes I am , how can I resolve it?
Comment 4 Scott Garman 2011-02-03 13:40:30 UTC
I'm afraid we don't have a workaround for this yet. I was able to verify the crashes no longer happen when I uninstalled the NVIDIA driver and ensured that the OpenGL libraries no longer existed in /usr/lib/nvidia-current. Then when I rebuilt qemu-native (bitbake qemu-native -c clean; bitbake qemu-native), qemu would no longer crash. But this also means you'd lose the performance of the proprietary driver.
Comment 5 Matias 2011-02-03 14:03:15 UTC
(In reply to comment #4)
> I'm afraid we don't have a workaround for this yet. I was able to verify the
> crashes no longer happen when I uninstalled the NVIDIA driver and ensured that
> the OpenGL libraries no longer existed in /usr/lib/nvidia-current. Then when I
> rebuilt qemu-native (bitbake qemu-native -c clean; bitbake qemu-native), qemu
> would no longer crash. But this also means you'd lose the performance of the
> proprietary driver.

Aah, Ok -- I have two machines and both have the Nvidia driver since I am also doing some graphics intensive stuff. Have to think about this - perhaps a KVM,  Vmware instance but then I loose some of the CPU horse power ... :-)

Anyways, thanks for your prompt assistance!

Cheers // Matias
Comment 6 Matias 2011-02-03 14:09:38 UTC
One more thing, I just started a Common_PC WindRiver project with;

# make start-target TOPTS="-t"

and that QEMU instance started nicely - perhaps something there to look at :-)

Cheers // Matias
Comment 7 Saul Wold 2011-03-13 22:40:51 UTC
See 649 also
Comment 8 Edwin Zhai 2011-03-14 06:51:16 UTC
(In reply to comment #1)
> Are you using the proprietary NVIDIA Xorg driver? There is a known issue with
> the openGL library it ships which can cause this behavior when qemu-native is
> compiled against it.

Scott,
Can you give me some info of this known issue? I suspect nvidia GL library conflict with some system library.

Thanks,
edwin
Comment 9 Edwin Zhai 2011-03-31 05:19:46 UTC
it's the same bug as 649 caused by nVidia proprietary driver.

*** This bug has been marked as a duplicate of bug 649 ***