Bug 269721 - emulators/virtualbox-ose-kmod: main-amd64-default fallout
Summary: emulators/virtualbox-ose-kmod: main-amd64-default fallout
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Graham Perrin
URL: https://portsfallout.com/fallout?port...
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-20 16:16 UTC by O. Hartmann
Modified: 2023-06-25 16:56 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2023-02-20 16:16:03 UTC
On recent CURRENT (FreeBSD 14.0-CURRENT #2 main-n261026-d04c86717c8c: Sun Feb 19 08:45:28 CET 2023 amd64) compiling of port

emulators/virtualbox-ose-kmod

fails with the error shown below.
 
[...]
/usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-6.1.36/out/freebsd.amd64/release/bin/src/vboxdrv/freebsd/SUPDrv-freebsd.c:433:50: error: incompatible pointer to integer conversion passing 'void *' to parameter of type 'RTR3PTR' (aka 'unsigned long') [-Wint-conversion]
        if (RT_FAILURE(RTR0MemUserCopyFrom(&Hdr, pvUser, sizeof(Hdr))))
                                                 ^~~~~~
include/iprt/errcore.h:99:58: note: expanded from macro 'RT_FAILURE'
#define RT_FAILURE(rc)      ( RT_UNLIKELY(!RT_SUCCESS_NP(rc)) )
                                                         ^~
include/iprt/errcore.h:80:38: note: expanded from macro 'RT_SUCCESS_NP'
# define RT_SUCCESS_NP(rc)   ( (int)(rc) >= VINF_SUCCESS )
                                     ^~
include/iprt/cdefs.h:1826:53: note: expanded from macro 'RT_UNLIKELY'
#  define RT_UNLIKELY(expr)     __builtin_expect(!!(expr), 0)
                                                    ^~~~
include/iprt/mem.h:756:56: note: passing argument to parameter 'R3PtrSrc' here
RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb);
                                                       ^
/usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-6.1.36/out/freebsd.amd64/release/bin/src/vboxdrv/freebsd/SUPDrv-freebsd.c:461:50: error: incompatible pointer to integer conversion passing 'void *' to parameter of type 'RTR3PTR' (aka 'unsigned long') [-Wint-conversion]
        if (RT_FAILURE(RTR0MemUserCopyFrom(pHdr, pvUser, Hdr.cbIn)))
                                                 ^~~~~~
include/iprt/errcore.h:99:58: note: expanded from macro 'RT_FAILURE'
#define RT_FAILURE(rc)      ( RT_UNLIKELY(!RT_SUCCESS_NP(rc)) )
                                                         ^~
include/iprt/errcore.h:80:38: note: expanded from macro 'RT_SUCCESS_NP'
# define RT_SUCCESS_NP(rc)   ( (int)(rc) >= VINF_SUCCESS )
                                     ^~
include/iprt/cdefs.h:1826:53: note: expanded from macro 'RT_UNLIKELY'
#  define RT_UNLIKELY(expr)     __builtin_expect(!!(expr), 0)
                                                    ^~~~
include/iprt/mem.h:756:56: note: passing argument to parameter 'R3PtrSrc' here
RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb);
                                                       ^
/usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-6.1.36/out/freebsd.amd64/release/bin/src/vboxdrv/freebsd/SUPDrv-freebsd.c:494:46: error: incompatible pointer to integer conversion passing 'void *' to parameter of type 'RTR3PTR' (aka 'unsigned long') [-Wint-conversion]
            if (RT_FAILURE(RTR0MemUserCopyTo(pvUser, pHdr, cbOut)))
                                             ^~~~~~
include/iprt/errcore.h:99:58: note: expanded from macro 'RT_FAILURE'
#define RT_FAILURE(rc)      ( RT_UNLIKELY(!RT_SUCCESS_NP(rc)) )
                                                         ^~
include/iprt/errcore.h:80:38: note: expanded from macro 'RT_SUCCESS_NP'
# define RT_SUCCESS_NP(rc)   ( (int)(rc) >= VINF_SUCCESS )
                                     ^~
include/iprt/cdefs.h:1826:53: note: expanded from macro 'RT_UNLIKELY'
#  define RT_UNLIKELY(expr)     __builtin_expect(!!(expr), 0)
                                                    ^~~~
include/iprt/mem.h:768:41: note: passing argument to parameter 'R3PtrDst' here
RTR0DECL(int) RTR0MemUserCopyTo(RTR3PTR R3PtrDst, void const *pvSrc, size_t cb);
                                        ^
Comment 1 Graham Perrin freebsd_committer freebsd_triage 2023-02-20 19:51:26 UTC
Via <https://www.freshports.org/emulators/virtualbox-ose-kmod/> 

At a glance, the recent fallout appears similar.
Comment 2 Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2023-02-26 18:47:19 UTC
As also posted on list freebsd-emulation@ 
from https://reviews.llvm.org/D129881 try to add -Wno-error=int-conversion to the ports Makefile CFLAGS (not tested)
Comment 3 Vladyslav Movchan 2023-02-28 06:54:51 UTC
(In reply to Jesper Schmitz Mouridsen from comment #2)
After adding
CFLAGS+= -Wno-error=int-conversion
into virtualbox-ose-kmod Makefile port builds without errors.

Thanks a lot!
Comment 4 Joseph Mingrone freebsd_committer freebsd_triage 2023-03-05 17:32:05 UTC
Review for port fix: https://reviews.freebsd.org/D38906
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-03-06 13:17:41 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f4a869a6424aa8bc32d50642762d9f294c7ce3da

commit f4a869a6424aa8bc32d50642762d9f294c7ce3da
Author:     Joseph Mingrone <jrm@FreeBSD.org>
AuthorDate: 2023-03-04 04:31:00 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2023-03-06 13:15:34 +0000

    emulators/virtualbox-ose-kmod: Fix build with LLVM 15

    Starting with clang 15, the -Wint-conversion warning diagnostic for
    implicit int <-> pointer conversions defaults to an error. Use a cast to
    fix such an error here.

    See also:       https://lists.freebsd.org/archives/freebsd-emulation/2023-February/000431.html
                    https://lists.freebsd.org/archives/freebsd-emulation/2023-February/000460.html
    PR:             269721
    Reported by:    fbl@aoek.com, ohartmann@walstatt.org, rkoberman@gmail.com
    Differential Revision: https://reviews.freebsd.org/D38906
    Sponsored by:   The FreeBSD Foundation

 ...ch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
Comment 6 Jung-uk Kim freebsd_committer freebsd_triage 2023-03-06 20:59:34 UTC
(In reply to Joseph Mingrone from comment #4)
It was an incomplete fix.  The remaining fix was committed as 7270b8992214.

https://cgit.freebsd.org/ports/commit/?id=7270b8992214047dcc21af347cbab98900122450
Comment 7 Joseph Mingrone freebsd_committer freebsd_triage 2023-03-06 21:02:09 UTC
(In reply to Jung-uk Kim from comment #6)
Sorry.  I didn't see those errors when testing and `poudriere testport` built fine for me.

http://pkg.ftfl.ca/data/14amd64-default/2023-03-06_16h57m27s/logs/virtualbox-ose-kmod-6.1.36.log
Comment 8 Graham Perrin freebsd_committer freebsd_triage 2023-03-19 21:19:22 UTC
Many thanks, and (comment 5): 


> Sponsored by:   The FreeBSD Foundation

– these things do not go unnoticed :-)
Comment 9 Graham Perrin freebsd_committer freebsd_triage 2023-06-25 01:08:39 UTC
No fallout for more than three months, I assume that this is fixed. If not, please reopen. 

Thanks
Comment 10 O. Hartmann 2023-06-25 16:56:54 UTC
Tahnk you.