The challenge is to write a deterministic program (any language/OS) which takes no arguments or other input and behaves differently in a debugger from how it behaves when not being debugged.
For example, the program may output something when being debugged but not output anything when not being debugged. Or output something different in each case. Or it may crash when being debugged but not crash when not being debugged. Or vice-versa.
Caveats and clarifications:
- Timing differences do not count.
- Interpreted languages are permitted.
- To emphasize determinism: the behaviour must be exactly reproducible both in and out of debugging context.
- The presence of the debugger itself should the only difference between the two cases.
- Telling the debugger to add inputs (stdin or argv ENV or whatever) is cheating, the debugger should run the program "as-is".
- Changing the environment (e.g. running in a virtual machine or different OS, or changing OS settings such as memory limits) between debug and non-debug runs is not permitted.
Shortest code wins. I may award a bounty which reveals something interesting about how debuggers work.