Re: VirtualBox-ose kernel module crashes 10-stable

2017-04-04 Thread Hiroyuki Une
On Fri, 31 Mar 2017 13:56:54 +0200 (CEST)
Trond Endrestøl  wrote:

> On Fri, 31 Mar 2017 20:07+0900, Hiroyuki Une wrote:
> 
> > Kernel Panic was caused on My 10.3-STABLE r316132 
> > by VirtualBox-ose created by poudriere(8) on my box with DEBUG option.  
> > However, when I was using 10.3-STABLE r315187, 
> > VirtualBox-ose worked without any problem.  
> > 
> > Here is the output by kgdb:
> > 
> > -- start here (output by kgdb)
> > 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:
> > 
> > !!Assertion Failed!!
> > Expression: RTThreadPreemptIsEnabled(NIL_RTTHREAD)
> > Location  : 
> > /wrkdirs/usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-5.1.18/out/freebsd.amd64/debug/bin/src/vboxdrv/r0drv/freebsd/spinlock-r0drv-freebsd.c(78)
> >  int RTSpinlockCreate(PRTSPINLOCK, uint32_t, const char *)
> > 
> > 
> > Fatal trap 3: breakpoint instruction fault while in kernel mode
> > cpuid = 3; apic id = 06
> > instruction pointer = 0x20:0x81dbb3de
> > stack pointer   = 0x28:0xfe0464bfd490
> > frame pointer   = 0x28:0xfe0464bfd4c0
> > code segment= base 0x0, limit 0xf, type 0x1b
> > = DPL 0, pres 1, long 1, def32 0, gran 1
> > processor eflags= interrupt enabled, IOPL = 0
> > current process = 46465 (VBoxSVC)
> > trap number = 3
> > panic: breakpoint instruction fault
> > cpuid = 3
> > KDB: stack backtrace:
> > #0 0x809bb360 at kdb_backtrace+0x60
> > #1 0x8097c1e6 at vpanic+0x126
> > #2 0x8097c0b3 at panic+0x43
> > #3 0x80d9ce2d at trap_fatal+0x35d
> > #4 0x80d9caaf at trap+0x79f
> > #5 0x80d81d4c at calltrap+0x8
> > #6 0x81d7d591 at supdrvCreateSession+0x91
> > #7 0x81d9355b at vboxdrvFreeBSDOpenCommon+0x2b
> > #8 0x80855a32 at devfs_open+0x122
> > #9 0x80ed8671 at VOP_OPEN_APV+0xa1
> > #10 0x80a3bc34 at vn_open_vnode+0x234
> > #11 0x80a3b803 at vn_open_cred+0x373
> > #12 0x80a348cf at kern_openat+0x26f
> > #13 0x80d9d862 at amd64_syscall+0x452
> > #14 0x80d8203b at Xfast_syscall+0xfb
> > Uptime: 16h16m43s
> > Dumping 3881 out of 16259 
> > MB:..1%..11%..21%..31%..41%..51%..61%..71%..81%..91%
> > #0  doadump (textdump=) at pcpu.h:219
> > 219 pcpu.h: No such file or directory.
> > in pcpu.h
> > (kgdb) bt

(snip)

> > As shown in the above, kernel panic was caused by 
> > assertion RTThreadPreemptIsEnabled(NIL_RTTHREAD) 
> > which tests the following expressions:
> > 
> >   1. curthread->td_critnest is equal to 0, and
> >   2. IF (interrupt flag) on eflag (or rflag ?) is equal to 1.  
> > 
> > This assertion will be successful only if both of above are true.  
> > 
> > As I read the source of VirtualBox, RTThreadPreemptIsEnabled is 
> > a part of test for preemtiveness which is used to create a spinlock.  
> > However, I'm not sure why assertion RTThreadPreemptIsEnabled is required, 
> > and this was failed on 10.3-STABLE r316132.  
> > 
> > I would appreciate any information.  Thanks.  
> 
> emulators/virtualbox-ose needs access to the kernel sources during 
> build. Maybe you should rebuild emulators/virtualbox-ose to match your 
> current source tree.

Thank you for your advise.  I create a new jail for poudriere with 
the most recent 10.3-STABLE source tree, and then rebuild VirtualBox 
and its kernel module by it.  These worked fine.  

However, this shows that there seems to be following problems 
to maintain packages by pkg(8):

(a) STABLE users (both of 10 and 11) can't use kernel modules 
if pkg.FreeBSD.org provides packages which were built with RELEASE 
source tree, or

(b) RELEASE users can't use kernel can't use kernel modules 
if pkg.FreeBSD.org provides packages which were built with recent 
STABLE source tree.   

At least, nvidia-driver caused kernel panic by almost same reason [1].  

[1] https://lists.freebsd.org/pipermail/freebsd-stable/2017-March/087015.html

---
Hiroyuki Une: Hiroshima Kokusai Gakuin University
u...@hkg.ac.jp / harr...@seiryu.id.hkg.ac.jp
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Re: VirtualBox-ose kernel module crashes 10-stable

2017-03-31 Thread Trond Endrestøl
On Fri, 31 Mar 2017 20:07+0900, Hiroyuki Une wrote:

> Kernel Panic was caused on My 10.3-STABLE r316132 
> by VirtualBox-ose created by poudriere(8) on my box with DEBUG option.  
> However, when I was using 10.3-STABLE r315187, 
> VirtualBox-ose worked without any problem.  
> 
> Here is the output by kgdb:
> 
> -- start here (output by kgdb)
> 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:
> 
> !!Assertion Failed!!
> Expression: RTThreadPreemptIsEnabled(NIL_RTTHREAD)
> Location  : 
> /wrkdirs/usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-5.1.18/out/freebsd.amd64/debug/bin/src/vboxdrv/r0drv/freebsd/spinlock-r0drv-freebsd.c(78)
>  int RTSpinlockCreate(PRTSPINLOCK, uint32_t, const char *)
> 
> 
> Fatal trap 3: breakpoint instruction fault while in kernel mode
> cpuid = 3; apic id = 06
> instruction pointer = 0x20:0x81dbb3de
> stack pointer   = 0x28:0xfe0464bfd490
> frame pointer   = 0x28:0xfe0464bfd4c0
> code segment= base 0x0, limit 0xf, type 0x1b
> = DPL 0, pres 1, long 1, def32 0, gran 1
> processor eflags= interrupt enabled, IOPL = 0
> current process = 46465 (VBoxSVC)
> trap number = 3
> panic: breakpoint instruction fault
> cpuid = 3
> KDB: stack backtrace:
> #0 0x809bb360 at kdb_backtrace+0x60
> #1 0x8097c1e6 at vpanic+0x126
> #2 0x8097c0b3 at panic+0x43
> #3 0x80d9ce2d at trap_fatal+0x35d
> #4 0x80d9caaf at trap+0x79f
> #5 0x80d81d4c at calltrap+0x8
> #6 0x81d7d591 at supdrvCreateSession+0x91
> #7 0x81d9355b at vboxdrvFreeBSDOpenCommon+0x2b
> #8 0x80855a32 at devfs_open+0x122
> #9 0x80ed8671 at VOP_OPEN_APV+0xa1
> #10 0x80a3bc34 at vn_open_vnode+0x234
> #11 0x80a3b803 at vn_open_cred+0x373
> #12 0x80a348cf at kern_openat+0x26f
> #13 0x80d9d862 at amd64_syscall+0x452
> #14 0x80d8203b at Xfast_syscall+0xfb
> Uptime: 16h16m43s
> Dumping 3881 out of 16259 MB:..1%..11%..21%..31%..41%..51%..61%..71%..81%..91%
>  
> Reading symbols from /boot/kernel/linprocfs.ko.symbols...done.
> Loaded symbols for /boot/kernel/linprocfs.ko.symbols
> Reading symbols from /boot/kernel/linux_common.ko.symbols...done.
> Loaded symbols for /boot/kernel/linux_common.ko.symbols
> Reading symbols from /boot/kernel/linsysfs.ko.symbols...done.
> Loaded symbols for /boot/kernel/linsysfs.ko.symbols
> Reading symbols from /boot/kernel/zfs.ko.symbols...done.
> Loaded symbols for /boot/kernel/zfs.ko.symbols
> Reading symbols from /boot/kernel/opensolaris.ko.symbols...done.
> Loaded symbols for /boot/kernel/opensolaris.ko.symbols
> Reading symbols from /boot/kernel/tmpfs.ko.symbols...done.
> Loaded symbols for /boot/kernel/tmpfs.ko.symbols
> Reading symbols from /boot/modules/vboxdrv.ko.symbols...done.
> Loaded symbols for /boot/modules/vboxdrv.ko.symbols
> Reading symbols from /boot/kernel/fdescfs.ko.symbols...done.
> Loaded symbols for /boot/kernel/fdescfs.ko.symbols
> Reading symbols from /boot/kernel/i915kms.ko.symbols...done.
> Loaded symbols for /boot/kernel/i915kms.ko.symbols
> Reading symbols from /boot/kernel/drm2.ko.symbols...done.
> Loaded symbols for /boot/kernel/drm2.ko.symbols
> Reading symbols from /boot/kernel/iicbus.ko.symbols...done.
> Loaded symbols for /boot/kernel/iicbus.ko.symbols
> Reading symbols from /boot/kernel/iic.ko.symbols...done.
> Loaded symbols for /boot/kernel/iic.ko.symbols
> Reading symbols from /boot/kernel/iicbb.ko.symbols...done.
> Loaded symbols for /boot/kernel/iicbb.ko.symbols
> Reading symbols from /boot/kernel/ulpt.ko.symbols...done.
> Loaded symbols for /boot/kernel/ulpt.ko.symbols
> Reading symbols from /boot/kernel/ipfw.ko.symbols...done.
> Loaded symbols for /boot/kernel/ipfw.ko.symbols
> Reading symbols from /boot/kernel/linux.ko.symbols...done.
> Loaded symbols for /boot/kernel/linux.ko.symbols
> Reading symbols from /boot/kernel/linux64.ko.symbols...done.
> Loaded symbols for /boot/kernel/linux64.ko.symbols
> Reading symbols from /boot/kernel/i915.ko.symbols...done.
> Loaded symbols for /boot/kernel/i915.ko.symbols
> Reading symbols from /boot/kernel/drm.ko.symbols...done.
> Loaded symbols for /boot/kernel/drm.ko.symbols
> Reading symbols from /boot/kernel/nullfs.ko.symbols...done.
> Loaded symbols for /boot/kernel/nullfs.ko.symbols
> #0  doadump (textdump=) at pcpu.h:219
> 219 pcpu.h: No such file or directory.
> in pcpu.h
> (kgdb) bt
> #0  doadump (textdump=) at pcpu.h:219
> #1  0x8097be03 in kern_reboot (howto=260)
> at 

VirtualBox-ose kernel module crashes 10-stable

2017-03-31 Thread Hiroyuki Une
Kernel Panic was caused on My 10.3-STABLE r316132 
by VirtualBox-ose created by poudriere(8) on my box with DEBUG option.  
However, when I was using 10.3-STABLE r315187, 
VirtualBox-ose worked without any problem.  

Here is the output by kgdb:

-- start here (output by kgdb)
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:

!!Assertion Failed!!
Expression: RTThreadPreemptIsEnabled(NIL_RTTHREAD)
Location  : 
/wrkdirs/usr/ports/emulators/virtualbox-ose-kmod/work/VirtualBox-5.1.18/out/freebsd.amd64/debug/bin/src/vboxdrv/r0drv/freebsd/spinlock-r0drv-freebsd.c(78)
 int RTSpinlockCreate(PRTSPINLOCK, uint32_t, const char *)


Fatal trap 3: breakpoint instruction fault while in kernel mode
cpuid = 3; apic id = 06
instruction pointer = 0x20:0x81dbb3de
stack pointer   = 0x28:0xfe0464bfd490
frame pointer   = 0x28:0xfe0464bfd4c0
code segment= base 0x0, limit 0xf, type 0x1b
= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags= interrupt enabled, IOPL = 0
current process = 46465 (VBoxSVC)
trap number = 3
panic: breakpoint instruction fault
cpuid = 3
KDB: stack backtrace:
#0 0x809bb360 at kdb_backtrace+0x60
#1 0x8097c1e6 at vpanic+0x126
#2 0x8097c0b3 at panic+0x43
#3 0x80d9ce2d at trap_fatal+0x35d
#4 0x80d9caaf at trap+0x79f
#5 0x80d81d4c at calltrap+0x8
#6 0x81d7d591 at supdrvCreateSession+0x91
#7 0x81d9355b at vboxdrvFreeBSDOpenCommon+0x2b
#8 0x80855a32 at devfs_open+0x122
#9 0x80ed8671 at VOP_OPEN_APV+0xa1
#10 0x80a3bc34 at vn_open_vnode+0x234
#11 0x80a3b803 at vn_open_cred+0x373
#12 0x80a348cf at kern_openat+0x26f
#13 0x80d9d862 at amd64_syscall+0x452
#14 0x80d8203b at Xfast_syscall+0xfb
Uptime: 16h16m43s
Dumping 3881 out of 16259 MB:..1%..11%..21%..31%..41%..51%..61%..71%..81%..91%
 
Reading symbols from /boot/kernel/linprocfs.ko.symbols...done.
Loaded symbols for /boot/kernel/linprocfs.ko.symbols
Reading symbols from /boot/kernel/linux_common.ko.symbols...done.
Loaded symbols for /boot/kernel/linux_common.ko.symbols
Reading symbols from /boot/kernel/linsysfs.ko.symbols...done.
Loaded symbols for /boot/kernel/linsysfs.ko.symbols
Reading symbols from /boot/kernel/zfs.ko.symbols...done.
Loaded symbols for /boot/kernel/zfs.ko.symbols
Reading symbols from /boot/kernel/opensolaris.ko.symbols...done.
Loaded symbols for /boot/kernel/opensolaris.ko.symbols
Reading symbols from /boot/kernel/tmpfs.ko.symbols...done.
Loaded symbols for /boot/kernel/tmpfs.ko.symbols
Reading symbols from /boot/modules/vboxdrv.ko.symbols...done.
Loaded symbols for /boot/modules/vboxdrv.ko.symbols
Reading symbols from /boot/kernel/fdescfs.ko.symbols...done.
Loaded symbols for /boot/kernel/fdescfs.ko.symbols
Reading symbols from /boot/kernel/i915kms.ko.symbols...done.
Loaded symbols for /boot/kernel/i915kms.ko.symbols
Reading symbols from /boot/kernel/drm2.ko.symbols...done.
Loaded symbols for /boot/kernel/drm2.ko.symbols
Reading symbols from /boot/kernel/iicbus.ko.symbols...done.
Loaded symbols for /boot/kernel/iicbus.ko.symbols
Reading symbols from /boot/kernel/iic.ko.symbols...done.
Loaded symbols for /boot/kernel/iic.ko.symbols
Reading symbols from /boot/kernel/iicbb.ko.symbols...done.
Loaded symbols for /boot/kernel/iicbb.ko.symbols
Reading symbols from /boot/kernel/ulpt.ko.symbols...done.
Loaded symbols for /boot/kernel/ulpt.ko.symbols
Reading symbols from /boot/kernel/ipfw.ko.symbols...done.
Loaded symbols for /boot/kernel/ipfw.ko.symbols
Reading symbols from /boot/kernel/linux.ko.symbols...done.
Loaded symbols for /boot/kernel/linux.ko.symbols
Reading symbols from /boot/kernel/linux64.ko.symbols...done.
Loaded symbols for /boot/kernel/linux64.ko.symbols
Reading symbols from /boot/kernel/i915.ko.symbols...done.
Loaded symbols for /boot/kernel/i915.ko.symbols
Reading symbols from /boot/kernel/drm.ko.symbols...done.
Loaded symbols for /boot/kernel/drm.ko.symbols
Reading symbols from /boot/kernel/nullfs.ko.symbols...done.
Loaded symbols for /boot/kernel/nullfs.ko.symbols
#0  doadump (textdump=) at pcpu.h:219
219 pcpu.h: No such file or directory.
in pcpu.h
(kgdb) bt
#0  doadump (textdump=) at pcpu.h:219
#1  0x8097be03 in kern_reboot (howto=260)
at /usr/src/sys/kern/kern_shutdown.c:486
#2  0x8097c225 in vpanic (fmt=,
ap=) at /usr/src/sys/kern/kern_shutdown.c:889
#3  0x8097c0b3 in panic (fmt=0x0)
at /usr/src/sys/kern/kern_shutdown.c:818
#4  0x80d9ce2d in trap_fatal (frame=,