I was pulling my hairs out over unexplainable crashes yesterday, occuring on a Motoruino board.
It occured after simply enabling some more debugging stuff and it started to act all weird: crashing randomly and corrupted serial data.
It really had me going nuts at some point -- even wondering if the chip was bad. All until I read some interesting stuff about the .bss and .data size having limits. A shame that the Arduino IDE does not check for the allowed sizes for SRAM.
The following command can easily reveal my problem:
avr-size /path/to/temporary_compile_dir/compiled.cpp.elf
text data bss dec hex
11926 1594 474 13994 36aa
The values for .data and .bss exceed the allowed SRAM size limit. So that's were the problem came from! Perhaps adding all those ANSI escape codes to make my Serial debugging console all colourful and sexy was not such a good idea after all... :-D
As I had not read about this before, I thought it was interesting enough to share. I'm sorry if it wasn't :)