I've been having some odd issues with a program that imply to me RAM corruption - which given the size of the project is entirely possible - but the problem only occurs when the sketch is compiled with Arduino IDE 1.6.10 or later (I've tested all versions through to 1.8.1), but the same sketch has no issues whatsoever with 1.6.9 or prior.
Regardless of which version of the IDE I use, the code compiles just fine so there is no glaring code mistake, unless the compiler is missing it.
A curious difference that I have noticed involves the RAM calculation message returned by the IDE. When I compile in 1.6.9 the message at the bottom of the screen says:
Global variables use 4,910 bytes (59%) of dynamic memory, leaving 3,282 bytes for local variables. Maximum is 8,192 bytes.
But when I compile the exact same sketch in 1.6.10 or later, the message changes and now it calculates Global variable use at only 4,372 bytes (53%).
Using the MemoryFree utility at runtime also shows differences in the same sketch compiled under different IDEs. In the loop where the crashes normally occur, printing freeMemory() when compiled from 1.6.9 shows 3,022 bytes free, but when compiled with 1.6.10 it returns 3,534 bytes free.
Although I was of course originally ecstatic to think I had instantly gained half-a-K of RAM with no effort on my part simply by upgrading the IDE, the resulting problems reminds me there is no such thing as a free lunch. Actually I was happy with our 1.6.9 RAM usage but it would be nice if I could track down what is happening and whether it is possible to correct something about my program in order for it to work reliably in later versions of the IDE.
Information about my project
Naturally to even encounter these sorts of issues we have gone a bit further than the average user. Our board is our own hardware but uses an ATmega2560 processor. We are using a custom bootloader and a custom entry in Arduino's boards.txt file. The sketch and related C++ libraries consist of about 40,000 lines of code, so I won't post it all here.
You can however see or download the firmware from our GitHub here: Open Panzer Project - TCB.
If you scroll down on that page and read the help document you can see the custom Boards.txt entry. But even without that entry or our custom bootloader, the code should compile just fine on a stock Arduino Mega.
All my testing is being done on Windows 7 Professional 64 bit.
More detailed information about the problem
The problem that I encounter with 1.6.10 and later is that the board either locks up, or reboots several times and eventually locks up. The time between lock-up/reboot seems random but is usually within the first 5-10 seconds or so. It always occurs within this do-loop: void Setup() lines 411-438.
This loop runs indefinitely while the board attempts to detect a signal from an RC receiver. Oddly, if a receiver is detected and the sketch proceeds on to the main loop, the rest of the program seems to run just fine without lockups, regardless of what IDE the sketch was compiled with. But if no receiver is connected and it sits there waiting in that loop, in IDE 1.6.9 and earlier it can sit in that loop for hours with no problem, but in IDE 1.6.10 and later that loop causes a lockup or a reboot within 5-10 seconds.
The specificity of this behavior also implies there could very well be a code issue but since no IDE throws an error, and since the same receiver detection process can take place later in the main loop without problems, and since the observed behavior is a random board crash rather than an identifiable code bug, I am leaning towards something to do with RAM.