I’ve dealt with chunks of code that seemed done, in that nothing had changed in them for a long time (years), and they were doing their job admirably. Then suddenly one day, a bug turns up in that code that seemed so finished.
Joshua Bloch has me topped: in Nearly All Binary Searches and Mergesorts are Broken, he identifies a bug in binary searches that has been around for 50 or so years. Like the archaeo-bugs I’ve dealt with, they arise because the old code is being used on a slightly new or unusual case. In the sort algorithms, it’s arrays with billions of elements.