The day a software bug almost killed the Spirit rover