FS#54252 - [virtualbox-host-dkms] Can't load VirtualBox host modules, builded by gcc-7

Attached to Project: Community Packages
Opened by Natrio (natrio) - Thursday, 01 June 2017, 09:13 GMT
Last edited by Christian Hesse (eworm) - Tuesday, 04 July 2017, 12:38 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sébastien Luttringer (seblu)
Architecture i686
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
After gcc update from 6th to 7th branch, rebuilded VirtualBox host modules isn't working anymore:

# vboxreload
Unloading modules:
Loading modules: modprobe: ERROR: could not insert 'vboxnetadp': Unknown symbol in module, or unknown parameter (see dmesg)
modprobe: ERROR: could not insert 'vboxnetflt': Unknown symbol in module, or unknown parameter (see dmesg)
modprobe: ERROR: could not insert 'vboxpci': Unknown symbol in module, or unknown parameter (see dmesg)
modprobe: ERROR: could not insert 'vboxdrv': Unknown symbol in module, or unknown parameter (see dmesg)

# dmesg
...
[13026.141871] vboxdrv: Unknown symbol __udivmoddi4 (err 0)
[13026.156710] vboxdrv: Unknown symbol __udivmoddi4 (err 0)
[13026.194403] vboxdrv: Unknown symbol __udivmoddi4 (err 0)
[13026.214177] vboxdrv: Unknown symbol __udivmoddi4 (err 0)

This bug taking place on both kernels (ARCH and LTS) with "virtualbox-host-dkms" package, and pre-builded modules from "virtualbox-host-modules-arch" package too.
This task depends upon

Closed by  Christian Hesse (eworm)
Tuesday, 04 July 2017, 12:38 GMT
Reason for closing:  Fixed
Additional comments about closing:  virtualbox 5.1.22-3
virtualbox-guest-modules-arch 5.1.22-5
Comment by Jeff Hodd (jghodd) - Thursday, 01 June 2017, 19:02 GMT
This same error is occurring on the guest side when running a 64-bit host with a 32-bit guest.

vboxguest: Unknown symbol __udivmoddi4 (err 0)

So this is definitely a 32-bit issue.

I rebuilt the dkms guest modules, adding a slightly modified udivmoddi4.c (snatched from the host source and modified to use the 'quad' types) and that - temporarily - fixed the problem. At least I could boot up again. So, for some reason, __udivmoddi4 is missing from something - either the compiler environment or virtualbox. I've attached the udivmoddi4.c file I used to get it running.

I'm currently running linux-4.11.3 with gcc 7.1.1 and virtualbox-5.1.22. The previous combination did not have this issue - linux-4.11.2 + gcc-6.x.x + virtualbox-5.1.22, so I suspect that this may actually be a gcc problem that was manifested in the 6.x.x -> 7.x.x update.

I would like to know whose issue this is...
Comment by loqs (loqs) - Thursday, 01 June 2017, 22:16 GMT Comment by Jeff Hodd (jghodd) - Friday, 02 June 2017, 00:29 GMT
This same error is occurring on the guest side when running a 64-bit host with a 32-bit guest.

vboxguest: Unknown symbol __udivmoddi4 (err 0)

So this is definitely a 32-bit issue.

I rebuilt the dkms guest modules, adding a slightly modified udivmoddi4.c (snatched from the host source and modified to use the 'quad' types) and that - temporarily - fixed the problem. At least I could boot up again. So, for some reason, __udivmoddi4 is missing from something - either the compiler environment or virtualbox. I've attached the udivmoddi4.c file I used to get it running.

I'm currently running linux-4.11.3 with gcc 7.1.1 and virtualbox-5.1.22. The previous combination did not have this issue - linux-4.11.2 + gcc-6.x.x + virtualbox-5.1.22, so I suspect that this may actually be a gcc problem that was manifested in the 6.x.x -> 7.x.x update.

I would like to know whose issue this is...
Comment by Jeff Hodd (jghodd) - Friday, 02 June 2017, 07:09 GMT
I've been able to do a full 32-bit build of virtualbox with the added udivmoddi4.c file. It's fully functional and can be found at https://sourceforge.net/projects/bluestarlinux/files/extra/vbox-5.1.22-i686-fixed/

The added udivmoddi4.c file is not from a third-party source - it's your own code originating from the host source tree.

Attached is a tar.gz file of the source files I changed/added. I did not create a patch.

The full, modified source archive (VirtualBox-5.1.22.tar.bz2) can be found at the above url (it's still uploading at the moment, but should be there soon).
Comment by Benjamin Robin (benjarobin) - Wednesday, 07 June 2017, 20:20 GMT
I added a comment that explain the problem (well maybe everybody already understood that): https://www.virtualbox.org/ticket/16772#comment:8
Comment by Philip Müller (philm) - Friday, 23 June 2017, 06:47 GMT
Attached you may find the updated PKGBUILD including a gcc7 patch.
Comment by loqs (loqs) - Tuesday, 27 June 2017, 22:27 GMT
https://www.virtualbox.org/ticket/16772#comment:11 contains links to the 6 commits upstream made to fix the issue.
Comment by Christian Hesse (eworm) - Wednesday, 28 June 2017, 06:03 GMT
But I could not figure a way to download unified patches from upstream, hence did not update yet.
Is there any?
Comment by loqs (loqs) - Friday, 30 June 2017, 00:17 GMT
Patches not mentioned in the bug report but are needed in order to create src/VBox/Runtime/common/math/gcc/udivmoddi4.c
$ svn diff -r 67289:67291 http://www.virtualbox.org/svn/vbox/ > 009.patch
The patches mentioned in the bug report fortunately they are a continuous series
$ svn diff -r 67291:67298 http://www.virtualbox.org/svn/vbox/ > 010.patch
Patches apply without error no further testing attempted hope that helps.
Edit:
Second command should be
$ svn diff -r 67292:67298 http://www.virtualbox.org/svn/vbox/ > 010.patch
Comment by Giovanni (ksniffer) - Tuesday, 04 July 2017, 10:41 GMT
Why these patches are not included in in packages? Why?
Comment by Giovanni (ksniffer) - Tuesday, 04 July 2017, 10:43 GMT
Why these patches are not included in the packages? Why?

Loading...