It is a MIDI driver issue, and it is usually but not exclusively M-Audio.
The quickest solution is to reboot. Even after using a kill process I'll sometimes get the good old BSOD if I try to start SOnar again too soon after I've shut it down.
It never happens on my laptop but always happens on my main system and the only difference is the MIDI device. I believe it was mentioned on here a while ago by someone in the know from CW but can't find the thread now.