Kernel panic at shutdown after installing OSS with proposed fix.

This is my first post on this forum - so here goes:
I am currently using FreeBSD as a desktop system. My sound card is an ASUS Xonar D2X, which is only supported by audio/oss. I made a fresh install of FreeBSD 13.1-RELEASE and I compiled a custom kernel without any sound support before installing the oss package. I put
Code:
oss_enable="YES"
in /etc/rc.conf and rebooted. This setup did provide me with sound, but one annoying issue popped up: whenever I tried to shut down the computer, it would reboot instead after a kernel panic. I have attached the info file and dmesg output from that boot.
After some digging I found that the cause of the kernel panic is that the Oss Sound system shuts down before the mixer(8) utility does. I came up with the following fix: adding
Code:
# REQUIRE: oss
near the other requirements and keywords for rcorder(8) in /etc/rc.d/mixer. With this addition, mixer shuts down before oss and the kernel panics are no more.

Although this fix worked - I did not find any other post about this issue, which makes me doubt if I did something else wrong - is there some setting I'm overlooking?
 

Attachments

  • info.last.txt
    364 bytes · Views: 54
  • dmesg.txt
    16.6 KB · Views: 61
Unfortunately neither of the attachments you posted are particularly helpful in this case. info file is just info about the dump availability. It would help to see the panic string to at least confirm crash occurred due to what you are saying.
 
Hmm that should be /var/crash/core.txt.0 , but mine only contains the message to install gdb. Will I need to re-create the crash with gdb installed? Or is there another way to get the panic string.
 
Correct, you need to install gdb. If you booted kernel that crashed you can use: kgdb /boot/kernel/kernel /var/crash/vmcore.0. It will print the panic string too. bt command will print the backtrace then.
The best bet is to open a PR with these (especially if a problem is graphics driver). For that you should be able to reproduce it in generic kernel too.
 
I installed gdb and managed to get the crash inf :) I will read up on how to do a good PR as I'm fairly new to FreeBSD.

_martin Reproducing this in a GENERIC kernel will be difficult - the oss drivers only work if you make a custom kernel with all sound support removed. I followed the installation note on audio/oss to make it work. On a GENERIC kernel the oss drivers don't load and I could not reproduce the kernel panic. In any case thank you for your help!
 

Attachments

  • core.txt
    75.2 KB · Views: 67
Your suspicion is correct. I think you should contact port maintainer and let him know. Link you mentioned does have the contact information. Opening PR linked to this port is then definitely good way to go.

You found a nice workaround to avoid panic, somebody else might find that useful.
 
Thanks for the PR and the suggested fix. Although we've worked around the problem here, it definitely seems that the oss module doesn't clean up properly after being unloaded, and leaves the unattached mixer bits lying around. It means that it's not safe to unload the module after loading it, necessitating a reboot if you want to unload it... but given that you probably will be powering down to take out the sound card it's not the end of the world.

If anyone fancied fixing it 'properly' to avoid this, that'd be great, but otherwise time would be better spent on writing a FreeBSD driver for the CMI 8788 (which is in the lovely Xonar cards).
 
Back
Top