I recently had two crashes while killing a process which are very likely to be caused by the kqueue code. I asked NetBSD's current-users@ mailing list about the issue and got an answer suggesting the reading of a paper.
Greg Lehey, the author of the post, wrote a nice tutorial and a set of slides dealing with kernel debugging under BSD systems; these were prepared for the EuroBSDCon 2004 (though it looks like they were not presented).
The tutorial is 167 pages long (not yet complete!) and is full of examples. I've read some of the very first pages and looks very interesting, either for the experienced and inexperienced developer, so it's definitely worth reading.Edit (Jan 9th, 18:35): The tutorial was, in fact, presented, as seen here; thanks to nbuwe for pointing this out.