First guess something in the sketch is trashing memory.

Any dynamic allocations or arrays in use that might get overrun or pointers that might get a wrong value?