Runtime problem updating from IDE 1.0.6

Hello,
I'm working on Arduino Mega 2560 and I get the following problem trying to update IDE 1.0.6 to newer:

-The sketch is old and surely correct (working with 1.0.6 since many years)
-I've tried many new IDE (from 1.6.x to 1.8.x) with the same result
-The compilation phase gives no errors
-The sketch is loaded correctly
-But I get random runtime errors (very difficult to debug due to sketch complexity)

Any idea about (runtime) problems updating from version 1.0.6?
Many thanks to everybody!

Hi and welcome to the forums.

Posting tips.

  • Always list the version of the IDE you are using and the board version if applicable.
  • Your OS and version is always valuable information so please include it.
  • How to insert an image into your post. ( Thanks Robin2 )
  • Add your sketch where applicable but please use CODE TAGS ( </> )
  • Add a SCHEMATIC were needed even if it is hand drawn
  • Add working links to any specific hardware as needed (NOT links to similar items)
  • Guessing is not the best way to describe an issue. Actual facts are the most important.
  • Remember that the people trying to help cannot see your problem so give as much information as you can

Bob.

You possibly have a bug in your code :wink:

New compiler/linker might place stuff differently and now the bug shows. Similar to adding e.g. a serial print and a bug shows or disappears.

Double check boundaries of arrays.
Get rid of String (capital S) objects.
Set warning level to all and check the warnings.

Update the libraries; I would normally not do that but with this big step it might be advisable; make sure to have backups.

Post your code for others to look at.

Many thanks. I'll try your suggestion...