FS#54159 - [avr-gcc] Arduino segfaults when building due avr-gcc

Attached to Project: Community Packages
Opened by Julio (The_Loko) - Monday, 22 May 2017, 22:40 GMT
Last edited by Anatol Pomozov (anatolik) - Sunday, 16 July 2017, 20:24 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Anatol Pomozov (anatolik)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 10
Private No

Details

Description:
Since avr-gcc 7.1.0-1 update, arduino 1:1.8.2-1 fails when building code with avr-gcc segfult and shows this:
signal: segmentation fault (core dumped)
Error building for board Arduino/Genuino Uno.

Additional info:
* package version(s): avr-gcc 7.1.0-1, arduino 1:1.8.2-1
* Backtrace:
#0 0x00007ffa67783137 in __stpcpy_sse2_unaligned () from /usr/lib/libc.so.6
#1 0x00000000004018fb in find_a_file(path_prefix*, char const*, int) ()
#2 0x00000000004016dc in main ()



Steps to reproduce:
- Open Arduino IDE,
- Build any program
This task depends upon

Closed by  Anatol Pomozov (anatolik)
Sunday, 16 July 2017, 20:24 GMT
Reason for closing:  Fixed
Additional comments about closing:  avr-gcc 7.1.0-2
Comment by Fabiano Furtado (fusca) - Thursday, 25 May 2017, 17:43 GMT
Hi... I have the same issue here. Well.. I recompiled the avr-gcc package with the latest gcc snapshot ftp://gcc.gnu.org/pub/gcc/snapshots/7-20170518/ and it worked!

EDITED: Sorry for my mistake. I tested again the package and it did't work. The avr-gcc version 6.3.0 will work fine.
Comment by Doug Newgard (Scimmia) - Saturday, 03 June 2017, 15:18 GMT
Is this on i686? What CPU?
Comment by Julio (The_Loko) - Saturday, 03 June 2017, 16:33 GMT
I only have x86_64 systems, this can be reproduced on all of them.
Comment by Anatol Pomozov (anatolik) - Saturday, 03 June 2017, 17:03 GMT
Are you able to reproduce the problem without arduino tool, i.e. by running a gcc command from command line?
Comment by Anatol Pomozov (anatolik) - Saturday, 03 June 2017, 17:10 GMT
SIGSEGV in find_a_file() makes me believe that it might be the same bug as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80717
Comment by Julio (The_Loko) - Saturday, 10 June 2017, 22:54 GMT
Running avr-gcc without arduino-ide to compile files does't show this issue.
Comment by rodrigo (Rodri) - Monday, 26 June 2017, 20:41 GMT
I had the same issue, failed miserably at downgrading avr-gcc to version 6.3.0 as suggested.

So decided to uninstall all arduino, avr packages as well as gcc related packages. After a system reboot installed arduino package only with its dependencies and worked!

I guess classic windows-style troubleshoot did the trick \o/
Comment by Anatol Pomozov (anatolik) - Wednesday, 05 July 2017, 19:22 GMT
I reverted the suspected upstream change and pushed avr-gcc-7.1.0-2 to [testing]. Please give it a try.
Comment by Forrest Koch (forrest.koch) - Thursday, 06 July 2017, 09:05 GMT
I've posted a workaround to the problem here: https://bbs.archlinux.org/viewtopic.php?pid=1722955#p1722955

It just involves changing a configuration file to use ar instead of avr-gcc-ar.

Although it seems from the above comment that the problem may be fixed soon anyways.
Comment by Julio (The_Loko) - Sunday, 16 July 2017, 18:54 GMT
I can't reproduce this anymore with avr-gcc 7.1.0-2

Loading...