I've got a compiled executable here that can't decide whether to run or crash. I keep invoking it from the command line (without re-compiling) and it keeps behaving differently. Sometimes it loads the UI without problems. Other times it immediately crashes with a runtime exception.
I can't find a pattern of runs and crashes that helps me identify the cause, so I'm asking generally:
What can cause this behavior in a compiled program? What kinds of bugs/conditions can lead to exceptions being thrown sometimes but not every time?