Skip to content

Segmentation fault when compiling with avr-gcc 5.4.0 #9428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DiscordiaBR opened this issue Nov 14, 2019 · 1 comment
Closed

Segmentation fault when compiling with avr-gcc 5.4.0 #9428

DiscordiaBR opened this issue Nov 14, 2019 · 1 comment
Labels
Type: Duplicate Another item already exists for this topic

Comments

@DiscordiaBR
Copy link

DiscordiaBR commented Nov 14, 2019

code bug :

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Placa:"Arduino/Genuino Uno"

In function 'global constructors keyed to 65535_0_testes.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\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avr-gcc returned 1 exit status

compilation terminated.

c:/program files/windowsapps/arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt/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
Erro compilando para a placa Arduino/Genuino Uno

Este relatório teria mais informações com
"Mostrar a saida detalhada durante a compilação"
opção pode ser ativada em "Arquivo -> Preferências"**

FILE:

char a;
String b;
int c;
boolean leituraRealizada = false;

boolean banho[21] = { false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false};
boolean obras[21] = { false,false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false};

byte Qual_Livre(byte NBOX,byte FN);

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.println ("iniciado");

}

void loop() {
  // put your main code here, to run repeatedly:
    while (Serial.available()){
    a = Serial.read();
    b = b + a;
    leituraRealizada = true;
    }
  delay(100);
  if (leituraRealizada){
    Serial.print("codigo lido ");
    Serial.print(b);
    c = Qual_Livre(0,0);
    
    Serial.println(c);
    
    leituraRealizada = false;
    b = "";
  }
  
}
byte Qual_Livre(byte NBOX,byte FN){
  // FN 0 Ler qual Banheiro esta livre.
  // FN 1 Alterar estado do banheiro.
  if (FN == 0){
    byte QL0;
    boolean NF = true;
    QL0 = 1;
    while (NF){
      if(banho[QL0] == false || obras[QL0] == false){
        NF = false;
      }else{
        if (QL0 < 21){
          QL0 + 1;
        }else{
          QL0 = 0;
        }
      }
    }
    return QL0;
  }
  if (FN == 1) {
    if (obras[NBOX]){
      obras[NBOX] = false; 
      return 0;
    }else {
      obras[NBOX] = true;
      return 1;
    }
  }
}
@per1234 per1234 added the Type: Duplicate Another item already exists for this topic label Nov 15, 2019
@per1234
Copy link
Collaborator

per1234 commented Nov 15, 2019

Closing as duplicate of #7949 and #9399

@per1234 per1234 closed this as completed Nov 15, 2019
@per1234 per1234 changed the title BUG Segmentation fault when compiling with avr-gcc 5.4.0 Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Duplicate Another item already exists for this topic
Projects
None yet
Development

No branches or pull requests

2 participants