Compiler Bug in 1.8.8,

the first answer fixes the issue, it states “Go to board manager and install Arduino AVR boards 1.6.21”

--------------------------------- problem-------------------------------

I have no idea what any of the following means, see below “bug…compiler”.

I attached the ino files. whatthef__k.ino is the directory name and first ino file.

I do know removing a couple of comments in the file with setup() loop() allowed the program to compile. But then just a minor change causes it to fail miserably. It was working until trying to print out debug messages in the AT_TIMER2.ino. Then things went nuts.

The program has 9 file tabs all loaded up and in the sketcher environment window. To figure what was happening I copied it all to another directory and renamed the top file. Replaced the file with setup() and loop() with a near empty one and it worked. All compiled fine. Put the real one back and it failed. I then cut out piece by piece of the one with setup() loop() until it compiled. Then put the small piece back in and it failed. It is a “bool continueToLoop = true;” But that has nothing to do with the real issue. I can cut out another part and it works as well.

I am not a programmer. I’m a hardware guy with over 40 years in the computer field. Looking over how to report a potential bug was too much for me to understand. I’m a hardware chip designer. Not a software guru.

I can provide answers to questions. Code is attached. Environemet was first loaded early January 2019. rev 1.8.8

The bug first reported undefined items that were clearly defined. Perhaps only functions. Eventually hit the below message.

-------------------------bug…compiler printed this out---------------------------------------
In function ‘global constructors keyed to 65535_0_Testing_Motor_Parameters.ino.cpp.o’:

lto1.exe: 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

exit status 1
Error compiling for board Arduino/Genuino Uno.
-------------------------------------end of message printed------------------------------

A1_ATMegaTimer2Constants - Copy.ino (12.9 KB)

A2_TIMER2.ino (4.02 KB)

B_Motors.ino (2.24 KB)

D_Analyzer.ino (9.21 KB)

E_Config_Timer2.ino (4.96 KB)

F_Line_Sensor.ino (292 Bytes)

G_Motor_Time_Constant.ino (2.56 KB)

sketch_apr03a.ino (2 Bytes)

whatthef__k.ino (653 Bytes)

X_MAIN.ino (463 Bytes)

Go to Board Manager and install Arduino AVR boards 1.6.21

I only have version 1.8.7 of the IDE but I do get compile errors about functions not being defined. If you put all the code into one .ino file, it will compile just fine.

This usually means that the IDE got some function prototypes wrong when it was compiling. All of your .ino files are actually combined into one file, function prototypes are generated and inserted into your code and then it is compiled. It is suppose to help you out so you don’t have to declare all your function prototypes, but occasionally, it gets it wrong.

So if I had a script to combine all the files into one it would compile fine?

you are correct.. by msdos: copy *.ino A0_Testing_Motor_Parameters\A0_Testing_Motor_Parameters.ino It actually failed to compile pointing out the cause of the problem. So it was a real code issue in the ino file.

On further reflection by renaming Testing_Motor_Parameters.ino to A0_Testing_Motor_Parameters.ino so it is the first file in the list fix the problem.

Weird that it worked at all.

Thanks for pointing me in the right direction.

I'm not convinced that combining the .ino files fixed the problem other than purely by chance. The segmentation fault bug is sporadic. It comes and goes without rhyme or reason.

You can get more information about it here: https://github.com/arduino/Arduino/issues/7949

there has been several reoccurrences... notably a couple of times with just one large file.

That is when it was discovered, by chance, that adding a single space character in a comment line or at the end of the file allows it to compile. Just one.

Dana1954: there has been several reoccurrences... notably a couple of times with just one large file.

That is when it was discovered, by chance, that adding a single space character in a comment line or at the end of the file allows it to compile. Just one.

The solution was given in reply #1. Downgrade the board manager and tat problem will not occur again.