For example, here is a very simple java fragment whose presence caused the JVM to crash, in its particular context (put it anywhere else and it will be stable). Note that the problem occurs even under conditions where j is never 50,000 when the program is running. Also note that int in java is capable of holding the value 50,000, so that's not the problem.

if (j == 50000) { System.exit(1);}

How did we know this was the culprit? Well these two caused no problems:

// what the heck is wrong with this??
if (j == 50000) { System.exit(1);}

if (j == 50000) { System.out.println("!"); System.exit(1); }

Both of these caused MUCH confusion: how could the presence of a comment line keep something from crashing? And how could the contents of an if statement which is never true change whether something crashes or not?


for (int i = 0; i<0; i++) {}

failed, while

for (int i = 0; i <0; i++) { System.out.println("God help us"); }


Eventually, I gave in and put in a comment line (a la the second example) simply saying,

//Do not remove this comment! VOODOO PROGRAMMING

How is all of this possible? Clearly there is a deviation from specified compiler and/or virtual machine behavior. And voodoo programming is programming which deals with such out-of-spec behavior.