I once solved a particularly nasty bug, causing a c++ server to segfault in production about once a week, in a dream! The eureka adrenaline woke me up, and I rushed to my laptop to find the insight was real. I had been trying to comprehend that segfault for several long days. It wasn't the most restful night though.