Bug 233540

Summary: emulators/virtualbox-ose panic on 12.0 PRERELEASE
Product: Ports & Packages Reporter: Aurel Bodenmann-Flury <aurel>
Component: Individual Port(s)Assignee: vbox (Nobody) <vbox>
Status: Closed DUPLICATE    
Severity: Affects Only Me CC: emaste, rkoberman, w.schwarzenfeld
Priority: --- Flags: bugzilla: maintainer-feedback? (vbox)
Version: Latest   
Hardware: amd64   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233515
Bug Depends on:    
Bug Blocks: 228911    

Description Aurel Bodenmann-Flury 2018-11-26 18:22:21 UTC
I'm opening a new PR since I'm not sure, if my problem is related to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230460 or not (seems to me as if it isn't). I get an instant kernel panic when I start vboxwebsrv or a VM on a 12.0 PRERELEASE system:

/var/crash# uname -a
FreeBSD Server 12.0-PRERELEASE FreeBSD 12.0-PRERELEASE #2 r328635M: Fri Nov 23 14:32:30 UTC 2018     root@Server:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64

Virtualbox has been rebuilt:

/var/crash#  pkg info -f virtualbox-ose\* | egrep "^Name|^Installed"
Name           : virtualbox-ose
Installed on   : Sat Nov 24 10:05:11 2018 UTC
Name           : virtualbox-ose-kmod
Installed on   : Sat Nov 24 10:05:08 2018 UTC

r482464 (see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230460) is installed

/usr/ports/emulators/virtualbox-ose/files# ll patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-files_vboxnetflt
-rw-r--r--  1 root  wheel   638B Oct 20 04:42 patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-files_vboxnetflt

I even disabled SMAP

/var/crash# cat /boot/loader.conf | grep hw.cpu_stdext_disable

Still, the system crashes instantly:

/var/crash# less core.txt.3
Server dumped core - see /var/crash/vmcore.3

Sun Nov 25 18:01:56 UTC 2018

FreeBSD Server 12.0-PRERELEASE FreeBSD 12.0-PRERELEASE #2 r328635M: Fri Nov 23 14:32:30 UTC 2018     root@Server:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64

panic: page fault

GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...

Unread portion of the kernel message buffer:

Fatal trap 12: page fault while in kernel mode
cpuid = 1; apic id = 02
fault virtual address   = 0x28
fault code              = supervisor read data, page not present
instruction pointer     = 0x20:0xffffffff80c9a34d
stack pointer           = 0x28:0xfffffe00591306b0
frame pointer           = 0x28:0xfffffe00591306e0
code segment            = base rx0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 64337 (VBoxNetAdpCtl)
trap number             = 12
panic: page fault
cpuid = 1
time = 1543168840
KDB: stack backtrace:
#0 0xffffffff80bed147 at kdb_backtrace+0x67
#1 0xffffffff80ba1253 at vpanic+0x1a3
#2 0xffffffff80ba10a3 at panic+0x43
#3 0xffffffff810793ff at trap_fatal+0x35f
#4 0xffffffff81079459 at trap_pfault+0x49
#5 0xffffffff81078a7e at trap+0x29e
#6 0xffffffff810549f5 at calltrap+0x8
#7 0xffffffff82cd902a at vboxNetAdpOsCreate+0x1a
#8 0xffffffff82cd964c at vboxNetAdpCreate+0xcc
#9 0xffffffff82cd9526 at VBoxNetAdpFreeBSDCtrlioctl+0x86
#10 0xffffffff80a583bd at devfs_ioctl+0xad
#11 0xffffffff811ffa6e at VOP_IOCTL_APV+0x7e
#12 0xffffffff80c7f3c4 at vn_ioctl+0x1a4
#13 0xffffffff80a5899f at devfs_ioctl_f+0x1f
#14 0xffffffff80c0a64d at kern_ioctl+0x26d
#15 0xffffffff80c0a36e at sys_ioctl+0x15e
#16 0xffffffff81079f92 at amd64_syscall+0x352
#17 0xffffffff810552dd at fast_syscall_common+0x101
Uptime: 1d6h15m53s

Any ideas?
Comment 1 Ed Maste freebsd_committer 2018-11-27 14:53:33 UTC
Duplicate of PR 233515?
Comment 2 rkoberman 2018-12-20 07:11:23 UTC
I am seeing the same issue. My stack trace is almost the same, but I do have two more frames on the stack.

#6  0xffffffff81077479 in trap_pfault
#7  0xffffffff81076a9e in trap
#8  <signal handler called>
#9  0xffffffff80c9863d in ifindex_alloc
#10 if_alloc (type=6 '\006')
#11 0xffffffff82a4502a in vboxNetAdpOsCreate
(Below this, it is the same.)

All of my ports were rebuilt on v12. I am at r342152 with a GENERIC config except SCHED_4BSD replacing SCHED_ULE. No issues seen prior to the upgrade.

I can make full dumps available.
Comment 3 rkoberman 2018-12-23 21:48:11 UTC
This report is a dup of 220003 which has a simple work-around or the problem. Please merge with 220003.
Comment 4 Walter Schwarzenfeld freebsd_triage 2019-09-04 23:27:24 UTC

*** This bug has been marked as a duplicate of bug 220003 ***