Skip to content

Compiler Segmentation fault when using Serial #9194

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
Antares95 opened this issue Sep 4, 2019 · 1 comment
Closed

Compiler Segmentation fault when using Serial #9194

Antares95 opened this issue Sep 4, 2019 · 1 comment
Labels
Type: Duplicate Another item already exists for this topic

Comments

@Antares95
Copy link

Antares95 commented Sep 4, 2019

Compiler Logs:

Arduino:1.8.9 (Windows Store 1.8.21.0) (Windows 10), 开发板:"Arduino/Genuino Uno"

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino\HardwareSerial.cpp: In member function 'availableForWrite':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino\HardwareSerial.cpp:203:1: 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
为开发板 Arduino/Genuino Uno 编译时出错。

在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。

How to reproduce:
Compile this code

void setup() {
Serial.begin(9600);
}

float i = 0;
unsigned long t0 = 0;
void loop() {
i += 1.0;

if (millis() - t0 > 1000) {
Serial.println(i);
t0 = millis();
}
}

Arduino IDE version: 1.8.9(Windows Store 1.8.21.0)

@per1234
Copy link
Collaborator

per1234 commented Sep 4, 2019

Closing as duplicate of #7949

This bug is specific to the 5.4.0-atmel3.6.1-arduino2 version of avr-gcc used by Arduino AVR Boards 1.6.22 and newer.

Here's the traditional workaround:

  1. Tools > Board > Boards Manager
  2. Wait for downloads to finish.
  3. When you move the mouse pointer over "Arduino AVR Boards", you will see a "Select version" dropdown menu appear. Select "1.6.21".
  4. Click "Install".
  5. Wait for installation to finish.
  6. Click "Close".

If you have File > Preferences > Check for updates on startup checked, the Arduino IDE may occasionally notify you that a new version of Arduino AVR Boards is available, you'll need to refrain from updating back to the new Arduino AVR Boards version, otherwise you'll be back to seeing the segmentation fault error again.

@per1234 per1234 closed this as completed Sep 4, 2019
@per1234 per1234 added the Type: Duplicate Another item already exists for this topic label Sep 4, 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