# FreeBSD 11 silent crash (error in kernel config?)



## Marcin Solski (Nov 12, 2016)

Hello all!

I have recently switched to 11-RELEASE. I've been using FreeBSD for quite a while for home server. More to play with than something serious. 

I usually cut the installation to minimum first and than add things as I need or want to learn. 

Today I found my device crashed silently. No single information in logs about what has happend. Please see below (kernel config, kldstat and services running). 

Any hint would be appreciated. What could it be? I suspect I cut too much of kernel config... Guessing it may be INET6 but I do not use it and did not perform any config (sshd and ntpd started with --ipv4 options). System is almost fresh. No other adjustments made. Am I missing something? Best would be to have debug enabled but curently it is not 


```
cpu             HAMMER
nocpu           I486_CPU
nocpu           I586_CPU
ident           pico

options         SCHED_ULE               # ULE scheduler
options         PREEMPTION              # Enable kernel thread preemption
options         INET                    # InterNETworking
options         IPSEC                   # IP (v4/v6) security
options         TCP_OFFLOAD             # TCP offload
options         SCTP                    # Stream Control Transmission Protocol
options         FFS                     # Berkeley Fast Filesystem
options         SOFTUPDATES             # Enable FFS soft updates support
options         UFS_ACL                 # Support for access control lists
options         UFS_DIRHASH             # Improve performance on big directories
options         UFS_GJOURNAL            # Enable gjournal-based UFS journaling
options         PROCFS                  # Process filesystem (requires PSEUDOFS)
options         PSEUDOFS                # Pseudo-filesystem framework
options         GEOM_PART_GPT           # GUID Partition Tables.
options         GEOM_LABEL              # Provides labelization
options         COMPAT_FREEBSD32        # Compatible with i386 binaries
options         COMPAT_FREEBSD4         # Compatible with FreeBSD4
options         COMPAT_FREEBSD5         # Compatible with FreeBSD5
options         COMPAT_FREEBSD6         # Compatible with FreeBSD6
options         COMPAT_FREEBSD7         # Compatible with FreeBSD7
options         COMPAT_FREEBSD9         # Compatible with FreeBSD9
options         COMPAT_FREEBSD10        # Compatible with FreeBSD10
options         SCSI_DELAY=5000         # Delay (in ms) before probing SCSI
options         SYSVSHM                 # SYSV-style shared memory
options         SYSVMSG                 # SYSV-style message queues
options         SYSVSEM                 # SYSV-style semaphores
options         _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options         PRINTF_BUFR_SIZE=128    # Prevent printf output being interspersed.
options         KBD_INSTALL_CDEV        # install a CDEV entry in /dev

# Make an SMP-capable kernel by default
options         SMP                     # Symmetric MultiProcessor Kernel
options         DEVICE_NUMA             # I/O Device Affinity

# CPU frequency control
device          cpufreq

# Bus support.
device          acpi
options         ACPI_DMAR
device          pci
options         PCI_HP                  # PCI-Express native HotPlug
options         PCI_IOV                 # PCI SR-IOV support

# ATA controllers
device          ahci                    # AHCI-compatible SATA controllers
device          ata                     # Legacy ATA/SATA controllers

# ATA/SCSI peripherals
device          scbus                   # SCSI bus (required for ATA/SCSI)
device          da                      # Direct Access (disks)
device          pass                    # Passthrough device (direct ATA/SCSI access)

# atkbdc0 controls both the keyboard and the PS/2 mouse
device          atkbdc                  # AT keyboard controller
device          atkbd                   # AT keyboard
device          kbdmux                  # keyboard multiplexer
device          vga                     # VGA video card driver

# vt is the new video console driver
device          vt
device          vt_vga
device          vt_efifb

# Parallel port
device          ppc
device          ppbus                   # Parallel port bus (required)

# Pseudo devices.
device          loop                    # Network loopback
device          random                  # Entropy device
device          ether                   # Ethernet support

# The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
# Note that 'bpf' is required for DHCP.
device          bpf                     # Berkeley packet filter
```


```
masolski@chojrak:~ % kldstat
Id Refs Address            Size     Name
 1   78 0xffffffff80200000 b55188   kernel
 2    1 0xffffffff80d57000 3d4d0    miibus.ko
 3    1 0xffffffff80d95000 1e880    if_iwn.ko
 4    5 0xffffffff80db4000 6d290    wlan.ko
 5    2 0xffffffff80e22000 4540     firmware.ko
 6    2 0xffffffff80e27000 74408    sound.ko
 7    1 0xffffffff80e9c000 42f18    snd_hda.ko
 8    5 0xffffffff80edf000 3dd20    usb.ko
 9    1 0xffffffff80f1d000 2cd8     coretemp.ko
10    1 0xffffffff80f20000 e480     xhci.ko
12    1 0xffffffff81365000 10de     wlan_wep.ko
13    1 0xffffffff81367000 207f     wlan_tkip.ko
14    1 0xffffffff8136a000 50eb     wlan_ccmp.ko
15    1 0xffffffff81311000 652c     ukbd.ko
16    1 0xffffffff81318000 1b3b     ums.ko
17    1 0xffffffff8131a000 146c     uhid.ko
```


```
masolski@chojrak:~ % service -e
/etc/rc.d/hostid
/etc/rc.d/hostid_save
/etc/rc.d/cleanvar
/etc/rc.d/ip6addrctl
/etc/rc.d/netif
/etc/rc.d/devd
/etc/rc.d/newsyslog
/etc/rc.d/syslogd
/etc/rc.d/savecore
/etc/rc.d/virecover
/etc/rc.d/dmesg
/etc/rc.d/motd
/etc/rc.d/ntpd
/etc/rc.d/rctl
/etc/rc.d/sshd
/etc/rc.d/sendmail
/etc/rc.d/cron
/etc/rc.d/mixer
/etc/rc.d/gptboot
/etc/rc.d/bgfsck
masolski@chojrak:~ %
```


----------



## gkontos (Nov 12, 2016)

In oder to better understand what might break the KERNEL you can use this method. It is much easier to read it. In your case the KERNEL has been compiled successfully. So, I would suggest to stick with GENERIC and provide some more information as to what was the system doing during the crash. A `dmesg` report would also be useful.


----------



## Terry_Kennedy (Nov 13, 2016)

Marcin Solski said:


> Any hint would be appreciated. What could it be? I suspect I cut too much of kernel config...


Unless you need something that can only be set at kernel compile time (most things these days can be done with loadable modules or system tunables), I'd suggest sticking with the GENERIC kernel. These days system memory is normally large enough that it isn't worth building a custom kernel to save space. It is a habit people got into on systems with very limited memory and/or address space, like 2BSD on a PDP-11. Using the GENERIC kernel lets you easily update to newer FreeBSD versions and security updates with FreeBSD-update(8).

If there is some reason you need to build a custom kernel, best practice is to do something like this:

```
include GENERIC
ident   MYKERNEL
#
nodevice foo
device bar
options BAZ=1234
```
to just remove / add devices and set any needed options. That way you don't have to track changes made to the GENERIC config. Otherwise, after a few releases your custom kernel config may get out-of-sync with the GENERIC one and you can end up with a non-bootable system or other problems.


----------

