Bug 244847 - emulators/virtualbox-ose: Memory fault after Revision 528258
Summary: emulators/virtualbox-ose: Memory fault after Revision 528258
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm64 Any
: --- Affects Many People
Assignee: Kyle Evans
: 245054 (view as bug list)
Depends on: 236616
  Show dependency treegraph
Reported: 2020-03-16 15:45 UTC by Greg Rivers
Modified: 2020-03-27 04:36 UTC (History)
7 users (show)

See Also:
bugzilla: maintainer-feedback? (vbox)

truss -f virtualbox (466.18 KB, text/plain)
2020-03-20 07:13 UTC, Graham Perrin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Rivers 2020-03-16 15:45:44 UTC
FreeBSD 12.1-RELEASE-p2 amd64

After ports r528258 (bug #244603), VirtualBox memory faults on startup:

$ sh -x /usr/local/bin/VirtualBox
+ PATH=/usr/bin:/bin:/usr/sbin:/sbin
+ CONFIG=/usr/local/etc/vbox/vbox.cfg
+ test -r /usr/local/etc/vbox/vbox.cfg
+ test -z ''
+ test -d /usr/local/lib/virtualbox
+ test -f /usr/local/lib/virtualbox/VBoxRT.so
+ INSTALL_DIR=/usr/local/lib/virtualbox
+ basename /usr/local/bin/VirtualBox
+ APP=VirtualBox
+ exec /usr/local/lib/virtualbox/VirtualBox
Memory fault

This is with virtualbox-ose installed from the "latest" pkg repo:
Mar 16 09:41:06 flake pkg[40529]: virtualbox-ose reinstalled: 5.2.34_1 -> 5.2.34_1
Comment 1 Graham Perrin 2020-03-20 07:13:09 UTC
Created attachment 212543 [details]
truss -f virtualbox

At Kyle's request. 


grahamperrin@momh167-gjp4-8570p:~ % date ; uname -v
Fri 20 Mar 2020 07:10:47 GMT
FreeBSD 13.0-CURRENT #0 r359068: Wed Mar 18 21:14:12 GMT 2020     root@momh167-gjp4-8570p:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG 
grahamperrin@momh167-gjp4-8570p:~ % pkg query '%o %v %R' virtualbox-ose virtualbox-ose-kmod
emulators/virtualbox-ose 5.2.34_1 FreeBSD
emulators/virtualbox-ose-kmod 5.2.34 poudriere
grahamperrin@momh167-gjp4-8570p:~ %
Comment 2 Tobias Kortkamp freebsd_committer 2020-03-20 10:13:02 UTC
It's caused by the usual conflict between libstdc++ and libc++ which
often cannot coexist in the same process.  Building with GCC will
link everything with its libstdc++ while all the Qt5 libs are linked
with libc++ from base which breaks the Qt5 GUI.  VBoxSDL (and
probably others that do not load libc++ too) still work fine like
Comment 3 Kyle Evans freebsd_committer 2020-03-20 11:40:06 UTC
(In reply to Tobias Kortkamp from comment #2)

I find it most curious that it works here locally and worked for madpilot@, but this explanation makes sense.

I'll go hunt down why clang miscompiles it.
Comment 4 Graham Perrin 2020-03-20 18:28:23 UTC
Forgive an ignorant question: will building and installing locally work around the issue (for me)?
Comment 5 Greg Rivers 2020-03-20 18:35:29 UTC
Depending on how long it may take to isolate and fix the issue, it may be prudent to revert the change for now so that the pkg repo has a working version in the interim.
Comment 6 Kyle Evans freebsd_committer 2020-03-20 18:40:57 UTC
(In reply to Greg Rivers from comment #5)

I intend to have a fix ready by the end of this weekend.
Comment 7 Greg Rivers 2020-03-20 18:44:50 UTC
(In reply to Kyle Evans from comment #6)
Nice. Thank you very much for your work and service to the community.
Comment 8 Guido Falsi freebsd_committer 2020-03-21 16:23:43 UTC
(In reply to Kyle Evans from comment #3)

> I find it most curious that it works here locally and worked for madpilot@, but > this explanation makes sense.

I share the curiosity.

Maybe the difference is I'm running head?

I'm also upgrading my PCs at home, shortly I'll be in head with clang 10(which I guess brings a new libc++), maybe this will cause it to break again for me too?
Comment 9 Tobias Kortkamp freebsd_committer 2020-03-26 03:48:33 UTC
*** Bug 245054 has been marked as a duplicate of this bug. ***
Comment 10 Graham Perrin 2020-03-26 18:05:44 UTC
I'm confused (sorry) …

Re: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236616#c23 

> … the head of the ports tree already has USE_GCC in it.

So I created a new jail, built and installed emulators/virtualbox-ose but still, there's a segmentation fault.