Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 582078 - x11-drivers/xf86-video-virtualbox-5.0.20: modprobe: ERROR: could not insert 'vboxvideo': Exec format error
Summary: x11-drivers/xf86-video-virtualbox-5.0.20: modprobe: ERROR: could not insert '...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 590572 590648
  Show dependency tree
 
Reported: 2016-05-04 12:37 UTC by Paolo Pedroni
Modified: 2019-04-20 19:44 UTC (History)
10 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
xf86-video-virtualbox-5.0.20:20160504-120744.log.gz (xf86-video-virtualbox-5.0.20:20160504-120744.log.gz,152.60 KB, application/gzip)
2016-05-04 12:37 UTC, Paolo Pedroni
Details
ebuild for xf86-video-virtualbox-5.1.8-r1 (xf86-video-virtualbox-5.1.8-r1.ebuild,5.04 KB, text/plain)
2016-11-17 17:46 UTC, Joakim Tjernlund
Details
ebuild for virtualbox-guest-additions-5.1.8-r1 (virtualbox-guest-additions-5.1.8-r1.ebuild,5.88 KB, text/plain)
2016-11-17 17:47 UTC, Joakim Tjernlund
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Pedroni 2016-05-04 12:37:36 UTC
Created attachment 433206 [details]
xf86-video-virtualbox-5.0.20:20160504-120744.log.gz

From "journalctl -xb":
mag 04 12:45:20 paolop2.si.unimib.it kernel: module: vboxvideo: Unknown rela relocation: 4
mag 04 12:45:20 paolop2.si.unimib.it systemd-modules-load[111]: Failed to insert 'vboxvideo': Exec format error
mag 04 12:45:20 paolop2.si.unimib.it systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE
mag 04 12:45:20 paolop2.si.unimib.it systemd[1]: Failed to start Load Kernel Modules.

In "/var/log/Xorg.0.log":
[     3.639] (II) AIGLX: Screen 0 is not DRI2 capable
[     3.639] (EE) AIGLX: reverting to software rendering
[     4.193] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[     4.194] (II) AIGLX: Loaded and initialized swrast
[     4.194] (II) GLX: Initialized DRISWRAST GL provider for screen 0

Almost at the end of the compile process I also get:
  find /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20/work/VirtualBox-5.0.20/src/VBox/Additions/linux/drm/.tmp_versions -name '*.mod' | xargs -r grep -h '\.ko$' | sort -u | sed 's/\.ko$/.o/' | scripts/mod/modpost   -i ./Module.symvers -I /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20/work/VirtualBox-5.0.20/src/VBox/Additions/linux/drm/Module.symvers  -o /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20/work/VirtualBox-5.0.20/src/VBox/Additions/linux/drm/Module.symvers  -E -w  -s -T -
WARNING: could not find /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20/work/VirtualBox-5.0.20/src/VBox/Additions/linux/drm/.HGSMIBase.o.cmd for /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20/work/VirtualBox-5.0.20/src/VBox/Additions/linux/drm/HGSMIBase.o
WARNING: "VBoxGuest_RTErrConvertToErrno" [/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20/work/VirtualBox-5.0.20/src/VBox/Additions/linux/drm/vboxvideo.ko] undefined!
WARNING: "VBoxGuest_RTAssertShouldPanic" [/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20/work/VirtualBox-5.0.20/src/VBox/Additions/linux/drm/vboxvideo.ko] undefined!
WARNING: "VBoxGuest_RTAssertMsg2Weak" [/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20/work/VirtualBox-5.0.20/src/VBox/Additions/linux/drm/vboxvideo.ko] undefined!
WARNING: "VBoxGuest_RTAssertMsg1Weak" [/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20/work/VirtualBox-5.0.20/src/VBox/Additions/linux/drm/vboxvideo.ko] undefined!
WARNING: "VBoxGuest_RTLogBackdoorPrintf" [/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20/work/VirtualBox-5.0.20/src/VBox/Additions/linux/drm/vboxvideo.ko] undefined!

...but the emerge succeeds anyway.

# emerge --info =x11-drivers/xf86-video-virtualbox-5.0.20
Portage 2.2.26 (python 2.7.10-final-0, default/linux/amd64/13.0/desktop, gcc-5.3.0, glibc-2.22-r4, 4.4.6-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.4.6-gentoo-x86_64-Intel-R-_Pentium-R-_CPU_G630_@_2.70GHz-with-gentoo-2.2
KiB Mem:     4046036 total,   1154488 free
KiB Swap:    3144700 total,   3144088 free
Timestamp of repository gentoo: Wed, 04 May 2016 07:15:01 +0000
sh dash 0.5.8.2
ld GNU gold (Gentoo 2.25.1 p1.1 2.25.1) 1.11
distcc 3.2rc1 x86_64-pc-linux-gnu [enabled]
ccache version 3.2.4 [disabled]
app-shells/bash:          4.3_p42-r1::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::gentoo
dev-util/ccache:          3.2.4::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.19.1::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            5.3.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.europe.gentoo.org/gentoo-portage
    priority: -1000

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=sandybridge -mno-avx -msahf -mno-xsave -mno-xsaveopt -mno-aes --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -flto=3 -fuse-linker-plugin -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -fgraphite-identity -ftree-vectorize"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=sandybridge -mno-avx -msahf -mno-xsave -mno-xsaveopt -mno-aes --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -flto=3 -fuse-linker-plugin -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -fgraphite-identity -ftree-vectorize"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going y --with-bdeps y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup compress-build-logs config-protect-if-modified distcc distlocks ebuild-locks ipc-sandbox merge-sync news parallel-fetch protect-owned sandbox sfperms split-elog split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://tux.rainside.sk/gentoo/ http://gentoo.supp.name/ http://mirror.leaseweb.com/gentoo/ http://gentoo.mneisen.org/ ftp://mirrors.linuxant.fr/distfiles.gentoo.org/"
LANG="it_IT.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common -flto=3 -fuse-linker-plugin -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -fgraphite-identity -ftree-vectorize"
MAKEOPTS="-j11 -l2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 bash-completion branding bzip2 cairo caps cdda cdr cli consolekit cracklib crypt curl cxx dbus dga dri dts dvd dvdr emboss encode exif expat fam fbcon firefox flac fontconfig fortran ftp gdbm gif glamor gmp gnutls gpm gtk iconv icu idn ipv6 jpeg lcms libnotify libsamplerate lm_sensors lzma lzo mad mmap mmx mmxext mng modules mp3 mp4 mpeg multilib ncurses nls nptl nsplugin offensive ogg opengl openmp pam pango pch pcre pdf png policykit postscript ppds pulseaudio qt3support qt4 rdesktop readline sdl seccomp session sockets spell sqlite sse sse2 ssl startup-notification svg symlink syslog systemd sysvipc threads tidy tiff truetype udev udisks unicode upower usb vim-syntax vorbis wayland win32codecs wxwidgets x264 xattr xcb xcomposite xml xpm xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="hda-intel virmidi" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="it it_IT" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="virtualbox" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

x11-drivers/xf86-video-virtualbox-5.0.20::gentoo was built with the following:
USE="dri" ABI_X86="64" PYTHON_TARGETS="python2_7"
CFLAGS="-O2 -pipe -march=sandybridge -mno-avx -msahf -mno-xsave -mno-xsaveopt -mno-aes --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -flto=3 -fuse-linker-plugin -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -fgraphite-identity -ftree-vectorize -fuse-ld=bfd -fno-loop-interchange -fno-tree-loop-distribution -fno-tree-vectorize -fno-loop-strip-mine -fno-loop-block -fno-graphite-identity -fno-lto -fno-use-linker-plugin"
CXXFLAGS="-O2 -pipe -march=sandybridge -mno-avx -msahf -mno-xsave -mno-xsaveopt -mno-aes --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -flto=3 -fuse-linker-plugin -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -fgraphite-identity -ftree-vectorize -fuse-ld=bfd -fno-loop-interchange -fno-tree-loop-distribution -fno-tree-vectorize -fno-loop-strip-mine -fno-loop-block -fno-graphite-identity -fno-lto -fno-use-linker-plugin"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common -flto=3 -fuse-linker-plugin -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -fgraphite-identity -ftree-vectorize -Wl,-fuse-ld=bfd -fno-loop-interchange -fno-tree-loop-distribution -fno-tree-vectorize -fno-loop-strip-mine -fno-loop-block -fno-graphite-identity -fno-lto -fno-use-linker-plugin"

# emerge -1pqv =x11-drivers/xf86-video-virtualbox-5.0.20
[ebuild   R   ] x11-drivers/xf86-video-virtualbox-5.0.20  USE="dri" PYTHON_TARGETS="python2_7"
Comment 1 Oleksii 2016-05-07 13:49:52 UTC
Hello, for me issue with version 5.0.20 also exists.

I checked with 4.5.3-gentoo #1 SMP PREEMPT

When drm and ttm not enabled in kernel - alot of messages "undefined symbol"

When drm and ttm enabled in kernel - another error:

vboxvideo: Unknown symbol __stack_chk_fail (err 0)

After compile x11-drivers/xf86-video-virtualbox 
with CFLAGS="-fno-stack-protector -O2" I got next error:

module: vboxvideo: Unknown rela relocation: 4

Control case: I downloaded and mounted VBoxGuestAdditions_5.0.16.iso "additions" and installed with non-portage way.

This working. 

[ 2657.402480] [drm] VRAM 02e00000
[ 2657.405478] [TTM] Zone  kernel: Available graphics memory: 4003012 kiB
[ 2657.406508] [TTM] Zone   dma32: Available graphics memory: 2097152 kiB
[ 2657.407089] [TTM] Initializing pool allocator
[ 2657.407700] [TTM] Initializing DMA pool allocator
[ 2657.409317] fbcon: vboxdrmfb (fb0) is primary device
[ 2657.539395] Console: switching to colour frame buffer device 100x37
[ 2657.540421] vboxvideo 0000:00:02.0: fb0: vboxdrmfb frame buffer device
[ 2657.549449] [drm] Initialized vboxvideo 1.0.0 20130823 for 0000:00:02.0 on minor 1

Please, inform me what I need provide in order to get issue fixed?
I want always install additions only from Portage in order to keep system.

Thanks!
Comment 2 Jochen Trumpf 2016-05-08 11:21:27 UTC
I am seeing the exact same thing as Oleksii. Compiled with CFLAGS="-march=native -msse4.1 -O3 -pipe" (my normal setting I get

vboxvideo: Unknown symbol __stack_chk_fail (err 0)

and compiled with CFLAGS="-fno-stack-protector" through a package.env entry I get

module: vboxvideo: Unknown rela relocation: 4

Anything else I could try? Maybe my kernel is missing something relevant? I noticed the 
[ 2657.540421] vboxvideo 0000:00:02.0: fb0: vboxdrmfb frame buffer device
entry in Oleksii's working example. Does one need to enable a particular framebuffer driver for this to work?

Oleksii: not sure how you enabled TTM, I selected DRM_VIRTIO_GPU as DRM_TTM itself has no prompt but is selected by the former. Not sure if this is the right thing to do?
Comment 3 Ian Stakenvicius (RETIRED) gentoo-dev 2016-05-09 14:48:51 UTC
(In reply to Oleksii from comment #1)
> Hello, for me issue with version 5.0.20 also exists.
> 
> I checked with 4.5.3-gentoo #1 SMP PREEMPT
> 
> When drm and ttm not enabled in kernel - alot of messages "undefined symbol"
> 
> When drm and ttm enabled in kernel - another error:
> 
> vboxvideo: Unknown symbol __stack_chk_fail (err 0)
> 
> After compile x11-drivers/xf86-video-virtualbox 
> with CFLAGS="-fno-stack-protector -O2" I got next error:
> 
> module: vboxvideo: Unknown rela relocation: 4
> 
> Control case: I downloaded and mounted VBoxGuestAdditions_5.0.16.iso
> "additions" and installed with non-portage way.
> 


Firstly, 5.0.16 is still in the gentoo repo, so you can have it installed through that just by masking the newer version(s).

Secondly, this driver -definitely- needs drm and ttm enabled in the kernel; support for not having those two things in-kernel was removed after 5.0.16.

Unfortunately, the other bugs are indeed bugs and are something we will have to sort out.  Off hand I don't have any idea what might be causing it (nor do I have any familiarity with __stack_chk_fail and other related errors in general), so this is unlikely to be a quick fix.  Sorry... :/
Comment 4 Ian Stakenvicius (RETIRED) gentoo-dev 2016-05-11 15:45:20 UTC
I pushed 5.0.20-r1 yesterday, it builds some of the internal objects for vboxvideo.ko a little differently and I think will resolve the __stack_chk_fail issues that way (at least it seems so in testing).  The ebuild also checks for CONFIG_DRM and CONFIG_DRM_TTM in the kernel's configuration to warn if they are not present.

It's not perfect, as in the x86 vm I have access to for testing the driver still seems to cause a panic related to memory access.  I don't know if this will occur in all cases or just that particular vm, so please report back.  Note, you may need to set a vmalloc= kernel commandline argument that is at least 1.5x the size of the gpu memory setting you use before the driver will attempt to load.
Comment 5 Paolo Pedroni 2016-05-12 08:03:48 UTC
(In reply to Ian Stakenvicius from comment #4)
> I pushed 5.0.20-r1 yesterday, it builds some of the internal objects for
> vboxvideo.ko a little differently and I think will resolve the
> __stack_chk_fail issues that way (at least it seems so in testing).  The
> ebuild also checks for CONFIG_DRM and CONFIG_DRM_TTM in the kernel's
> configuration to warn if they are not present.
> 
> It's not perfect, as in the x86 vm I have access to for testing the driver
> still seems to cause a panic related to memory access.  I don't know if this
> will occur in all cases or just that particular vm, so please report back. 
> Note, you may need to set a vmalloc= kernel commandline argument that is at
> least 1.5x the size of the gpu memory setting you use before the driver will
> attempt to load.

For me it just hangs, even with vmalloc 3 times the gpu memory setting of the VM
Comment 6 Paolo Pedroni 2016-05-12 08:38:33 UTC
(In reply to Paolo Pedroni from comment #5)
> For me it just hangs, even with vmalloc 3 times the gpu memory setting of
> the VM

Sorry, I've checked the logs, apparently the module loads properly (here vmalloc=200M, with GPU memory set to 128M)

mag 12 10:13:22 paolop2.si.unimib.it kernel: [drm] VRAM 08000000
mag 12 10:13:22 paolop2.si.unimib.it kernel: [TTM] Zone  kernel: Available graphics memory: 2023018 kiB
mag 12 10:13:22 paolop2.si.unimib.it kernel: [TTM] Initializing pool allocator
mag 12 10:13:22 paolop2.si.unimib.it kernel: [TTM] Initializing DMA pool allocator
mag 12 10:13:22 paolop2.si.unimib.it kernel: checking generic (e0000000 12c000) vs hw (e0000000 8000000)
mag 12 10:13:22 paolop2.si.unimib.it kernel: fb: switching to vboxdrmfb from simple
mag 12 10:13:22 paolop2.si.unimib.it kernel: Console: switching to colour dummy device 132x43
mag 12 10:13:22 paolop2.si.unimib.it kernel: fbcon: vboxdrmfb (fb0) is primary device
mag 12 10:13:22 paolop2.si.unimib.it kernel: Console: switching to colour frame buffer device 100x37
mag 12 10:13:22 paolop2.si.unimib.it kernel: vboxvideo 0000:00:02.0: fb0: vboxdrmfb frame buffer device
mag 12 10:13:22 paolop2.si.unimib.it kernel: BTRFS info (device sda4): disk space caching is enabled
mag 12 10:13:22 paolop2.si.unimib.it kernel: [drm] Initialized vboxvideo 1.0.0 20130823 for 0000:00:02.0 on minor 0

Later it's sddm that segfaults:
mag 12 10:13:24 paolop2.si.unimib.it sddm[290]: Running display setup script  "/usr/share/sddm/scripts/Xsetup"
mag 12 10:13:24 paolop2.si.unimib.it sddm[290]: Display server started.
mag 12 10:13:24 paolop2.si.unimib.it sddm[290]: Socket server starting...
mag 12 10:13:24 paolop2.si.unimib.it sddm[290]: Socket server started.
mag 12 10:13:24 paolop2.si.unimib.it sddm[290]: Greeter starting...
mag 12 10:13:24 paolop2.si.unimib.it sddm[290]: Adding cookie to "/var/run/sddm/{820af8bc-a4c4-4b59-9e98-0f68ac14eeb0}"
mag 12 10:13:24 paolop2.si.unimib.it kernel: sddm[290]: segfault at 890 ip 0000000000000890 sp 00007fff6c56ca68 error 14 in sddm[400000+4e000]
mag 12 10:13:24 paolop2.si.unimib.it sddm[290]: QProcess: Destroyed while process ("/usr/libexec/sddm-helper") is still running.
mag 12 10:13:24 paolop2.si.unimib.it systemd[1]: sddm.service: Main process exited, code=killed, status=11/SEGV
mag 12 10:13:24 paolop2.si.unimib.it systemd[1]: sddm.service: Unit entered failed state.
mag 12 10:13:24 paolop2.si.unimib.it systemd[1]: sddm.service: Failed with result 'signal'.
mag 12 10:13:24 paolop2.si.unimib.it sddm[290]: /usr/bin/xauth: (stdin):1:  bad "remove" command line
mag 12 10:13:24 paolop2.si.unimib.it sddm[290]: /usr/bin/xauth: (stdin):2:  bad "add" command line
mag 12 10:13:24 paolop2.si.unimib.it systemd[1]: sddm.service: Service hold-off time over, scheduling restart.

And the screen stays frozen and I cannot ssh to the VM.
Comment 7 Paolo Pedroni 2016-05-12 08:51:36 UTC
The plot thickens. After rebuilding sddm, I still get hangs, but this time, before sddm segfaults I also get a kernel trap:

mag 12 10:35:56 paolop2.si.unimib.it sddm[273]: Running display setup script  "/usr/share/sddm/scripts/Xsetup"
mag 12 10:35:56 paolop2.si.unimib.it sddm[273]: Display server started.
mag 12 10:35:56 paolop2.si.unimib.it sddm[273]: Socket server starting...
mag 12 10:35:56 paolop2.si.unimib.it sddm[273]: Socket server started.
mag 12 10:35:56 paolop2.si.unimib.it sddm[273]: Greeter starting...
mag 12 10:35:56 paolop2.si.unimib.it sddm[273]: Adding cookie to "/var/run/sddm/{d3b7b455-0724-48e2-9ebf-627ddbd43f50}"
mag 12 10:35:56 paolop2.si.unimib.it sddm[273]: /usr/bin/xauth: (stdin):1:  bad "remove" command line
mag 12 10:35:56 paolop2.si.unimib.it sddm[273]: /usr/bin/xauth: (stdin):2:  bad "add" command line
mag 12 10:35:56 paolop2.si.unimib.it sddm[273]: QProcess: Destroyed while process ("/usr/libexec/sddm-helper") is still running.
mag 12 10:35:56 paolop2.si.unimib.it kernel: traps: sddm[273] trap invalid opcode ip:7fa5c5ad4ce0 sp:7fff49529f28 error:0 in libQt5Core.so.5.5.1[7fa5c
mag 12 10:35:56 paolop2.si.unimib.it systemd[1]: sddm.service: Main process exited, code=killed, status=4/ILL
mag 12 10:35:56 paolop2.si.unimib.it systemd[1]: sddm.service: Unit entered failed state.
mag 12 10:35:56 paolop2.si.unimib.it systemd[1]: sddm.service: Failed with result 'signal'.
mag 12 10:35:56 paolop2.si.unimib.it systemd[1]: sddm.service: Service hold-off time over, scheduling restart.
mag 12 10:35:56 paolop2.si.unimib.it systemd[1]: Stopped Simple Desktop Display Manager.

And after a while sddm segfaults again:
mag 12 10:35:57 paolop2.si.unimib.it sddm[324]: Socket server starting...
mag 12 10:35:57 paolop2.si.unimib.it sddm[324]: Socket server started.
mag 12 10:35:57 paolop2.si.unimib.it sddm[324]: Greeter starting...
mag 12 10:35:57 paolop2.si.unimib.it sddm[324]: Adding cookie to "/var/run/sddm/{55c96875-21b8-40f7-b762-ac534344380b}"
mag 12 10:35:57 paolop2.si.unimib.it sddm[324]: /usr/bin/xauth: (stdin):1:  bad "remove" command line
mag 12 10:35:57 paolop2.si.unimib.it sddm[324]: /usr/bin/xauth: (stdin):2:  bad "add" command line
mag 12 10:35:57 paolop2.si.unimib.it sddm[324]: QProcess: Destroyed while process ("/usr/libexec/sddm-helper") is still running.
mag 12 10:35:57 paolop2.si.unimib.it kernel: sddm[324]: segfault at 7a0 ip 00000000000007a0 sp 00007ffdd7be6068 error 14 in sddm[400000+4e000]
mag 12 10:35:57 paolop2.si.unimib.it systemd[1]: sddm.service: Main process exited, code=killed, status=11/SEGV
mag 12 10:35:57 paolop2.si.unimib.it systemd[1]: sddm.service: Unit entered failed state.
mag 12 10:35:57 paolop2.si.unimib.it systemd[1]: sddm.service: Failed with result 'signal'.
mag 12 10:35:57 paolop2.si.unimib.it systemd[1]: sddm.service: Service hold-off time over, scheduling restart.
mag 12 10:35:57 paolop2.si.unimib.it systemd[1]: Stopped Simple Desktop Display Manager.

Always with screen frozen and system unresponsive.
Comment 8 Jochen Trumpf 2016-05-12 11:57:42 UTC
The first problem I run into is [excerpt from build.log]

+++

x86_64-pc-linux-gnu-g++ -c -O2 -g -pipe -pedantic -Wshadow -Wshadow -Wall -Wextra -Wno-missing-field-initializers -Wno-unused -Wno-trigraphs -fdiagnostics-show-option -Wno-unused-parameter -Wlogical-op -Wno-long-long -Wno-long-long -Wno-delete-non-virtual-dtor -Wno-variadic-macros -march=native -msse4.1 -O3 -pipe  -fno-omit-frame-pointer -fno-strict-aliasing -fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN -DRT_USE_VISIBILITY_DEFAULT -fvisibility-inlines-hidden  -fno-exceptions -Werror -m64 -Iinclude -I/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/src/libs/liblzf-3.4 -I/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/src/libs/kStuff/kStuff/include -I/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/out/linux.amd64/release/obj/RuntimeGuestR3/dtrace -I/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/include -I/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/out/linux.amd64/release -DVBOX -DVBOX_OSE -DVBOX_WITH_64_BITS_GUESTS -DVBOX_WITH_DEBUGGER -DRT_OS_LINUX -D_FILE_OFFSET_BITS=64 -DRT_ARCH_AMD64 -D__AMD64__
 -DVBOX_WITH_HARDENING -DRTPATH_APP_PRIVATE=\"/opt/VirtualBox\" -DRTPATH_APP_PRIVATE_ARCH=\"/opt/VirtualBox\" -DRTPATH_SHARED_LIBS=\"/opt/VirtualBox\" -DRTPATH_APP_DOCS=\"/opt/VirtualBox\" -DIN_RING3 -DVBOX_WITH_DTRACE -DVBOX_WITH_DTRACE_R3 -DIN_GUEST -DIN_GUEST_R3 -DIN_RT_R3 -DGC_ARCH_BITS=64 -DIN_RT_R3 -DIN_SUP_R3 -DLDR_WITH_NATIVE -DLDR_WITH_ELF32 -DLDR_WITH_PE -DRT_WITH_VBOX -DRT_WITHOUT_NOCRT_WRAPPERS -DLDR_WITH_KLDR -DRT_WITH_ICONV_CACHE -DLOG_USE_C99 -DRT_WITHOUT_EXEC_ALLOC -Wp,-MD,/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/out/linux.amd64/release/obj/RuntimeGuestR3/common/asn1/asn1-ut-string.o.dep -Wp,-MT,/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/out/linux.amd64/release/obj/RuntimeGuestR3/common/asn1
/asn1-ut-string.o -Wp,-MP -o /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/out/linux.amd64/release/obj/RuntimeGuestR3/common/asn1/asn1-ut-string.o /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/src/VBox/Runtime/common/asn1/asn1-ut-string.cpp

[...]

In file included from
/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/src/VBox/Runtime/common/asn1/asn1-ut-string.cpp:36:0:
/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/include/iprt/string.h: In function ‘int
rtAsn1String_CheckSanity(PCRTASN1STRING, PRTERRINFO, const char*, size_t*)’:
/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/include/iprt/string.h:1182:5: error: ‘uc’ may be used uninitialized
in this function [-Werror=maybe-uninitialized]
     if (CodePoint < 0x7fffffff)
     ^
/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/src/VBox/Runtime/common/asn1/asn1-ut-string.cpp:1007:21: note: ‘uc’
was declared here
             RTUNICP uc;
                     ^
 [...]

 In file included from
 /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/src/VBox/Runtime/common/asn1/asn1-ut-string.cpp:36:0:
/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/include/iprt/string.h: In function ‘int
rtIso2022RecodeAsUtf8(uint32_t, const char*, uint32_t, char*, size_t)’:
/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/include/iprt/string.h:1182:5: error: ‘uc’ may be used uninitialized
in this function [-Werror=maybe-uninitialized]
     if (CodePoint < 0x7fffffff)
     ^
/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/src/VBox/Runtime/common/asn1/asn1-ut-string.cpp:1038:21: note: ‘uc’
was declared here
             RTUNICP uc;
                     ^

[...]

cc1plus: all warnings being treated as errors
kmk: ***
[/var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.0.20-r1/work/VirtualBox-5.0.20/out/linux.amd64/release/obj/RuntimeGuestR3/common/asn1/asn1-ut-string.o]
Error 1

[...]

 * ERROR: x11-drivers/xf86-video-virtualbox-5.0.20-r1::gentoo failed (compile phase):
 * emake failed

+++

The problem is this code sequence in asn1-ut-string.cpp (appears twice)

RTUNICP uc;
rc = rtIso2022Decoder_GetNextUniCp(&Decoder, &uc);

in conjunction with -Werror.

Similar issues in virtualbox-guest-additions are circumvented through

## don't build with -Werror
VBOX_WITH_WARNINGS_AS_ERRORS :=

in the localconfig file (this is in the tree). Adding these two
lines to xf86-video-virtualbox-5-localconfig as well at least lets
the build succeed. Could this maybe added in the tree or are there
reasons not to do so?


Then when I try to run the new driver I get [excerpt from dmesg]

+++

[    2.245940] vboxguest: misc device minor 58, IRQ 20, I/O port d020, MMIO at 00000000f0000000 (size 0x400000)
[    2.245941] vboxguest: Successfully loaded version 5.0.20_OSE (interface 0x00010004)
[    2.259850] [drm] VRAM 01000000
[    2.261769] [TTM] Zone  kernel: Available graphics memory: 2025514 kiB
[    2.261770] [TTM] Initializing pool allocator
[    2.261776] [TTM] Initializing DMA pool allocator
[    2.263744] fbcon: vboxdrmfb (fb0) is primary device
[    2.317773] Console: switching to colour frame buffer device 100x37
[    2.321586] vboxvideo 0000:00:02.0: fb0: vboxdrmfb frame buffer device
[    2.321589] [drm] Initialized vboxvideo 1.0.0 20130823 for 0000:00:02.0 on minor 1

[...]

[   10.451247] vboxsf: Successfully loaded version 5.0.20_OSE (interface 0x00010004)
[   10.461245] VBoxService 5.0.20_OSE r106931 (verbosity: 0) linux.amd64 (May 12 2016 16:28:36) release log
               00:00:00.000057 main     Log opened 2016-05-12T10:59:46.359931000Z
[   10.461278] 00:00:00.000121 main     OS Product: Linux
[   10.461296] 00:00:00.000142 main     OS Release: 4.4.6-gentoo
[   10.461313] 00:00:00.000160 main     OS Version: #2 SMP Fri May 6 19:07:57 AEST 2016
[   10.461336] 00:00:00.000177 main     Executable: /usr/sbin/vboxguest-service
               00:00:00.000177 main     Process ID: 2082
               00:00:00.000178 main     Package type: LINUX_64BITS_GENERIC (OSE)
[   10.463086] 00:00:00.001910 main     5.0.20_OSE r106931 started. Verbose level = 0
[   10.707744] sddm[2134]: segfault at 8000000a ip 000000008000000a sp 00007ffe1a9e4c88 error 14 in locale-archive[7fb14226e000+18e000]
[  217.376444] sddm[2296]: segfault at 880 ip 0000000000000880 sp 00007ffe823e7fe8 error 14 in sddm[400000+6a000]
[  282.721038] sddm[2393]: segfault at 740 ip 0000000000000740 sp 00007ffe9aa42528 error 14 in sddm[400000+6a000]

+++

The last two lines are me trying to manually start an X session. Anything else I should try?
Comment 9 Ellison Marks 2016-05-12 23:58:05 UTC
Works for me now, though it took me two days of rebuilding kernels, then giving up and making a "genkernel all". There are multiple kernel settings needed that I gave up on figuring them all out.
Comment 10 Ellison Marks 2016-05-13 00:40:19 UTC
That said, it seems as if vboxvideo is not actually loading, and X is using /usr/lib64/xorg/modules/drivers/modesetting_drv.so, successfully. The specific error in dmesg is as follows:

[   20.758571] vboxvideo: no symbol version for VBoxGuest_RTLogBackdoorPrintf
[   20.758575] vboxvideo: Unknown symbol VBoxGuest_RTLogBackdoorPrintf (err -22)
[   20.758677] vboxvideo: no symbol version for VBoxGuest_RTErrConvertToErrno
[   20.758679] vboxvideo: Unknown symbol VBoxGuest_RTErrConvertToErrno (err -22)
[   20.758745] vboxvideo: no symbol version for VBoxGuest_RTAssertShouldPanic
[   20.758747] vboxvideo: Unknown symbol VBoxGuest_RTAssertShouldPanic (err -22)
[   20.758789] vboxvideo: no symbol version for VBoxGuest_RTAssertMsg1Weak
[   20.758790] vboxvideo: Unknown symbol VBoxGuest_RTAssertMsg1Weak (err -22)
[   20.758813] vboxvideo: no symbol version for VBoxGuest_RTAssertMsg2Weak
[   20.758814] vboxvideo: Unknown symbol VBoxGuest_RTAssertMsg2Weak (err -22)

As a note, I rebuilt virtualbox-guest-additions and xf86-video-virtualbox after building the genkernel, but before rebooting.
Comment 11 Ellison Marks 2016-05-13 00:43:01 UTC
Ah, I meant /usr/lib64/xorg/modules/drivers/vboxvideo_drv.so, not /usr/lib64/xorg/modules/drivers/modesetting_drv.so
Comment 12 Terry Zink 2016-05-19 01:47:34 UTC
(In reply to Ellison Marks from comment #10)
> That said, it seems as if vboxvideo is not actually loading, and X is using
> /usr/lib64/xorg/modules/drivers/modesetting_drv.so, successfully. The
> specific error in dmesg is as follows:
> 
> [   20.758571] vboxvideo: no symbol version for VBoxGuest_RTLogBackdoorPrintf
> [   20.758575] vboxvideo: Unknown symbol VBoxGuest_RTLogBackdoorPrintf (err
> -22)
> [   20.758677] vboxvideo: no symbol version for VBoxGuest_RTErrConvertToErrno
> [   20.758679] vboxvideo: Unknown symbol VBoxGuest_RTErrConvertToErrno (err
> -22)
> [   20.758745] vboxvideo: no symbol version for VBoxGuest_RTAssertShouldPanic
> [   20.758747] vboxvideo: Unknown symbol VBoxGuest_RTAssertShouldPanic (err
> -22)
> [   20.758789] vboxvideo: no symbol version for VBoxGuest_RTAssertMsg1Weak
> [   20.758790] vboxvideo: Unknown symbol VBoxGuest_RTAssertMsg1Weak (err -22)
> [   20.758813] vboxvideo: no symbol version for VBoxGuest_RTAssertMsg2Weak
> [   20.758814] vboxvideo: Unknown symbol VBoxGuest_RTAssertMsg2Weak (err -22)
> 
> As a note, I rebuilt virtualbox-guest-additions and xf86-video-virtualbox
> after building the genkernel, but before rebooting.

Just to note I can confirm I am experiencing the same using genkernel and latest up to date ~amd64.  vboxvideo does not load with symbol version errors.
Comment 13 masterzorag 2016-07-14 16:29:24 UTC
tested an updated, personal build and faced the same:

on compiling:
WARNING: could not find /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.0-r1/work/VirtualBox-5.1.0/src/VBox/Additions/linux/drm/.HGSMIBase.o.cmd for /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.0/work/VirtualBox-5.1.0/src/VBox/Additions/linux/drm/HGSMIBase.o

on module loading:
[78417.226562] vboxvideo: Unknown symbol VBoxGuest_RTLogBackdoorPrintf (err 0)
[78417.228212] vboxvideo: Unknown symbol VBoxGuest_RTErrConvertToErrno (err 0)
[78417.229293] vboxvideo: Unknown symbol VBoxGuest_RTAssertShouldPanic (err 0)
[78417.229595] vboxvideo: Unknown symbol VBoxGuest_RTAssertMsg1Weak (err 0)
[78417.230028] vboxvideo: Unknown symbol VBoxGuest_RTAssertMsg2Weak (err 0)

filename:       /lib/modules/4.6.4/misc/vboxvideo.ko
version:        5.1.0_OSE r108711
license:        GPL and additional rights
description:    Oracle VM VirtualBox Graphics Card
author:         Oracle Corporation
alias:          pci:v000080EEd0000BEEFsv*sd*bc*sc*i*
depends:        drm,drm_kms_helper,ttm,syscopyarea,sysfillrect,sysimgblt
vermagic:       4.6.4 SMP preempt mod_unload modversions 
parm:           modeset:Disable/Enable modesetting (int)

we are missing definitions of 5 functions...
Comment 14 Mike Lothian 2016-10-10 14:46:13 UTC
I added the vboxvideo module to the virtualbox-guest-additions ebuild and removed it from the xf86-video-virtualbox ebuild

This seems to create a vboxvideo module that loads
Comment 15 masterzorag 2016-10-22 10:32:31 UTC
(In reply to masterzorag from comment #13)
> tested an updated, personal build and faced the same:
> 
> on compiling:
> WARNING: could not find
> /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.0-r1/work/VirtualBox-
> 5.1.0/src/VBox/Additions/linux/drm/.HGSMIBase.o.cmd for
> /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.0/work/VirtualBox-5.1.
> 0/src/VBox/Additions/linux/drm/HGSMIBase.o
> 
> on module loading:
> [78417.226562] vboxvideo: Unknown symbol VBoxGuest_RTLogBackdoorPrintf (err
> 0)
> [78417.228212] vboxvideo: Unknown symbol VBoxGuest_RTErrConvertToErrno (err
> 0)
> [78417.229293] vboxvideo: Unknown symbol VBoxGuest_RTAssertShouldPanic (err
> 0)
> [78417.229595] vboxvideo: Unknown symbol VBoxGuest_RTAssertMsg1Weak (err 0)
> [78417.230028] vboxvideo: Unknown symbol VBoxGuest_RTAssertMsg2Weak (err 0)
> 
> filename:       /lib/modules/4.6.4/misc/vboxvideo.ko
> version:        5.1.0_OSE r108711
> license:        GPL and additional rights
> description:    Oracle VM VirtualBox Graphics Card
> author:         Oracle Corporation
> alias:          pci:v000080EEd0000BEEFsv*sd*bc*sc*i*
> depends:        drm,drm_kms_helper,ttm,syscopyarea,sysfillrect,sysimgblt
> vermagic:       4.6.4 SMP preempt mod_unload modversions 
> parm:           modeset:Disable/Enable modesetting (int)
> 
> we are missing definitions of 5 functions...

Those definitions are referred and resolved by loading the vboxguest.ko and vboxsf.ko first, then loading vboxvideo.ko
Comment 16 Joakim Tjernlund 2016-11-16 13:01:09 UTC
(In reply to masterzorag from comment #15)
> (In reply to masterzorag from comment #13)
> > tested an updated, personal build and faced the same:
> > 
> > on compiling:
> > WARNING: could not find
> > /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.0-r1/work/VirtualBox-
> > 5.1.0/src/VBox/Additions/linux/drm/.HGSMIBase.o.cmd for
> > /var/tmp/portage/x11-drivers/xf86-video-virtualbox-5.1.0/work/VirtualBox-5.1.
> > 0/src/VBox/Additions/linux/drm/HGSMIBase.o
> > 
> > on module loading:
> > [78417.226562] vboxvideo: Unknown symbol VBoxGuest_RTLogBackdoorPrintf (err
> > 0)
> > [78417.228212] vboxvideo: Unknown symbol VBoxGuest_RTErrConvertToErrno (err
> > 0)
> > [78417.229293] vboxvideo: Unknown symbol VBoxGuest_RTAssertShouldPanic (err
> > 0)
> > [78417.229595] vboxvideo: Unknown symbol VBoxGuest_RTAssertMsg1Weak (err 0)
> > [78417.230028] vboxvideo: Unknown symbol VBoxGuest_RTAssertMsg2Weak (err 0)
> > 
> > filename:       /lib/modules/4.6.4/misc/vboxvideo.ko
> > version:        5.1.0_OSE r108711
> > license:        GPL and additional rights
> > description:    Oracle VM VirtualBox Graphics Card
> > author:         Oracle Corporation
> > alias:          pci:v000080EEd0000BEEFsv*sd*bc*sc*i*
> > depends:        drm,drm_kms_helper,ttm,syscopyarea,sysfillrect,sysimgblt
> > vermagic:       4.6.4 SMP preempt mod_unload modversions 
> > parm:           modeset:Disable/Enable modesetting (int)
> > 
> > we are missing definitions of 5 functions...
> 
> Those definitions are referred and resolved by loading the vboxguest.ko and
> vboxsf.ko first, then loading vboxvideo.ko

No, that does not help.
I also tried to rebuild all vbox pks in the gentoo guest but sam problem
Comment 17 Joakim Tjernlund 2016-11-16 13:38:43 UTC
(In reply to Mike Lothian from comment #14)
> I added the vboxvideo module to the virtualbox-guest-additions ebuild and
> removed it from the xf86-video-virtualbox ebuild
> 
> This seems to create a vboxvideo module that loads

YES, that did help! Now vboxvideo loads.

This error is gone:
[  901.017194] vboxvideo: no symbol version for VBoxGuest_RTLogBackdoorPrintf
[  901.018260] vboxvideo: Unknown symbol VBoxGuest_RTLogBackdoorPrintf (err -22)
[  901.018732] vboxvideo: no symbol version for VBoxGuest_RTErrConvertToErrno
[  901.018735] vboxvideo: Unknown symbol VBoxGuest_RTErrConvertToErrno (err -22)
[  901.019159] vboxvideo: no symbol version for VBoxGuest_RTAssertShouldPanic
[  901.019164] vboxvideo: Unknown symbol VBoxGuest_RTAssertShouldPanic (err -22)
[  901.019271] vboxvideo: no symbol version for VBoxGuest_RTAssertMsg1Weak
[  901.019273] vboxvideo: Unknown symbol VBoxGuest_RTAssertMsg1Weak (err -22)
[  901.019323] vboxvideo: no symbol version for VBoxGuest_RTAssertMsg2Weak
[  901.019325] vboxvideo: Unknown symbol VBoxGuest_RTAssertMsg2Weak (err -22)

So it seem vboxvideo needs to be build in the same context as vboxguest or
the above symbols are somehow stripped from vboxguest.

Searching the web(https://bugzilla.opensuse.org/show_bug.cgi?id=998369) I wonder if the missing symbols can have something to do with a missing Module.symvers in vboxguest ?
Comment 18 Joakim Tjernlund 2016-11-16 13:55:01 UTC
What use has xf86-video-virtualbox outside the guest?
If no use is seems to me that converting xf86-video-virtualbox to a USE
flag in virtualbox-guest-additions would be a much better structure of
virtualbox in gentoo.
Comment 19 Joakim Tjernlund 2016-11-17 08:51:44 UTC
I forgot to mention that I run the latest gentoo vbox 5.1.8 this error
makes it impossible to run Gentoo as a guest in an X11 setting, the screen
becomes black when xdm starts and that is it.

Some further analysis gives:
vboxvideo needs some symbols from VBoxClient code which isn't built
in x11-drivers/xf86-video-virtualbox.

I see two ways fix the error:
1) move vboxvideo kernel to virtualbox-guest-additions (under X USE flag)
2) build enough of VBoxClient in xf86-video-virtualbox to satisfy
   vboxvideo needs.

I prefer 1) as vboxvideo also has deps on vboxguest module and
it makes sense to keep all guest kernel modules in one place.

xf86-video-virtualbox then only builds the X11 user space drivers, like
any other X11 video driver.

I don't see what keeping current 2) impl. buys us, anyone?
Comment 20 Joakim Tjernlund 2016-11-17 08:53:05 UTC
oh, and the Importance should be changed to Major I think.
Comment 21 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-11-17 09:18:39 UTC
I'm rather busy with work and private issues. Would you mind creating patches and send them either to this bug or do a pull request on github?
I'd highly appreciate it.
Comment 22 Joakim Tjernlund 2016-11-17 09:29:53 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #21)
> I'm rather busy with work and private issues. Would you mind creating
> patches and send them either to this bug or do a pull request on github?
> I'd highly appreciate it.

Sure, just give me a day or two.
(I should really get started on the Gentoo developer process too ...)
Comment 23 Joakim Tjernlund 2016-11-17 17:46:30 UTC
Created attachment 453672 [details]
ebuild for xf86-video-virtualbox-5.1.8-r1
Comment 24 Joakim Tjernlund 2016-11-17 17:47:09 UTC
Created attachment 453674 [details]
ebuild for virtualbox-guest-additions-5.1.8-r1
Comment 25 Joakim Tjernlund 2016-11-17 17:50:29 UTC
2 new ebuilds changed as discussed in 1):

- Move vboxvideo kernel module to virtualbox-guest-additions
- Add PDEPEND on each other.
Comment 26 Paolo Pedroni 2016-11-18 09:13:46 UTC
(In reply to Joakim Tjernlund from comment #25)
> 2 new ebuilds changed as discussed in 1):
> 
> - Move vboxvideo kernel module to virtualbox-guest-additions
> - Add PDEPEND on each other.

Thanks. I get this error in the xf86-video-virtualbox ebuild, though:

 * QA Notice: command not found:
 * 
 *      /usr/local/portage/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-5.1.8-r1.ebuild: line 69: linux-mod_pkg_setup: command not found

Just a nitpick, but... ;)
Comment 27 Joakim Tjernlund 2016-11-18 09:24:44 UTC
(In reply to Paolo Pedroni from comment #26)
> (In reply to Joakim Tjernlund from comment #25)
> > 2 new ebuilds changed as discussed in 1):
> > 
> > - Move vboxvideo kernel module to virtualbox-guest-additions
> > - Add PDEPEND on each other.
> 
> Thanks. I get this error in the xf86-video-virtualbox ebuild, though:
> 
>  * QA Notice: command not found:
>  * 
>  *     
> /usr/local/portage/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-5.
> 1.8-r1.ebuild: line 69: linux-mod_pkg_setup: command not found
> 
> Just a nitpick, but... ;)

Ahh, yes me too(just delete that line). Ebuild still works though.
I hope you find the new PDEPEND deps OK?
Comment 28 Paolo Pedroni 2016-11-18 10:22:38 UTC
(In reply to Joakim Tjernlund from comment #27)
> Ahh, yes me too(just delete that line). Ebuild still works though.
> I hope you find the new PDEPEND deps OK?

Looks good to me, but it takes a developer to judge that.

The ebuilds work, the module is loaded, but I still get the errors in Xorg.0.log, do you?
Comment 29 Joakim Tjernlund 2016-11-18 12:13:55 UTC
(In reply to Paolo Pedroni from comment #28)
> (In reply to Joakim Tjernlund from comment #27)
> > Ahh, yes me too(just delete that line). Ebuild still works though.
> > I hope you find the new PDEPEND deps OK?
> 
> Looks good to me, but it takes a developer to judge that.
> 
> The ebuilds work, the module is loaded, but I still get the errors in
> Xorg.0.log, do you?

No, as soon the module loaded everything worked. I don't have 
errors in Xorg log.
I didn't have any errors before either, Xorg stared started just fine
and only difference I saw before vs. now is that Xorg log now uses
VGA 1 instead of VGA 0.
It felt as Xorg displayed just fine but on unconnected port when vboxvideo
didn't load.

Anyhow, if you vboxvideo module loads your problem is elsewhere.
Maybe you need to add the suggested xorg.conf.d snippet?
Comment 30 Mike Lothian 2016-11-18 12:19:41 UTC
These are the same issues I was seeing, it was often just falling back to modesetting

I've since switched to VMware
Comment 31 Mike Lothian 2016-11-18 12:20:13 UTC
These are the same issues I was seeing, it was often just falling back to modesetting

I've since switched to VMware
Comment 32 Joakim Tjernlund 2016-11-18 12:22:08 UTC
(In reply to Mike Lothian from comment #31)
> These are the same issues I was seeing, it was often just falling back to
> modesetting
> 
> I've since switched to VMware

When was that? which version of vbox did have this problem?
Comment 33 Mike Lothian 2016-11-18 12:25:58 UTC
I think it was 5.1.2 - 5.1.8 I tried

I've switched to VMware which has its own issues, but video works and avx2 works too
Comment 34 Joakim Tjernlund 2016-11-18 12:30:37 UTC
(In reply to Mike Lothian from comment #33)
> I think it was 5.1.2 - 5.1.8 I tried
> 
> I've switched to VMware which has its own issues, but video works and avx2
> works too

OK, I suspect such issues are between vbox drivers and the underlying GPU HW/driver.

We use various Intel ones, mostly Broadwell/Skylake.
However we just started with Gentoo guests so time will tell
how stable vbox is
Comment 35 Mike Lothian 2016-11-18 12:32:56 UTC
This was on a Gentoo guest on a Windows 7 Skylake laptop
Comment 36 Joakim Tjernlund 2016-11-18 12:36:46 UTC
(In reply to Mike Lothian from comment #35)
> This was on a Gentoo guest on a Windows 7 Skylake laptop

As I recall we tested on a similar settings(Lenove Thinkpad something)

oh, forgot to mention, we use OpenRC and MATE. Maybe systemd/GNOME3 is adding
to the problems ?
Comment 37 Joakim Tjernlund 2016-11-18 12:42:23 UTC
(In reply to Mike Lothian from comment #35)
> This was on a Gentoo guest on a Windows 7 Skylake laptop

You could test with VBoxGuestAdditions_5.0.16.iso ?

See if that makes a difference, if so I guess there is an issue
with how Gentoo builds the drivers/VBOX client.
Comment 38 Mike Lothian 2016-11-18 12:52:24 UTC
I was using systemd and Plasma5, also tried it from the iso to no avail
Comment 39 Joakim Tjernlund 2016-11-18 13:19:34 UTC
(In reply to Mike Lothian from comment #38)
> I was using systemd and Plasma5, also tried it from the iso to no avail

Plasma is known to find every bug there is in GPU drivers/drm
Try kernel 4.8.9 which just got released, got plent of Skylake fixes

Anything older that 4.4.8 is a gamble
Comment 40 Mike Lothian 2016-11-18 13:22:35 UTC
As I said before this was on a Windows 7 guest so there was no Skylake stuff built, I've since switched to VMware
Comment 41 Joakim Tjernlund 2016-11-18 13:23:28 UTC
(In reply to Mike Lothian from comment #40)
> As I said before this was on a Windows 7 guest so there was no Skylake stuff
> built, I've since switched to VMware

Right, I forgot. Sorry
Comment 42 Paolo Pedroni 2016-11-18 14:34:48 UTC
(In reply to Joakim Tjernlund from comment #29)
> No, as soon the module loaded everything worked. I don't have 
> errors in Xorg log.
> I didn't have any errors before either, Xorg stared started just fine
> and only difference I saw before vs. now is that Xorg log now uses
> VGA 1 instead of VGA 0.
> It felt as Xorg displayed just fine but on unconnected port when vboxvideo
> didn't load.
> 
> Anyhow, if you vboxvideo module loads your problem is elsewhere.
> Maybe you need to add the suggested xorg.conf.d snippet?

With that it does not even start:

[ 17494.416] (II) VBoxVideo: guest driver for VirtualBox: vbox
[ 17494.423] (II) vboxvideo: kernel driver found, not loading.
[ 17494.426] (EE) No devices detected.
[ 17494.426] (EE) 
Fatal server error:
[ 17494.426] (EE) no screens found(EE) 
[ 17494.426] (EE) 
Please consult the The X.Org Foundation support 
         at http://wiki.x.org
 for help. 
[ 17494.426] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[ 17494.426] (EE)
Comment 43 Joakim Tjernlund 2016-11-18 15:26:14 UTC
(In reply to Paolo Pedroni from comment #42)
> (In reply to Joakim Tjernlund from comment #29)
> > No, as soon the module loaded everything worked. I don't have 
> > errors in Xorg log.
> > I didn't have any errors before either, Xorg stared started just fine
> > and only difference I saw before vs. now is that Xorg log now uses
> > VGA 1 instead of VGA 0.
> > It felt as Xorg displayed just fine but on unconnected port when vboxvideo
> > didn't load.
> > 
> > Anyhow, if you vboxvideo module loads your problem is elsewhere.
> > Maybe you need to add the suggested xorg.conf.d snippet?
> 
> With that it does not even start:
> 
> [ 17494.416] (II) VBoxVideo: guest driver for VirtualBox: vbox
> [ 17494.423] (II) vboxvideo: kernel driver found, not loading.
> [ 17494.426] (EE) No devices detected.
> [ 17494.426] (EE) 
> Fatal server error:
> [ 17494.426] (EE) no screens found(EE) 
> [ 17494.426] (EE) 
> Please consult the The X.Org Foundation support 
>          at http://wiki.x.org
>  for help. 
> [ 17494.426] (EE) Please also check the log file at "/var/log/Xorg.0.log"
> for additional information.
> [ 17494.426] (EE)

No idea but I do have a question:
in your log I see a module named vboxdrmfb, I don't have that module in my Gentoo system.

Maybe it is missing in Gentoo?
Comment 44 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-11-22 09:44:48 UTC
Thank you for the ebuilds. I currently testing them for virtualbox-5.1.10 bump.
Comment 45 Joakim Tjernlund 2016-11-22 09:46:39 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #44)
> Thank you for the ebuilds. I currently testing them for virtualbox-5.1.10
> bump.

Nice, I hope 5.1.10 will build under kernel 4.9 as well?
Comment 46 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-11-22 09:49:59 UTC
(In reply to Joakim Tjernlund from comment #45)
> (In reply to Lars Wendler (Polynomial-C) from comment #44)
> > Thank you for the ebuilds. I currently testing them for virtualbox-5.1.10
> > bump.
> 
> Nice, I hope 5.1.10 will build under kernel 4.9 as well?

Yes, it comes with 4.9 kernel fixes.
Comment 47 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-11-22 14:05:54 UTC
commit 750462bfc02ffe1a3df2ceeefa6cd6250089b488
Author: Lars Wendler <polynomial-c@gentoo.org>
Date:   Tue Nov 22 14:22:28 2016

    virtualbox packages: Bump to versions 5.0.28 and 5.1.10

    Package-Manager: portage-2.3.2


Okay, I've added your ebuilds with some slight modifications (reverted removal of dev-util/kbuild). 
Please all test and report back if that fixes your issues.
Comment 48 Joakim Tjernlund 2016-11-22 14:48:01 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #47)
> commit 750462bfc02ffe1a3df2ceeefa6cd6250089b488
> Author: Lars Wendler <polynomial-c@gentoo.org>
> Date:   Tue Nov 22 14:22:28 2016
> 
>     virtualbox packages: Bump to versions 5.0.28 and 5.1.10
> 
>     Package-Manager: portage-2.3.2
> 
> 
> Okay, I've added your ebuilds with some slight modifications (reverted
> removal of dev-util/kbuild). 
> Please all test and report back if that fixes your issues.

Will do, but I have to ask: why the revert of removal of dev-util/kbuild ?
Just to be safe or did something break?
Comment 49 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-11-22 14:50:28 UTC
(In reply to Joakim Tjernlund from comment #48)
> (In reply to Lars Wendler (Polynomial-C) from comment #47)
> > commit 750462bfc02ffe1a3df2ceeefa6cd6250089b488
> > Author: Lars Wendler <polynomial-c@gentoo.org>
> > Date:   Tue Nov 22 14:22:28 2016
> > 
> >     virtualbox packages: Bump to versions 5.0.28 and 5.1.10
> > 
> >     Package-Manager: portage-2.3.2
> > 
> > 
> > Okay, I've added your ebuilds with some slight modifications (reverted
> > removal of dev-util/kbuild). 
> > Please all test and report back if that fixes your issues.
> 
> Will do, but I have to ask: why the revert of removal of dev-util/kbuild ?
> Just to be safe or did something break?

Well, I could also ask why you removed it.  ;)
kbuild is the build system virtualbox is using for everything. So any virtualbox source package cannot build without it.
Comment 50 Joakim Tjernlund 2016-11-22 14:55:58 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #49)
> (In reply to Joakim Tjernlund from comment #48)
> > (In reply to Lars Wendler (Polynomial-C) from comment #47)
> > > commit 750462bfc02ffe1a3df2ceeefa6cd6250089b488
> > > Author: Lars Wendler <polynomial-c@gentoo.org>
> > > Date:   Tue Nov 22 14:22:28 2016
> > > 
> > >     virtualbox packages: Bump to versions 5.0.28 and 5.1.10
> > > 
> > >     Package-Manager: portage-2.3.2
> > > 
> > > 
> > > Okay, I've added your ebuilds with some slight modifications (reverted
> > > removal of dev-util/kbuild). 
> > > Please all test and report back if that fixes your issues.
> > 
> > Will do, but I have to ask: why the revert of removal of dev-util/kbuild ?
> > Just to be safe or did something break?
> 
> Well, I could also ask why you removed it.  ;)

Sure ...

> kbuild is the build system virtualbox is using for everything. So any
> virtualbox source package cannot build without it.

 ... because I mistook it for kernel build stuff :(

Anyhow, now I get:
The following mask changes are necessary to proceed:
 (see "package.unmask" in the portage(5) man page for more details)
# required by x11-drivers/xf86-video-virtualbox-5.1.10::gentoo[dri]
# required by x11-base/xorg-drivers-1.18-r1::gentoo[video_cards_virtualbox]
# required by x11-base/xorg-server-1.18.4::gentoo[xorg]
# required by @selected
# required by @world (argument)
# /etc/portage/package.mask/virtualbox-guest-additions:
=app-emulation/virtualbox-guest-additions-5.1.10

Did you not remove that mask?
Comment 51 Joakim Tjernlund 2016-11-22 15:03:37 UTC
(In reply to Joakim Tjernlund from comment #50)
> (In reply to Lars Wendler (Polynomial-C) from comment #49)
> > (In reply to Joakim Tjernlund from comment #48)
> > > (In reply to Lars Wendler (Polynomial-C) from comment #47)

> 
> Anyhow, now I get:
> The following mask changes are necessary to proceed:
>  (see "package.unmask" in the portage(5) man page for more details)
> # required by x11-drivers/xf86-video-virtualbox-5.1.10::gentoo[dri]
> # required by x11-base/xorg-drivers-1.18-r1::gentoo[video_cards_virtualbox]
> # required by x11-base/xorg-server-1.18.4::gentoo[xorg]
> # required by @selected
> # required by @world (argument)
> # /etc/portage/package.mask/virtualbox-guest-additions:
> =app-emulation/virtualbox-guest-additions-5.1.10
> 
> Did you not remove that mask?

Gaah, it was my own mask so never mind .. :)
Comment 52 Joakim Tjernlund 2016-11-22 15:29:23 UTC
While I remember, when guest-additions is started in a physical machine one
get an error when you login into the DE which pop up as a notification.

Is is possible to tweak /etc/xdg/autostart/vboxclient.desktop to get rid
of this error?
Comment 53 Joakim Tjernlund 2016-11-22 15:38:39 UTC
virtualbox-5.1.10 works both on host and guest for me :)