Many years ago I got asked to fix a bug in some code written by someone else who had left. The thing was a DSL interpreter, and it had crashed while running one of the tokenised DSL programs. I traced back from where it had crashed... and discovered the interpreter itself had segfaulted at an earlier point. I found the core file and then trawled through to find out where it had segfaulted... and discovered an immortal bit of code in the interpreter's segfault handler that did a longjmp to main() and restarted the interpreter in the event that it segfaulted, with a comment that said "this is the really clever bit"...


Well, we had a few laughs about that...