The Mars Surveyor failure was caused by software updates. A $154 million software error.
Was this the most expensive software error ever? actually no, seems that the Ariane 5 explosion in 1996 wins with $370 million. That of course if we don’t count the loss of human life as happened with the Therac-25 radiation therapy machine that killed at least five patients between 1985-1987 due to radiation overdose, or with the MIM-104 Patriot missile in 1991 that prevented the interception of a Iraqui Scud missile that killed 28 US soldiers at Dhahran, Saudi Arabia, due to a failure in the clock, a failure that had already been discovered, but unfortunately no updated software was provided to the soldiers. The manufacturer sent instructions to work around the problem, but were not clear enough and therefore not properly used.
Saving money in testing can be very expensive!
More info in the wikipedia, the most famous computer bugs.