U8g2: Segmentation Fault

Created on 5 Jan 2019  路  3Comments  路  Source: olikraus/u8g2

Hi!
I have a segmentation fault with the rev 2.24.3 but not with 2.23.18
The segmentation fault occurs when i use a delay() function.
I tried to use delayMicroseconds() function => segfault disappears
I tried to move de delay() function at a different place in the code => segfault stays

C:\Users\xxx\Documents\Arduino\libraries\U8g2\src\clib\u8g2_setup.c: In function 'u8g2_draw_l90_r0':

C:\Users\xxx\Documents\Arduino\libraries\U8g2\src\clib\u8g2_setup.c:303:1: internal compiler error: Segmentation fault

 }
 ^

Most helpful comment

It's probably https://github.com/arduino/Arduino/issues/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".

Due to a bug, this workaround doesn't work with Arduino IDE 1.8.6, but it will work with any other version of the Arduino IDE.

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.


Alternate workaround:

One of the Arduino developers recently worked on this and has provided a potential fix by updating avr-gcc to 7.3.0. There is a special beta testing hardware package you can install via the Arduino IDE's Boards Manager that has the fix:

  1. (In the Arduino IDE) File > Preferences
  2. In the "Additional Boards Manager URLs" field, enter: http://downloads.arduino.cc/packages/package_avr_7.3.0_index.json
  3. If you already have an additional Boards Manager URL in that field, you can separate multiple URLs with commas or click the button on the right side of the field to open a dialog that allows you to add each on its own line.
  4. Click "OK"
  5. Tools > Board > Boards Manager
  6. Wait for the downloads to finish
  7. Click on "Arduino AVR Boards by Arduino"
  8. Click the "Update" button.
  9. Wait for the update to finish.
  10. Click "Close".

Previous: https://github.com/olikraus/u8g2/issues/701

All 3 comments

It's probably https://github.com/arduino/Arduino/issues/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".

Due to a bug, this workaround doesn't work with Arduino IDE 1.8.6, but it will work with any other version of the Arduino IDE.

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.


Alternate workaround:

One of the Arduino developers recently worked on this and has provided a potential fix by updating avr-gcc to 7.3.0. There is a special beta testing hardware package you can install via the Arduino IDE's Boards Manager that has the fix:

  1. (In the Arduino IDE) File > Preferences
  2. In the "Additional Boards Manager URLs" field, enter: http://downloads.arduino.cc/packages/package_avr_7.3.0_index.json
  3. If you already have an additional Boards Manager URL in that field, you can separate multiple URLs with commas or click the button on the right side of the field to open a dialog that allows you to add each on its own line.
  4. Click "OK"
  5. Tools > Board > Boards Manager
  6. Wait for the downloads to finish
  7. Click on "Arduino AVR Boards by Arduino"
  8. Click the "Update" button.
  9. Wait for the update to finish.
  10. Click "Close".

Previous: https://github.com/olikraus/u8g2/issues/701

Is the problem solved? Can we close this?

no further feedback... closing...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

idreamsi picture idreamsi  路  5Comments

Audio-Rochey picture Audio-Rochey  路  4Comments

Bonnie12 picture Bonnie12  路  6Comments

eimogandolf picture eimogandolf  路  6Comments

mkovero picture mkovero  路  5Comments