NASA’s Jet Propulsion Laboratory developed a spacecraft Mars Global Surveyor (MGS) and launched on November 7, 1996 for studying Mars’s surface. It accomplished its primary mission on January 2001 and was continuing its third mission after extension. It was working perfect for 9 years, 52 days until a problem in the software caused it to come to a halt.  The Mars Global Surveyor orbiter transmit its last signal with Earth on November 2, 2006. 
For redundancy and error checking, the spacecraft was supposed to hold system software’s two copies. Later updates to the software unexpectedly experienced a human error when two independent operators updated separate copies with dissimilar parameters. So, they made few corrective updates that unintentionally involved a memory which resulted into the loss of the spacecraft. Formerly, on November 2005, two operators had unknowingly changed the same parameter on two different copies of the system software. Each operator had used somewhat distinct precision while inputting a parameter and that resulted in a compact but noteworthy difference in the both the copies. The succeeding memory display output disclosed this instability to the mission’s team. To correct this error, a software update was made in June 2006 which was prompting data for being written to the wrong computer memory address on the spacecraft because of which NASA lost the contact with it. So, the bug was the update that they tried in June 2006 in which two memory addresses were handled mistakenly which could enable values to be written into the wrong memory addresses.
“Five months later, in November, the troublesome memory addresses were called but the bug caused the solar panels to get stuck as MGS was unable to correctly reposition its solar panels and went into contingency mode. While doing that, fallacious data led it to position itself so that one out of two batteries were disclosed to direct sunlight.”  The power management program of the MGS elucidated the battery overheating as an overcharge. The recharging of the battery was also blocked. The remaining battery was unable to recharge to a satisfactory extent and then both were evacuated out of power.  An antenna was repositioned by another software error and the contact with the Earth was cut off which left ground control human resources in the dark about the spacecraft's problems related to thermal and power.
The Mars Reconnaissance Orbiter spacecraft tried to image MGS to make sure that the position of the spacecraft is accurate on November 20, 2006 but the attempt was failed.  Within 11 hours of that transmission, NASA presumed that the drained batteries had left the craft without adjusting its direction in the Mars orbit and NASA officially terminated to recontact the MGS without resolving the problem and ceased the mission on January 28, 2007.  On April 13, 2007, NASA declared that the MGS was lost because of a fault in a parameter update to its system software.
- R. Gawel, 'NASA Blames Software Glitch For Mars Global Surveyor Failure,' 23 APRIL 2007.
- M. L. Songini, 'Computer glitch led to Mars Global Surveyor's demise,' 27 APRIL 2007.
- E. Howell, 'Mars Global Surveyor: A New Generation of Space Probes,' 11 APRIL 2016.