# 10.1 KVM guest can't startx (EE) Illegal instruction at address 0x4a40f0



## BostonDriver (Mar 21, 2015)

I'm trying to get X running on a 10.1 system running as a KVM guest.  This is a brand new installation, though I did `freebsd-update` & `pkg upgrade` / `pkg update` to try to resolve.

For KVM guest, is there a device I should use in lieu of vesa?  With vesa I see:


```
[  43.904] (II) VESA(0): VESA VBE OEM Product Rev: Rev. 1
[  43.905] (II) VESA(0): virtual address = 0x804600000,
  physical address = 0xfd000000, size = 16777216
[  43.906] (EE) Illegal instruction at address 0x4a40f0
[  43.906] (EE)
Fatal server error:
[  43.906] (EE) Caught signal 4 (Illegal instruction). Server aborting
```

I used `X -configure` and in the xorg.conf played with settings that looked "in the ball park", no luck.

I've installed xorg via `pkg`, not building from ports.

Full /var/log/Xorg.0.log is at http://pastebin.com/Fei6UHbF

Thanks for any clue


----------



## BostonDriver (Mar 29, 2015)

getopt said:


> Maybe you did not install the proper video driver?



The driver for vesa(4) is installed.  On the same KVM host, 10.0-Release works fine


----------



## tobik@ (Mar 29, 2015)

How are you starting your guest? You can try other options for the graphics adapter KVM uses e.g. -vga vmware, -vga std, or -vga cirrus.


----------



## Daniel Bakai (Apr 8, 2015)

I've encountered the same problem with a brand new install, using ports.
The problem persists even with VMWare, Cirrus and VGA cards and the appropriate drivers.

Full log with VMWare VGA is at: http://pastebin.com/nY0jW7nV


----------



## Daniel Bakai (Apr 8, 2015)

The problem can be traced back to the xf86SlowBcopy() function in the libvgahw.so library (x11-servers/xorg-server):

```
Program received signal SIGILL, Illegal instruction.
[Switching to Thread 803806400 (LWP 100500/Xorg)]
0x00000000004a5d90 in xf86SlowBcopy ()
(gdb) bt
#0  0x00000000004a5d90 in xf86SlowBcopy ()
#1  0x000000080407e0e5 in vgaHWSaveFonts ()
  from /usr/local/lib/xorg/modules/libvgahw.so
#2  0x0000000803e7221f in VMWAREPreInit ()
  from /usr/local/lib/xorg/modules/drivers/vmware_drv.so
#3  0x000000000047f4cf in InitOutput ()
#4  0x0000000000429e06 in _start ()
#5  0x0000000000429aff in _start ()
#6  0x0000000800816000 in ?? ()
#7  0x0000000000000000 in ?? ()
```
*Compiling the xorg-server from ports with gcc instead of clang results in a working library and everything seems to be working fine.*


----------



## EW1 (Jul 12, 2015)

Thanks, Daniel.  You have saved me many hours of frustration tracking that down.

Let me add that on a fresh install of 10.1 in an RHEL7 KVM host with most of the packages being binary installs, that the gcc48 compiler (gcc48, v. 4.8.5) seemed to behave the best and produced no circular dependencies.

After finding this little make.conf fragment from Roland Smith (addressing another Clang vs. GCC port build issue):


```
.if ${.CURDIR:M*/www/chromium}
USE_GCC?=yes
.endif
```

I was able to run `portmaster -t x11-xservers/xorg-server` with only two interruptions to install binary packages of perl modules that didn't want to play nice.  ("www/chromium" above needs to be changed to "x11-xservers/xorg-server".)

I also had installed some of the x11-drivers packages, thinking that might solve the original problem of the "illegal instruction" error, but when invoking the X server after recompiling with GCC, it complained of a version mismatch between the server and its modules.  After a quick rummage in my bag of hammers, I pulled this one out:

```
pkg info x86\* | rev | cut -d"-" -f2 | rev |
while read port
do
find /usr/ports/x11-drivers -type d -a -name ${port} -exec portmaster -R "{}" \;
done
```
which may not be pretty, but it is effective.

Thanks again!


----------



## backbone (Aug 1, 2015)

Thanks for the solution!
Editing /etc/make.conf

```
.if ${.CURDIR:M*/x11-servers/xorg-server}
USE_GCC?=yes
.endif
```
with postrebuilds
`portmaster -t x11-servers/xorg-server`
works for me too.


----------



## bapt@ (Aug 21, 2015)

Would it be possible to:
1) Open a PR (so that we can track it and fix it: https://bugs.FreeBSD.org/bugzilla/)
2) Provide the following information:
`pciconf -lv`
`pkg info -x xf86`
the log of the failing Xorg


----------



## Ephelyon (Sep 5, 2015)

Bug raised and resolved here:

https://bugs.FreeBSD.org/bugzilla/show_bug.cgi?id=202643


----------

