-
-
Notifications
You must be signed in to change notification settings - Fork 7k
IDE 1.8.6 - SD-Lib "Datalogger" - segmentation fault #7949
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
Comments
A previous "Segmentation fault" issue report: I've also encountered sporadic errors similar to this while using the Arduino AVR Boards 1.6.20x beta releases. I was never able to produce a MCVE. The problem would go away after I restarted my computer. The problem did not occur when the same code was compiled with Arduino AVR Boards 1.6.21. |
I have switched back to version v1.8.5 now. |
I can't say otherwise how it is. v1.8.5 works without errors and 1.8.6 with sporadic errors with this example. I've never had a segmentation error before. Possibly a rare error in the new toolchain version. I'm also not the only one with the segmentation fault problem. https://forum.arduino.cc/index.php?topic=566826.0 Additional question. Why is the variable pathidx not initialized in SD.cpp? |
Confirm. I've also experienced such a sporadic errors with 1.8.6 toolchain. 1.8.5 works great! |
@per1234 I'm investigating the issue by bisecting Atmel patches and vanilla gcc versions. It could take a bit. Reproducing consistently on all OSes with this sketch arduino/ArduinoCore-avr#39 (when that will be fixed I think also this issue could be automatically solved). |
Here's a json ready for testing for all host OS (http://downloads.arduino.cc/packages/package_avr_7.3.0_index.json). It will trigger an update to avr core 1.6.208. The build is based on vanilla gcc since Atmel patches for 5.4.0 break an internal sanity test when finalizing the build (didn't have the time to try to fix it yet). The missing Atmel patches are likely to break or limit support for ATTiny so DON'T USE THIS THING IN PRODUCTION 😄 However, all other boards should be supported ( @matthijskooijman do you still have the mass builder script with all the fancy statistics lying around? It would be cool to have a 4.9.2 vs 5.4.0 vs 7.3.0 😉 EDIT: avr4809 (architecture avrxmega3) support needs Atmel patches, so right now the toolchain is just suitable fol classic ATMegas. |
I have tested ArduinoCore version 1.6.23. |
@facchinm, Nice to see a vanilla gcc. If we can get that to work (possibly with some patches applied upstream), that would totally rock over having to wait for atmel all the time :-) As for the builder script, it's here: https://github.com/matthijskooijman/arduino-mass-builder |
I've just updated the toolchain to Patches here: https://github.com/arduino/toolchain-avr/tree/staging/avr-gcc-patches |
I've been hoping to check whether the new toolchain fixes the segmentation fault but I haven't been able to reproduce that bug even with Arduino AVR Boards 1.6.23, despite compiling multiple sketches that have caused it for me in the past on and off. It's really a pain of a bug. I have been using Arduino AVR Boards 1.6.208 (and now 1.6.209) with no problems since it was published. I'll be sure to report if I discover anything of note. |
I tested the datalogger example with IDE v1.8.8, couldn't provoke a segmentation error. :-) |
Another validation datapoint: I had reported a similar crash with lto, gcc 5.4.0 & Windows in arduino/ArduinoCore-avr#55. @facchinm -- upon retesting with the revised package json with AVR boards 1.6.208 & IDE 1.8.7, I'm happy to report that I no longer observe the compiler crash. As a reference for others, here is the simple testcase I constructed for the bug, using a couple structs and an |
Same here, randomly happens. Since today impossible to compile at all anymore, where I could sporadically compile before |
This version is recommended with Arduino 1.8.8 or newer due to some issues with the new compiler on older versions: arduino/Arduino#7949. Updated AVR-GCC compiler (5.4.0-atmel3.6.1-arduino2) and AVRdude uploader (6.3.0-arduino14) with the latest for the moment. Changed some flags and options into platform.txt. Added support and example sketches for Olimex board eduArdu.
Same problem with V1.8.7 on Windows 10 home edition.
Code:
Might be code-length dependent. I couldn't get it to fail with the Blink sketch, failed about 1 out of 5 with this sketch, and 8/10 on my 3K+ line sketch Just started happening yesterday and today. Not sure why. |
FYI @facchinm & @per1234 -- in case it is helpful to have a very minimal test sketch to reproduce the LTO failure in IDE 1.8.9 w/o any other dependencies, please see: Arduino-LTO-Error. For the benefit of others looking for a solution (without rolling back to an older version):
|
It's been just over a year now. Is anyone officially working on this issue so it can be resolved in the main Arduino toolchain versus the "don't use in production" workarounds? |
Well, guys, I wasn't taken seriously back then. Neither here nor in the Arduino Forum. Can only say uses a current toolchain. |
@mikrocoder Looks like that's changed now - give 1.8.10 a try, and be sure to update your board compilers via the boards manager. |
Fantastic! Arduino IDE 1.8.10 (with Arduino AVR Boards 1.8.1) appears to have resolved the LTO issues I had previously observed in my testcases. @facchinm & the rest of the Arduino team -- thank you very much for the fix! |
Nice. I'm about to test it. What was fixed is unfortunately not in the release note. Although I now use a current toolchain. |
You need to download the latest board package via the boards manager after the install, but it's from the official source now, isn't it? Or does it depend on the alternate source still? |
@MartyMacGyver it's official now; the relevant part of the changelog is here (should backport to avr repo) |
Great news! Thank you. |
Hallo,
I have the following sporadic error. Memory is checked with Memtest and okay.
If I copy the sketch into a new window, no errors will occur.
With the older SD-Lib version of IDE 1.8.5 compiles without errors under the new IDE 1.8.6
Windows 10 64Bit
The text was updated successfully, but these errors were encountered: