On the last day of 2012, within an hour of the closing bell, New York Stock Exchange traders were alerted to a technical glitch in the market’s order-matching system. The problem affected just 26 stocks and was cleared up within four minutes — but that good news was tinged with the knowledge that far worse can happen, and did.

....