Sometimes running a program under a debugger makes it work. Running the same program without a debugger causes a failure or a crash. Here are some reasons why this can happen: 1. Timing - attaching a debugging changes timing and can hide race conditions.