Can not install on Debian

Discussions related to using VirtualBox on Linux hosts.

Re: Can not install on Debian

Postby GerryS » 22. Aug 2012, 03:37

Hello!

Virtualbox kernel module loading does not work here, too. I have the same kernel oops as reported by TJ on Debian Testing with a vanilla 3.5.2 kernel:
Code: Select all   Expand viewCollapse view
localhost:~# cat /etc/debian_version
wheezy/sid
localhost:~# uname -a
Linux localhost 3.5.2 #1 SMP Wed Aug 15 21:19:06 CEST 2012 i686 GNU/Linux
localhost:~# gcc --version
gcc (Debian 4.7.1-2) 4.7.1


Latest VirtualBox package 4.1.20 installed with dpkg -i, no dkms:
Code: Select all   Expand viewCollapse view
localhost:~# dpkg -i virtualbox-4.1_4.1.20-80170~Debian~wheezy_i386.deb


I've tracked the problem down to the definitions of RT_LIKELY & RT_UNLIKELY in /usr/share/virtualbox/src/vboxhost/vboxdrv/include/iprt/cdefs.h:

Code: Select all   Expand viewCollapse view
#if defined(__GNUC__)
# if __GNUC__ >= 3 && !defined(FORTIFY_RUNNING)
#  define RT_LIKELY(expr)       __builtin_expect(!!(expr), 1)
#  define RT_UNLIKELY(expr)     __builtin_expect(!!(expr), 0)
# else
#  define RT_LIKELY(expr)       (expr)
#  define RT_UNLIKELY(expr)     (expr)
# endif
#else
# define RT_LIKELY(expr)        (expr)
# define RT_UNLIKELY(expr)      (expr)
#endif


The problem is caused if __builtin_expect() is used. If -DFORTIFY_RUNNING (-DLOG_ENABLED works too!) is added to the KFLAGS of the vboxdrv Makefile the module loads without problems!
Code: Select all   Expand viewCollapse view
--- /usr/share/virtualbox/src/vboxhost/vboxdrv/Makefile.orig    2012-08-22 02:49:06.000000000 +0200
+++ /usr/share/virtualbox/src/vboxhost/vboxdrv/Makefile 2012-08-22 02:51:22.000000000 +0200
@@ -238,7 +238,7 @@
  MANGLING := $(KBUILD_EXTMOD)/include/VBox/SUPDrvMangling.h
 endif
 KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
-           -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING
+           -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DFORTIFY_RUNNING
 ifdef VBOX_REDHAT_KABI
  KFLAGS  += -DVBOX_REDHAT_KABI
 endif


gcc problem/bug?

Regards
Gerald
GerryS
 
Posts: 1
Joined: 22. Aug 2012, 03:06
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Linux

Re: Can not install on Debian

Postby Marcel Veldhuizen » 13. Oct 2012, 10:43

Sorry to bump an old thread, but Gerald's solution also helped me.

I'm running Debian wheezy with a 3.2.23 kernel (custom built). Neither the Debian package, nor the package by Oracle would install.
Added the -DFORTIFY_RUNNING and reran /etc/init.d/vboxdrv setup and now everything seems to be working. Thanks :)
Marcel Veldhuizen
 
Posts: 2
Joined: 13. Oct 2012, 10:40

Re: Can not install on Debian

Postby frank » 16. Jan 2013, 11:24

TJ, it's a gcc bug! See here and here.
frank
Oracle Corporation
 
Posts: 3362
Joined: 7. Jun 2007, 09:11
Location: Dresden, Germany
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Linux, Windows

Previous

Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: Google [Bot] and 17 guests