Compilation fails after upgrading to IDE 1.8.6 - "Segmentation fault " ?

The following error message is given by the compiler after upgrading to IDE 1.8.6
The sketch compiles successfully with IDE 1.8.5

Now considering a downgrade to the previous version.

Anybody else came across this ?

C:\Users\JJJJ\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\EEPROM\src/EEPROM.h: In function 'float const& EEPROMClass::put<float>(int, float const&) [clone .isra.35]':

C:\Users\JJJJ\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\EEPROM\src/EEPROM.h:142:5: internal compiler error: Segmentation fault

     }

     ^

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html> for instructions.

lto-wrapper.exe: fatal error: C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc returned 1 exit status

compilation terminated.

c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed

collect2.exe: error: ld returned 1 exit status

?board?

You can easily have several versions of the IDE on the same PC.

...R

demkat1:
?board?

Sorry forgot to mention...

Its an arduino Mega

Robin2:
You can easily have several versions of the IDE on the same PC.

...R

Well, the installer first uninstalls the last version before installing the lateset, but I am sure there is a way around this.

Even so, this would be a last resort for me! I d like to know why the above is happening...

Update:

More confusing evidence..

I have noticed that repeated attempts to compile the SAME code (no changes made) sometimes results in successful compilation. Same happens if I make some small, insignificant change in the last code i ve added. (insignificant = i.e remove a println() statement)

Watcher:
The following error message is given by the compiler after upgrading to IDE 1.8.6
The sketch compiles successfully with IDE 1.8.5

This has been reported to the Arduino developers:

And elsewhere here on the forum and GitHub.

Watcher:
Anybody else came across this ?

Yes, I have. It's not really an Arduino IDE 1.8.6 problem, but rather an avr-gcc 5.4.0 problem. This happened to me while using the beta testing version of Arduino AVR Boards with Arduino IDE 1.8.5.

Watcher:
Well, the installer first uninstalls the last version before installing the lateset, but I am sure there is a way around this.

Use the "Windows ZIP file for non admin install" download from https://www.arduino.cc/en/Main/Software and you can have as many versions of the IDE installed as you like. I currently have 48 different IDE versions on my computer.

Theoretically you could continue to use Arduino IDE 1.8.6 and just roll back from Arduino AVR Boards 1.6.22 to Arduino AVR Boards 1.6.21. Unfortunately there is a bug in Arduino IDE 1.8.6 that makes this impossible:

That has already been resolved. So as soon as Arduino IDE 1.8.7 is released (scheduled for next week) you'll have the option of using the latest IDE version with the last stable compiler version.

Watcher:
I have noticed that repeated attempts to compile the SAME code (no changes made) sometimes results in successful compilation. Same happens if I make some small, insignificant change in the last code i ve added. (insignificant = i.e remove a println() statement)

Same here. It has only occurred for me with very complex sketches. As soon as I started trying to slim it down to a minimal demonstration, it started occurring only sporadically. It even stops happening after I restart my computer. This makes it difficult to investigate the bug.

@pert :
Thank you very much for your quick response!

Apologies for failing to spot the answer before posting my issue on the forum. I did try however, but I didnt check on the github arduino thread :frowning:

Watcher:
Apologies for failing to spot the answer before posting my issue on the forum. I did try however, but I didnt check on the github arduino thread :frowning:

No apologies needed. I don't think you could consider anything we have currently to be an answer. I remember something about this on the forum but I don't think there was any progress. The other mentions of it on GitHub I found have not been helpful. For example, here we have the "it's a rare compiler bug, not my problem" response:

It's hard to say whether this is really something that should be reported to GCC. Is the bug specific to Arduino's build? Is this something that has already been fixed? Is this something that has already been reported? How to write a useful bug report? I'm fairly confident in reporting bugs to Arduino projects but once I get outside my comfort zone I'm more likely to not bother and just hope someone else deals with it. It's a shame because I really like being (a very small) part of the solution rather than just grumbling about buggy software. I know that a lazy bug report isn't helpful but it can be a ton of work to do it right, especially when out of my depth.

Well, currently I have both IDE 1.8.5 and IDE 1.8.6 on two separate virtual machines (WIN 7 & Win 10 respectively)

I wouldn't compare compile time as the two machines are allocated different resources but ...

The same sketch compiles to 95750 and 97020 bytes respectively.

In other words the older IDE (with its "associated" compiler version) gives smaller hex file result ?

Unless one of the included libraries have grown since....

Watcher:
In other words the older IDE (with its "associated" compiler version) gives smaller hex file result ?

I haven't done a lot of comparison between the two, but the one I did do was smaller with Arduino AVR Boards 1.6.22 (bundled with Arduino IDE 1.8.6) than Arduino AVR Boards 1.6.21 (for our purposes, identical to the Arduino AVR Boards 1.6.20 bundled with Arduino IDE 1.8.5).

Watcher:
Unless one of the included libraries have grown since....

I know using the Ethernet library 2.0.0 included with Arduino IDE 1.8.6 can result in significant increases of memory usage.

I see..

Ok I ll repeat this with another sketch after ensuring the libraries are the same too.

Thanks for your time :slight_smile: