I have been working on some 30+ year old Fortran code, trying to figure out why it just intermittently doesn't work for seemingly random reasons. One set of inputs works for one user but not another user, code that works when compiled with -O1 or -O3 but seg faults with -O2, and other weird nonsense.
After about a week of picking through code that hasn't been touched for 30 years, I tracked down the problem--there are A LOT of uninitialized variables, and it's basically random whether or not the random garbage that winds up in these variables crashes the entire program. I honestly have no idea how this code ever worked.
Now that I go back to my customer and tell them what's going on, their response is "if this is a problem why has the code worked for the last 30 years...?" Which is a fair question--why HAS this code worked for them for the last 30 years? I think I'm the first one to rebuild it from source since then, did Fortran compilers in the 90s zero out the stack or something? Why did the programmers of decades ago think it reasonable to put variables on the right-hand side of an assignment operator without regard for whether those variables had been initialized first?