Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Apr 2017 15:23:29 +0900
From:      Hiroyuki Une <harrier@seiryu.id.hkg.ac.jp>
To:        Trond =?UTF-8?B?RW5kcmVzdMO4bA==?= <Trond.Endrestol@fagskolen.gjovik.no>
Cc:        freebsd-stable@freebsd.org, harrier@seiryu.id.hkg.ac.jp
Subject:   Re: VirtualBox-ose kernel module crashes 10-stable
Message-ID:  <20170404152329.cd3b040e89441e48560524a1@seiryu.id.hkg.ac.jp>
In-Reply-To: <alpine.BSF.2.20.1703311354370.533@mail.fig.ol.no>
References:  <20170331200757.233b3826797acd61c66f03e7@seiryu.id.hkg.ac.jp> <alpine.BSF.2.20.1703311354370.533@mail.fig.ol.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 31 Mar 2017 13:56:54 +0200 (CEST)
Trond Endrestøl <Trond.Endrestol@fagskolen.gjovik.no> 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:0xffffffff81dbb3de
> > stack pointer           = 0x28:0xfffffe0464bfd490
> > frame pointer           = 0x28:0xfffffe0464bfd4c0
> > code segment            = base 0x0, limit 0xfffff, 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 0xffffffff809bb360 at kdb_backtrace+0x60
> > #1 0xffffffff8097c1e6 at vpanic+0x126
> > #2 0xffffffff8097c0b3 at panic+0x43
> > #3 0xffffffff80d9ce2d at trap_fatal+0x35d
> > #4 0xffffffff80d9caaf at trap+0x79f
> > #5 0xffffffff80d81d4c at calltrap+0x8
> > #6 0xffffffff81d7d591 at supdrvCreateSession+0x91
> > #7 0xffffffff81d9355b at vboxdrvFreeBSDOpenCommon+0x2b
> > #8 0xffffffff80855a32 at devfs_open+0x122
> > #9 0xffffffff80ed8671 at VOP_OPEN_APV+0xa1
> > #10 0xffffffff80a3bc34 at vn_open_vnode+0x234
> > #11 0xffffffff80a3b803 at vn_open_cred+0x373
> > #12 0xffffffff80a348cf at kern_openat+0x26f
> > #13 0xffffffff80d9d862 at amd64_syscall+0x452
> > #14 0xffffffff80d8203b 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=<value optimized out>) 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
une@hkg.ac.jp / harrier@seiryu.id.hkg.ac.jp



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170404152329.cd3b040e89441e48560524a1>