Bug 192082 - [FreeBSD10 on Hyper-v] Panic at boot with kernel built with INVARIANTS & WITNESS
Summary: [FreeBSD10 on Hyper-v] Panic at boot with kernel built with INVARIANTS & WITNESS
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.0-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-virtualization (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-24 03:35 UTC by Kylie
Modified: 2016-05-20 07:42 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kylie 2014-07-24 03:35:15 UTC
Firstly, we reproduced this issue by following below steps. Furthermore, we uninstalled FreeBSD Integration Service driver which is to provide synthetic driver in FreeBSD VM running on Hyper-v, we still could reproduce this issue. 

1. Boot vm on WS2012 R2

2. Download FreeBSD 10.0 source code

3. add following config into  sys/amd64/conf/GENERIC

    options    DDB

    options    INVARIANTS

    options    INVARIANT_SUPPORT

    options    WITNESS

4. build and install kernel

5. reboot

6. panic:

Timecounter "Hyper-V" frequency 10000000 Hz quality 10000000

panic: mtx_lock_spin: recursed on non-recursive mutex cnputs_mtx @ /usr/src/sys/kern/kern_cons.c:500

cpuid = 0

KDB: stack backtrace:

#0 0xffffffff808e1b10 at kdb_backtrace+0x60

#1 0xffffffff808aa786 at vpanic+0x126

#2 0xffffffff808aa656 at kassert_panic+0x136

#3 0xffffffff80896936 at __mtx_lock_spin_flags+0x166

#4 0xffffffff80862bd2 at cnputs+0x32

#5 0xffffffff808e6eca at putchar+0x13a

#6 0xffffffff808e5c5a at kvprintf+0xda

#7 0xffffffff808e74e7 at vprintf+0x87

#8 0xffffffff808e7453 at printf+0x43

#9 0xffffffff808fa6c9 at witness_checkorder+0xa99

#10 0xffffffff80896865 at __mtx_lock_spin_flags+0x95

#11 0xffffffff80722b9b at uart_cnputc+0x3b

#12 0xffffffff8086295f at cnputc+0x7f

#13 0xffffffff80862bf8 at cnputs+0x58

#14 0xffffffff808e6eca at putchar+0x13a

#15 0xffffffff808e5c5a at kvprintf+0xda

#16 0xffffffff808e74e7 at vprintf+0x87

#17 0xffffffff808e7453 at printf+0x43







Note: If adding options WITNESS_SKIPSPIN when building kernel, the panic will not occur
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2016-05-20 07:42:02 UTC
Canonicalize assignment.