Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 658144

Summary: app-emulation/virtualbox-modules-5.1.36 crashes out on recompilation against updated kernel 4.17.0-gentoo
Product: Gentoo Linux Reporter: Graham Young <gcyoung>
Component: Current packagesAssignee: Lars Wendler (Polynomial-C) (RETIRED) <polynomial-c>
Status: RESOLVED OBSOLETE    
Severity: normal CC: bkohler, ilmostro7, jstein, masterzorag
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: tarred file contains info-output, build log,kernel configuration and output of emerge -pqv
kver-4.17 patch for virtualbox-modules
corrected working directory for the patchset

Description Graham Young 2018-06-14 21:42:43 UTC
Created attachment 535928 [details]
tarred file contains info-output, build log,kernel configuration and output of emerge -pqv

These modules compiled without problems against the previous kernel-4.16-11-gentoo and the kernel compilation for the later kernel is was not changed by me. Any changes must have been part of the updated kernel.
Comment 1 Marco Genasci 2018-06-15 05:55:58 UTC
Use stable packages with unstable kernel isn't a good idea.
Anyway, I think, you can backport this [1] patch.

[1] https://www.virtualbox.org/changeset/72139/vbox
Comment 2 Amel Hodzic 2018-06-22 06:43:27 UTC
Created attachment 536762 [details, diff]
kver-4.17 patch for virtualbox-modules

That should be enough.
Comment 3 Amel Hodzic 2018-06-22 06:58:09 UTC
Created attachment 536764 [details, diff]
corrected working directory for the patchset

Ignore the first patch, as it fails to account for the naming structure of the subdirectories in virtualbox-modules.
Comment 4 Amel Hodzic 2018-06-22 08:22:16 UTC
It seems that a previous patch, virtualbox-modules-5.1.30-udp.patch, also modifies the same file.  That might have to be combined into a single patch, then.
Comment 5 Amel Hodzic 2018-06-22 08:28:11 UTC
Also, if the source files already have "if" checks for specific kernel versions, is it really useful to have the same in the ebuild?

src_prepare() {
        if kernel_is -ge 2 6 33 ; then
                # evil patch for new kernels - header moved
                grep -lR linux/autoconf.h *  | xargs sed -i -e 's:<linux/autoconf.h>:<generated/autoconf.h>:'
        fi

        if use pax_kernel && kernel_is -ge 3 0 0 ; then
                eapply "${FILESDIR}"/${PN}-4.1.4-pax-const.patch
        fi

        if kernel_is -ge 4 14 0 ; then
                eapply "${FILESDIR}"/${PN}-5.1.30-udp.patch
        fi

        default
}


vs. 

+++ work/vboxpci/linux/VBoxPci-linux.c
@@ -353,12 +353,16 @@ static void  vboxPciFileClose(struct file* file)
 static int vboxPciFileWrite(struct file* file, unsigned long long offset, unsigned char* data, unsigned int size)
 {
     int          ret;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
+    ret = kernel_write(file, data, size, &offset);
+#else
...
Comment 6 Ben Kohler gentoo-dev 2018-10-31 15:42:59 UTC
Please reopen if this still affects 5.2.x