Every now and then sndiod hangs on me. Usually I discover this as mplayer hangs while playing a video or hangs while opening the audio device on startup. Restarting sndiod using the /etc/rc.d/sndiod script doesn't work; it blocks trying to stop the running sndiod. I have to use kill -9 to get rid of it.
Happened again last night and I investigated a bit. This was after I tried restarting it using /etc/rc.d/sndiod, but before resorting to kill -9. Attaching with gdb revealed that it was stuck in poll(2) with the 2nd argument being 0 and the last argument being -1. Since no file descriptors are being monitored and the timeout is infinite, the process just blocks forevere. I did look at the file_list, and only the rsnd/0 file descriptor was on the list. That probably corresponded to the mplayer that hung (and which I subsequently killed) as I had nothing else running that was doing audio output. Obviously the sndiod polling code had decided not to poll for activity on rsnd/0, causing it to block as described above.
