Increasing Code Size Causes Weird MEGA168 Behavior

The following code runs fine on the ATMEGA8 and also when transferred to the ATMEGA168. However when code size increases somewhat, we start getting weird behavior (internal variables streaming out of the serial port) and then crashes. Reducing the size of the code eliminates this badness.

Is it our code? Is it some sort of flaw with the 168?

Here's the current version. There's some extra char variables at the top of the program. The last one (commented out) increases the size of the program enough to cause a crash.

You're probably running out of RAM. There's only 1 KB on the ATmega168 (and on the ATmega8). The Arduino environment should give you an warning about this, but I'm not sure if there's any way to get the compiler to figure out how much RAM your sketch uses. But I'll try to add a description of the problem to the troubleshooting guide.