Created attachment 244128 [details] Shows the DELAY lines inserted in trap.c Attached are the following files: dmesg.boot_with_audio_driver dmesg.boot_without_audio_driver kernel_panic.MOV kernel_panic_screen_messages.jpg kernel_panic_with_DELAY.MOV kernel_without_audio_driver.MOV trap.c_diff Desktop components: cpu: AMD Ryzen 9 7900 motherboard: Gigabyte B650 Aorus Elite AX memory: Corsair 32 GB (2x16GB) storage: SSD Gigabyte 1 TB ZFS is being used with 2GB swap. Fot this panic, the kernel crash dump is not created in /var/crash. I can simulate a kernel crash with sysctl debug.kdb.panic and the dump is created in /var/crash. Replacing the Corsair memory with G.Skill and installing FreeBSD on a HDD instead of SDD does not make a difference. When cold booting, the kernel panics as shown in kernel_panic.MOV. After the panic, the system reboots and it's ok. The call stack in /usr/src/sys/amd64/amd64/trap.c: trap_fatal() called from line 795 trap_pfault() called from line 385 trap() called from line 665 trap_check() called from /usr/src/sys/amd64/amd64/exception.S, line 290 I changed the file /usr/src/sys/amd64/amd64/trap.c as shown in trap.c_diff in order to get a better view of the screen messages as you can see in kernel_panic_with_DELAY.MOV. The screen messages can also be seen in the file kernel_panic_screen_messages.jp g and are also shown below: ... acpi_tz0: <Thermal Zone> on acpi0 cpu0: <ACPI CPU> on acpi0 hwpstate0: <Cool'n'Quiet 2.0> on cpu0 Timecounter "TSC-low" frequency 1846531959 Hz quality 1000 Fatal trap 12: page fault while in kernel mode cpuid = 2; apic id = 02 fault virtual address = 0x0 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff80972392 stack pointer = 0x20:0xfffffe01072d5de0 frame pointer = 0x20:0xfffffe01072d5e00 code segment = base rx0, limit 0xfffff, type 0x1b DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 12 (irq78: hdac1) <------------- AAAAA trap number = 12 TRAPFRAME: tf_rdi = -8796050178040 tf_rsi = 0 tf_rdx = 1 tf_rcx = -8796054324096 tf_r8 = -2194564528880 tf_r9 = -2194607874048 tf_rax = 1 tf_rbx = -8796050178048 tf_rbp = -2194607874560 tf_r10 = 2000 tf_r11 = 2146883647 tf_r12 = 233 tf_r13 = -8796050178048 tf_r14 = 0 tf_r15 = 0 tf_trapno = 12 tf_fs = 19 tf_gs = 40 tf_addr = 8 tf_flags = 1 tf_es = 59 tf_ds = 59 tf_err = 0 tf_rip = -2137578606 tf_cs = 32 tf_rflags = 66066 tf_rsp = -2194607874592 tf_ss = 40 Workaround: based on the line marked with "AAAAA" above and dmesg.boot_with_audio_driver, I disalbed the audio driver by adding the following lines to /boot/device.hints: hint.pcm.4.disabled="1" hint.pcm.5.disabled="1" hint.hdaa.1.disabled="1" hint.hdacc.1.disabled="1" hint.hdac.1.disabled="1" and the kernel no longer panics as shown in kernel_without_audio_driver.MOV.
Created attachment 244129 [details] See the Description
Created attachment 244130 [details] See the Description
Created attachment 244131 [details] See the Description
It does not let me attach the following files: -rw-r--r-- 1 root wheel 6782462 Aug 15 10:58 kernel_panic.MOV -rw-r--r-- 1 root wheel 4409731 Aug 14 17:11 kernel_panic_with_DELAY.MOV -rw-r--r-- 1 root wheel 4902469 Aug 15 10:59 kernel_without_audio_driver.MOV
The output of kldstat is the same with or without the audio driver.
The kernel panic is caused by snd_hda.ko. In the file /usr/src/sys/amd64/conf/GENERIC, section 'Sound support', I commented out all the lines except one: ... # Sound support device sound # Generic sound driver (required) #device snd_cmi # CMedia CMI8338/CMI8738 #device snd_csa # Crystal Semiconductor CS461x/428x #device snd_emu10kx # Creative SoundBlaster Live! and Audigy #device snd_es137x # Ensoniq AudioPCI ES137x #device snd_hda # Intel High Definition Audio #device snd_ich # Intel,NVidia and other ICH AC'97 Audio #device snd_via8233 # VIA VT8233x Audio ... swift@eagle:~ cat /boot/device.hints ... hint.hdac.1.cad0.nid20.config="as=1" hint.hdac.1.cad0.nid27.config="as=1 seq=15" With the new kernel, after logging in, I run the following command: swift@eagles:~ sudo /sbin/kldload -n /boot/kernel/snd_hda.ko which intermittently generates the kernel panic as you can see in kernelPanicScreenMessge.jpg. Attached are also the crash files from /var/crash: core.txt.6 vmcore.6 info.6 bounds
Created attachment 244232 [details] core.txt.6
Created attachment 244233 [details] info.6
Created attachment 244234 [details] bounds
Created attachment 244235 [details] screen messages for the kernel panic
Created attachment 244236 [details] error when trying to attach vmcore.6.gz
I cannot attach vmcore.6.gz because of the error shown in bugzillaError.jpg.
bugzilla works like a crap.
Created attachment 244238 [details] kgdb information
It does not let me attach vmcore.6.gz. I ran the following command: $ sudo kgdb /boot/kernel/kernel /var/crash/vmcore.6 and I attach kgdb.out with kgdb data.
I'm fairly certain this is the same issue as bug #268393. Jonathan created a patch in bug #268393, comment #48 to add a delay in the hda_intr_handler function that seems to workaround the issue for now but is not a permanent fix. If the patch works, this bug should be marked as a duplicate of bug #268393.
The patch works. The kernel panic no longer occurs. Both the headphone and the monitor speakers work fine. Thank you very much!
^Triage: submitter confirms the following patch works: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268393#c48 So even though there is a lot of debugging information here (thanks!) that is not in 268393, I am going to go ahead and mark this as a duplicate of 268393. I hope this will decrease the confusion of people trying to follow along with these PRs. *** This bug has been marked as a duplicate of bug 268393 ***