Fatal Trap 12 - realtek driver issue?

Hello,

My problem is with FreeBSD version 14.3. I'm running a gigabyte TRX50 motherboard. The on board ethernet isn't supported with a base install, so I followed the instructions at https://www.micski.dk/2024/12/06/realtek-rtl8125-network-interface-driver-for-freebsd/ to get the realtek driver sneakernetted over. After getting it over I installed the package for the realtek driver to make sure I had the latest verison. I cannot recall with 100% certainty if I had this fault after installing the sneakernetted driver or once I installed the package. I"m 90% sure it was happening after the sneakernet.

Any software installed has been through the package system. I do not compile from ports.

Anyway, I was perusing dmesg and some other files and I was getting a fatal trap 12. Here is the error:
Code:
kernel: tun0: link state changed to UP
kernel:
syslogd: last message repeated 1 times
kernel: Fatal trap 12: page fault while in kernel mode
kernel: cpuid = 62; apic id = 3e
kernel: fault virtual address    = 0xfedc206c
kernel: fault code               = supervisor write data, page not present
kernel: instruction pointer      = 0x20:0x6e7b87cb
kernel: stack pointer            = 0x28:0xfffffe0167672c08
kernel: frame pointer            = 0x28:0xfffffe0167672cb0
kernel: code segment             = base 0x0, limit 0xfffff, type 0x1b
kernel: Fatal trap 12: page fault while in kernel mode
kernel: cpuid = 62; apic id = 3e
kernel: fault virtual address    = 0xfedc206c
kernel: fault code               = supervisor write data,
page not present
kernel: instruction pointer      = 0x20:0x6e7b87cb
kernel: stack pointer            = 0x28:0xfffffe0167672c08
kernel: frame pointer            = 0x28:0xfffffe0167672cb0
kernel: code segment             = base 0x0, limit 0xfffff, type 0x1b
kernel:                  = DPL 0, pres 1, long 1, def32 0, gran 1
kernel: processor eflags = interrupt enabled, resume, IOPL = 0
kernel: current process          = 0 (thread taskq)
kernel: rdi: 0000000000000001 rsi: fffff800021c3c60 rdx: 000000000127f300
kernel: rcx: 0000000000000000  r8: 0000000100000000  r9: 00000000fedc209c
kernel: rax: 00000000fed80d92 rbx: fffffe0167672de8 rbp: fffffe0167672cb0
kernel: r10: 00000000fedc206c r11: 0000000051eb851f r12: fffff80002159958
kernel: r13: 0000000000000000 r14: fffffe0167672e20 r15: fffffe0167672dc0
kernel: trap number              = 12
kernel: EFI RT page fault

There is no other information in the log unlike other fatal trap 12 posts I've seen on here. I have internet and things seem to work, but I did have two nasty crashes that locked up my system completely when I was using zoom via firefox browser. I dont know if its related.

This error always happens after tun0 comes up, and I don't recall seeing this error prior to any network drivers being installed.

Copy of /etc/rc.conf:
Code:
sshd_enable="YES"
ntpd_enable="YES"
ntpd_sync_on_start="YES"
powerd_enable="YES"
moused_nondefault_enable="NO"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
ifconfig_re0="DHCP"
kld_list="amdgpu"
dbus_enable="YES"
lightdm_enable="YES"
vm_enable="YES"
vm_dir="/vm"
fusefs_enable="YES"
openvpn_enable="YES"
openvpn_configfile="/usr/local/etc/openvpn/ovpn.conf"

/var/crash holds no information - its a single file minfree with the number 2048 in it.

Copy of /boot/loader.conf:
Code:
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
cryptodev_load="YES"
zfs_load="YES"
if_re_load="YES"
if_re_name="/boot/modules/if_re.ko"
vmm_load="YES"
fusefs_load="YES"

It doesn't seem to be affecting my system (other than the two lockups when using zoom via firefox browser) but I'd like to resolve this if I can.

I tried updating my system per the handbook with freebsd-update fetch followed by freebsd-update install but the trap error persists. Now freebsd-version -kru says:
Code:
14.3-RELEASE
14.3-RELEASE
14.3-RELEASE-p1

Anyone have any ideas what I should look at to fix the issue? Hopefully I do not have some bad hardware. If anyone else needs additional information from my system let me know and I'll provide it.

Thank you in advance for any help with this.
 
Make sure you get the driver from the FreeBSD-kmods repository, the 'standard' FreeBSD repositories are still being built for 14.2. Which is fine for 99% of the userland applications, but can often cause problems for kernel modules.

Code:
# pkg search realtek-re-kmod
realtek-re-kmod-1100.00.1402000_1 Kernel driver for Realtek PCIe Ethernet Controllers
realtek-re-kmod198-198.00.1402000 Kernel driver for Realtek PCIe Ethernet Controllers
realtek-re-kmod-1100.00.1403000_1 Kernel driver for Realtek PCIe Ethernet Controllers
realtek-re-kmod198-198.00.1403000 Kernel driver for Realtek PCIe Ethernet Controllers
Note the 1402000 (for 14.2-RELEASE) and 1403000 (for 14.3-RELEASE) version differences.
 
You guys rock! Thanks so much. To address the comments:

The EFI RT page fault messages are pretty harmless. They are not kernel crashes but more of an indication of firmware bugs.
Another person also recently observed such messages on their machine: https://forums.freebsd.org/threads/14-3-dmesg.98065/

Thanks so much for the quick reply! I did see that thread but reading it seemed to indicate I might not have an updated system which is why I tried the freebsd-update. Does your feedback mean that I should do a bios firmware update for my board? I have not done that yet even though there are updated, non-beta revisions available. Just wanted to rule out a software issue I might have created before going that route as I loathe to make a mistake in the process and brick a $600 motherboard :).

Make sure you get the driver from the FreeBSD-kmods repository, the 'standard' FreeBSD repositories are still being built for 14.2. Which is fine for 99% of the userland applications, but can often cause problems for kernel modules.

Code:
# pkg search realtek-re-kmod
realtek-re-kmod-1100.00.1402000_1 Kernel driver for Realtek PCIe Ethernet Controllers
realtek-re-kmod198-198.00.1402000 Kernel driver for Realtek PCIe Ethernet Controllers
realtek-re-kmod-1100.00.1403000_1 Kernel driver for Realtek PCIe Ethernet Controllers
realtek-re-kmod198-198.00.1403000 Kernel driver for Realtek PCIe Ethernet Controllers
Note the 1402000 (for 14.2-RELEASE) and 1403000 (for 14.3-RELEASE) version differences.

SirDice I've seen you reply to tons of threads here and I just want to say I appreciate what you do. As for your advice, I did a pkg info|grep realtek* and it returned realtek-re-kmod-1100.00.1403000_1 Kernel driver for Realtek PCIe Ethernet Controllers. I'm assuming since I installed the package and it put the driver in /boot/modules there's nothing left for me to do from a housekeeping point of view?
 
Please try the net/realtek-rge-kmod port or package (very fresh, don't see it in the FreeBSD-ports-kmod repo yet)
This driver is planned to land in base.
 
Back
Top