I am porting code that compiled on Ubuntu 14.04 to 16.04. I have cloned my git repo, installed dependencies and tried the usual make
command, soon I hit a g++: internal compiler error: Segmentation fault (program cc1plus)
… yet I am not sure where to start to diagnose and resolve this issue.
I will share as much as I can, see if someone can guide me through a resolution.
Ubuntu
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
g++
$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
python
$ python --version
Python 2.7.12
Some environment variables
PYTHON /usr/bin/python2.7
ARCH x86_64
OS Linux
VERSION 4.4.071generic
PLATFORM linux2
HOSTNAME deploy
USER myUser
WUSS_BUILD NO
CCVER gcc
PYLIBDIR build.x86_64-linux2
LIBDIR build.x86_64-linux2
BINDIR build.x86_64-linux2
ODIR build.x86_64-linux2-gcc
STATICLIBDIR build-static.x86_64-linux2
Error
The make
command leads to
+++ Compile mycore/boost_json.cc to build.x86_64-linux2-gcc
g++: internal compiler error: Segmentation fault (program cc1plus) <===
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
mk/makelib2.inc:48: recipe for target 'build.x86_64-linux2-gcc/mycore/boost_json.o' failed
make[1]: *** [build.x86_64-linux2-gcc/mycore/boost_json.o] Error 4
Makefile:152: recipe for target 'make.stage1c' failed
make: *** [make.stage1c] Error 2
The error message seems to be pointing at a g++
compiler error (?)
makelib2.inc:48
$(ODIR)/%.o : %.c
@mkdir -p $(dir $@)
@echo "+++ Compile $< to $(ODIR)"
@$(CC) -MMD -MP -MF $(@:.o=.d) -c -I$(ODIR) $(CFLAGS) $(CFLAGS_$*) -o $@ $<
I realize that this is going to be very difficult to craft a proper question that would lead to getting proper help. So please bear with me and feel free to suggest adding anything that may help. Unfortunately, I can’t share the code.
Update
Going to try upgrade g++
to a more recent version. Following this thread
HERE how to install g++ 7 on Ubuntu
HERE how to install gcc 6 on Ubuntu
I am porting code that compiled on Ubuntu 14.04 to 16.04. I have cloned my git repo, installed dependencies and tried the usual make
command, soon I hit a g++: internal compiler error: Segmentation fault (program cc1plus)
… yet I am not sure where to start to diagnose and resolve this issue.
I will share as much as I can, see if someone can guide me through a resolution.
Ubuntu
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
g++
$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
python
$ python --version
Python 2.7.12
Some environment variables
PYTHON /usr/bin/python2.7
ARCH x86_64
OS Linux
VERSION 4.4.071generic
PLATFORM linux2
HOSTNAME deploy
USER myUser
WUSS_BUILD NO
CCVER gcc
PYLIBDIR build.x86_64-linux2
LIBDIR build.x86_64-linux2
BINDIR build.x86_64-linux2
ODIR build.x86_64-linux2-gcc
STATICLIBDIR build-static.x86_64-linux2
Error
The make
command leads to
+++ Compile mycore/boost_json.cc to build.x86_64-linux2-gcc
g++: internal compiler error: Segmentation fault (program cc1plus) <===
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
mk/makelib2.inc:48: recipe for target 'build.x86_64-linux2-gcc/mycore/boost_json.o' failed
make[1]: *** [build.x86_64-linux2-gcc/mycore/boost_json.o] Error 4
Makefile:152: recipe for target 'make.stage1c' failed
make: *** [make.stage1c] Error 2
The error message seems to be pointing at a g++
compiler error (?)
makelib2.inc:48
$(ODIR)/%.o : %.c
@mkdir -p $(dir $@)
@echo "+++ Compile $< to $(ODIR)"
@$(CC) -MMD -MP -MF $(@:.o=.d) -c -I$(ODIR) $(CFLAGS) $(CFLAGS_$*) -o $@ $<
I realize that this is going to be very difficult to craft a proper question that would lead to getting proper help. So please bear with me and feel free to suggest adding anything that may help. Unfortunately, I can’t share the code.
Update
Going to try upgrade g++
to a more recent version. Following this thread
HERE how to install g++ 7 on Ubuntu
HERE how to install gcc 6 on Ubuntu
c++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
modules/core/CMakeFiles/opencv_core.dir/build.make:138: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/alloc.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/alloc.cpp.o] Error 4
make[2]: *** Waiting for unfinished jobs....
c++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
c++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
c++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
c++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
modules/core/CMakeFiles/opencv_core.dir/build.make:114: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/copy.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/copy.cpp.o] Error 4
modules/core/CMakeFiles/opencv_core.dir/build.make:162: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/opencl/runtime/opencl_clamdfft.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/opencl/runtime/opencl_clamdfft.cpp.o] Error 4
modules/core/CMakeFiles/opencv_core.dir/build.make:186: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/opencl/runtime/opencl_clamdblas.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/opencl/runtime/opencl_clamdblas.cpp.o] Error 4
modules/core/CMakeFiles/opencv_core.dir/build.make:234: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/pca.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/pca.cpp.o] Error 4
c++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
modules/core/CMakeFiles/opencv_core.dir/build.make:258: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/va_intel.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/va_intel.cpp.o] Error 4
c++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
modules/core/CMakeFiles/opencv_core.dir/build.make:210: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/opencl/runtime/opencl_core.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/opencl/runtime/opencl_core.cpp.o] Error 4
c++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
modules/core/CMakeFiles/opencv_core.dir/build.make:90: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/umatrix.cpp.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/umatrix.cpp.o] Error 4
CMakeFiles/Makefile2:1444: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
git clone https://github.com/opencv/opencv.git@3.1.0
cd opencv
mkdir release
cd release
cmake -DPYTHON_INCLUDE_DIRS=/usr/local/include/python3.5m/ -DPYTHON_LIBRARY=/usr/local/lib/libpython3.5m.so -DPYTHON_EXECUTABLE=/path_to_venv/bin/python3.5 ..
make -j 8
Содержание
- Я нашел жука. gcc: internal compiler error: Segmentation fault
- gcc: internal compiler error: Killed (program cc1plus) [Ubuntu12.04] #1803
- Comments
- Я нашел жука. gcc: internal compiler error: Segmentation fault
- Gcc-ICE-reporting-guide
- Содержание
- Quick guide
- Detailed guide
- Steps to track an ICE (internal compiler errors) down
- Check if an ICE is reproducible
- Extract exact command
- Extract self-contained source (use -save-temps)
- Expand -march=native, exact gcc version and other system-specific options
- Report bug on bugs.gentoo.org
- [bonus] minimize needed flags to reproduce failure
- [bonus] minimize self-contained source using cvise
- [bonus] Check if bug still exists on vanilla gcc master
- [bonus] Report bug on gcc.gnu.org/bugzilla
- [bonus] Extract gcc backtrace
- [bonus] Fix gcc bug
- LTO example
- Summary
- Extract exact command
- Minimize responsible objects
- Gcc internal compiler error
Я нашел жука. gcc: internal compiler error: Segmentation fault
Даже не знаю, есть ли в этом вопрос, скорее констатация факта. Вот такой код пораждает ошибку:
Для проверки нужно бы обновить, может уже исправили, да только пока не до этого. Моя текущая версия 10.2.0-5ubuntu1
Поздравляю! Теперь в godbolt свежие версии проверь. Если повторяется, закинь багрепорт.
Хорошо. Только порОждает, от слова рОжать.
рОжать не проверяет «О» т.к. не под ударением. Лучше уж «рОды»
Хорошо. Только порОждает, от слова рОжать.
Ну да, есть такое. Вы уже не первый, кто мне такое сообщает. Это началось еще со школы.
Раньше ты пытался исправлять ошибки, а теперь быть тупым стало модно.
ща обязательно кто-нибудь напишет коммент про rust/go/d.. wait, oh sh….
разве что он имел в виду слово «ражон», а не «роды»
Для проверки нужно бы обновить
Для проверки нужно бы сделать минимальный пример.
ща обязательно кто-нибудь напишет коммент про rust/go/d.. wait, oh sh….
Нет, сейчас интересно посмотреть, как компилятор VS справляется. Я хотел было запустить у себя VS 2015, но там оценочный период закончился, и надо логиниться.
Из командной строки тоже логиниться надо?
Кстати, командно строчный работает. Но во-первых, нужен полный компилируемый пример (в смысле, полный пример с т.з. синтаксиса, компилироваться он не обязан, раз тут крэш тестируется), тот огрызок на годболте gcc 10.2 не крэшит.
разве что он имел в виду слово «ражон», а не «роды»
Источник
gcc: internal compiler error: Killed (program cc1plus) [Ubuntu12.04] #1803
I install Nupic accroding to the instructions of https://github.com/numenta/nupic/wiki/Installing-NuPIC-on-Ubuntu. All steps are successful except the last step of Build Nupic. I show the errors below, and I’m sorry for its length. How to solve the problem?
The text was updated successfully, but these errors were encountered:
A few questions:
- what version of NuPIC are you using? ( git rev-parse HEAD to get the SHA)
- what version of gcc or clang are you using?
- what version of cmake are you using?
/nupic$ git rev-parse HEAD
5001d0e
2.gcc version 4.8.1
clang didn’t install
3.cmake version 2.8.7
I think this relates to #1794. (no it doesn’t)
I saw the relates questions including #1449 , but I still don’t know what shoud I do specificly. I am not good at linux environment. Can you explain in detail?
I don’t know exactly what the problem is yet. I’m going to try to replicate it in a VM today.
@yajingfu Ubuntu 12 comes with gcc 4.6. Did you already have gcc 4.8 installed on your system before attempting to install NuPIC? If not, I assume you installed gcc 4.8 with the instructions on https://github.com/numenta/nupic/wiki/Installing-NuPIC-on-Ubuntu, namely:
(The wiki page is using gcc 4.7, not 4.8, so the commands above are updated.)
If this was not the way you installed gcc 4.8, can you remember how you installed it?
@yajingfu Never mind on my last comment. I just replicated the exact same error you had on Ubuntu following the wiki instructions exactly.
I tried installing gcc 4.9 and got the same error:
@yajingfu I think I figured this out. After reading this post about the same error message, I shut down my Ubuntu VM and changed the settings to give it more Base Memory. I went from 1024MB to 2048MB of Base Memory, tried rebuilding NuPIC and this time it worked!
Can you try this and tell me what happens?
@rhyolight cool detective work! 👍
added mention to the wiki https://github.com/numenta/nupic/wiki/Installing-NuPIC-on-Ubuntu
@rhyolight haha, thank you, I build nupic successfully 🙂
Math library source file generated with SWIG math_wrap.cxx is 5490 KiB size — maybe need to split it.
I can’t compile it not with g++-4.9 not with clang-3.5 on controller Intel Edison with embedded ubilinux and with only 1 GB of memory and without swap.
Another big SWIG generated source file algorithms_wrap.cxx 3060 KiB size — compiled ok.
/edison/nupic# uname -a
Linux ubilinux 3.10.17-yocto-standard-r2 #7 SMP PREEMPT Thu Feb 26 09:57:06 UTC 2015 i686 GNU/Linux
Источник
Я нашел жука. gcc: internal compiler error: Segmentation fault
Даже не знаю, есть ли в этом вопрос, скорее констатация факта. Вот такой код пораждает ошибку:
Для проверки нужно бы обновить, может уже исправили, да только пока не до этого. Моя текущая версия 10.2.0-5ubuntu1
Поздравляю! Теперь в godbolt свежие версии проверь. Если повторяется, закинь багрепорт.
Хорошо. Только порОждает, от слова рОжать.
рОжать не проверяет «О» т.к. не под ударением. Лучше уж «рОды»
Хорошо. Только порОждает, от слова рОжать.
Ну да, есть такое. Вы уже не первый, кто мне такое сообщает. Это началось еще со школы.
Раньше ты пытался исправлять ошибки, а теперь быть тупым стало модно.
ща обязательно кто-нибудь напишет коммент про rust/go/d.. wait, oh sh….
разве что он имел в виду слово «ражон», а не «роды»
Для проверки нужно бы обновить
Для проверки нужно бы сделать минимальный пример.
ща обязательно кто-нибудь напишет коммент про rust/go/d.. wait, oh sh….
Нет, сейчас интересно посмотреть, как компилятор VS справляется. Я хотел было запустить у себя VS 2015, но там оценочный период закончился, и надо логиниться.
Из командной строки тоже логиниться надо?
Кстати, командно строчный работает. Но во-первых, нужен полный компилируемый пример (в смысле, полный пример с т.з. синтаксиса, компилироваться он не обязан, раз тут крэш тестируется), тот огрызок на годболте gcc 10.2 не крэшит.
разве что он имел в виду слово «ражон», а не «роды»
Источник
Gcc-ICE-reporting-guide
If you have gcc crashing when building some Gentoo package with internal compiler error: Segmentation fault , then this page is for you!
To extract useful information from the crash to report a bug requires a few steps. This article lists the steps and provides a few real-world debugging sessions.
Содержание
Quick guide
- Extract self-contained preprocessed file (extracted with -save-temps )
- Verify gcc still crashes when ran on preprocessed file
- Expand -march=native to flags not dependent on your machine
- File a bug on https://bugs.gentoo.org with the following details:
- provide preprocessed file (or minimized file)
- provide gcc -v output
- provide emerge —info
- provide -march=native expansion
- [optional] minimize amount of flags needed to trigger the error
- [optional] minimize self-contained example
- [optional] file a bug on https://gcc.gnu.org/bugzilla
If you don’t know how to all of the above, read on to the below detailed guide!
Detailed guide
Steps to track an ICE (internal compiler errors) down
Check if an ICE is reproducible
Sometimes gcc crashes due to external reasons not directly related to gcc:
- Out-of-memory condition (check dmesg )
- Bad RAM modules (sys-apps/memtest86+)
- Unstable overclock of CPU or RAM
Make sure the above is not your case!
Look at build.log with the ICE and try to resume the build to see if the same command causes the same ICE. Usually the command looks something like make —jobs=8 —load-average=8 CPPFLAGS= CFLAGS= LDFLAGS= .
Go to the Working directory (specified in build.log as well) and rerun the build command.
You should see the exact command and the failure.
Our running example will be an ICE on dev-lang/python-3.6.5 :
The build fails every time LANG=C make is rerun. Yay!
Extract exact command
If the build system already prints exact command, just re-execute it (make sure you are in the correct directory). If the build system does not print the command, you will have to use other methods of getting command like running strace or passing verbose flags manually.
In the case of Python, the command is printed as-is:
Add -save-temps to the gcc command on the previous step to extract a preprocessed sample. foo.c will create foo.i (or foo.ii for c++ ).
Obligatory Python example:
The preprocessed file is in cmathmodule.i now. You can get more tips at https://gcc.gnu.org/bugs/.
Expand -march=native, exact gcc version and other system-specific options
Some compiler options like -march=native are dependent on the environment.
You need to resolve them into exact options. One way to do it is to query gcc for expansion. Pick your arch instead of arch=sandybridge to avoid diff on march= value. That will minimize the diff.
Here -march=native is substituted for -march=sandybridge —param=l1-cache-line-size=64 —param=l1-cache-size=32 —param=l2-cache-size=8192 -maes -mavx . .
Make sure bug is reproducible after substitution as well!
Report bug on bugs.gentoo.org
File a bug at https://bugs.gentoo.org/ against toolchain@gentoo.org and provide a few details:
- gcc -v output
- Attach .i reproducer
[bonus] minimize needed flags to reproduce failure
You can do similar expansion for optimizer options as well: LANG=C gcc -O2 -Q —help=optimizers
To expand -O3 into -O2 + extra , you can use diff -U0
Try to find minimal set of flags needed to trigger the crash by removing some expanded options.
[bonus] minimize self-contained source using cvise
Now to the fun part! Let’s shrink .i down to a manageable size with help of dev-util/cvise.
cmathmodule.i contains the same shrunk example.
You can also pass the tester command directly to cvise without creating a shell script, e.g.:
[bonus] Check if bug still exists on vanilla gcc master
Building gcc locally could look like:
Look at configure options of Gentoo’s gcc -v to get more options to add to defaults. Be careful: some configure options like —enable-default-pie —enable-default-ssp can change code generation enough to trigger or hide a bug.
[bonus] Report bug on gcc.gnu.org/bugzilla
File the bug at https://gcc.gnu.org/bugzilla/ with attached minimal reproducer and gcc -v detals.
Example session would be:
[bonus] Fix gcc bug
By now you have a source tree and a command for how to build it!
A few starting points for you:
LTO example
LTO bugs are harder to track down because there’s an extra step (a few) between the compiler and the final binary.
GCC’s wiki touches on this.
PR105600 is an example of such a GCC bug.
Summary
Extract exact command
In this case, CMake was being used with its Makefile generator, so needed to run make VERBOSE=1 . .
Minimize responsible objects
The failure is in lto1 which by its nature is considering multiple objects. To narrow down the failure, the full command being passed must be considered.
Источник
Gcc internal compiler error
wine-1.5.9
Wine will bail at completely different areas of the build process with internal compiler error: Segmentation fault at some point than continue until a complete bail at waiting for unfinished jobs
gcc-4.5.4
Also bails with internal compiler error: Segmentation fault and waiting for unfinished jobs and the last error is emake failed with bootstrap-lean
binutils-2.22-r1
Bails with x86_64-pc-linux-gnu-g++: Internal error: Segmentation fault than waiting for unfinished jobs
mesa-9.0.1
Bails with
Код: |
In file included from ../../include/GL/gl.h:2085:0, from ../../src/mesa/main/glheader.h:53, from ../../src/mesa/main/mtypes.h:37, from ../../src/glsl/glsl_types.h:31, from ../../src/glsl/ir.h:33, from ../../src/glsl/hir_field_selection.cpp:24: ../../include/GL/glext.h:5:1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. gmake[2]: *** [hir_field_selection.lo] Error 1 gmake[2]: *** Waiting for unfinished jobs. gmake[2]: Leaving directory `/var/tmp/portage/media-libs/mesa-9.0.1/work/Mesa-9.0.1/src/glsl’ gmake[1]: *** [all-recursive] Error 1 |
Info
Код: |
Portage 2.1.11.31 (default/linux/amd64/10.0, gcc-4.5.4, glibc-2.15-r3, 3.5.7-gentoo x86_64) ================================================================= System uname: Linux-3.5.7-gentoo-x86_64-AMD_FX-tm-8350_Eight-Core_Processor-with-gentoo-2.1 Timestamp of tree: Sat, 05 Jan 2013 08:45:01 +0000 ld GNU ld (GNU Binutils) 2.22 app-shells/bash: 4.2_p37 dev-java/java-config: 2.1.11-r3 dev-lang/python: 2.7.3-r2, 3.2.3 dev-util/cmake: 2.8.9 dev-util/pkgconfig: 0.27.1 sys-apps/baselayout: 2.1-r1 sys-apps/openrc: 0.11.8 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.13, 2.69 sys-devel/automake: 1.11.6 sys-devel/binutils: 2.22-r1 sys-devel/gcc: 4.5.4 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82-r4 sys-kernel/linux-headers: 3.6 (virtual/os-headers) sys-libs/glibc: 2.15-r3 Repositories: gentoo sunrise x-portage ACCEPT_KEYWORDS=»amd64″ ACCEPT_LICENSE=»* -@EULA dlj-1.1 PUEL Q3AEULA ut2003 AdobeFlash-10.3 LOKI-EULA teamspeak3″ CBUILD=»x86_64-pc-linux-gnu» CFLAGS=»-march=native -O2 -pipe -ggdb» CHOST=»x86_64-pc-linux-gnu» CONFIG_PROTECT=»/etc /usr/share/gnupg/qualified.txt» CONFIG_PROTECT_MASK=»$/etc/gconf /etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo» CXXFLAGS=»-march=native -O2 -pipe -ggdb» DISTDIR=»/usr/portage/distfiles» FCFLAGS=»-O2 -pipe» FEATURES=»assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch» FFLAGS=»-O2 -pipe» GENTOO_MIRRORS=»ftp://gentoo.mirrors.tds.net/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linx/distributions/gentoo http://mirror.usu.edu/mirrors/gentoo ftp://ftp.gtlib.gatech.edu/pub/gentoo» LANG=»en_US.utf8″ LDFLAGS=»-Wl,-O1 -Wl,—as-needed» MAKEOPTS=»-j9″ PKGDIR=»/usr/portage/packages» PORTAGE_CONFIGROOT=»/» PORTAGE_RSYNC_OPTS=»—recursive —links —safe-links —perms —times —compress —force —whole-file —delete —stats —human-readable —timeout=180 —exclude=/distfiles —exclude=/local —exclude=/packages» PORTAGE_TMPDIR=»/var/tmp» PORTDIR=»/usr/portage» PORTDIR_OVERLAY=»/var/lib/layman/sunrise /usr/local/portage» SYNC=»rsync://MasterTux/gentoo-portage» USE=»X aac aalib acl acpi alsa amd64 artworkextra berkdb bzip2 cairo cdda cddb cdparanoia cdr cleartype cli consolekit cracklib crypt css cups cxx dbus device-mapper dlloaders dri dvd dvdr dvix dvix4linux eds encode esd exif extras faac faad fbcon fbcondecor ffmpeg firefox flac fortran gd gdbm gdu gif gnome gnome-keyring gnutls gpm gstreamer gtk guile iconv imagemagick imlib java jepg2k jpeg lame libnotify libwww lm_sensors mad mikmod mmx mmxext modules mp3 mpeg mudflap multilib nautilus ncurses networking nls nptl nsplugin ntp nvidia ogg openal opengl openmp openxr oss pam pcre pdf png policykit pppd python quicktime readline sdl seamonkey session spell sqlite sqlite3 sse sse2 ssl svg tcpd tiff tng truetype type1 udev unicode usb v4l v4l2 vcd vdpau vorbis wmf xinerama xv xvid zlib» ALSA_CARDS=»emu10k1″ ALSA_PCM_PLUGINS=»adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol» APACHE2_MODULES=»authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias» CALLIGRA_FEATURES=»kexi words flow plan sheets stage tables krita karbon braindump» CAMERAS=»ptp2″ COLLECTD_PLUGINS=»df interface irq load memory rrdtool swap syslog» ELIBC=»glibc» GPSD_PROTOCOLS=»ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx» INPUT_DEVICES=»keyboard mouse evdev» KERNEL=»linux» LCD_DEVICES=»bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text» LIBREOFFICE_EXTENSIONS=»presenter-console presenter-minimizer» LINGUAS=»en» PHP_TARGETS=»php5-3″ PYTHON_SINGLE_TARGET=»python2_7″ PYTHON_TARGETS=»python2_7 python3_2″ RUBY_TARGETS=»ruby18 ruby19″ USERLAND=»GNU» VIDEO_CARDS=»nvidia» XTABLES_ADDONS=»quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account» Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON |
At first I was having hardware problems with incompatible ram and the processor running hotter than I liked. I replaced the ram with compatible modules. Installed water cooling and now temps are well within reason even under heavy loads.
Tried to complete a
in an attempt to solve the waiting for unfinished jobs errors. It went great until it got to binutils where it bailed. That was 154 packages into a 310 system package rebuild. I did a
and binutils bailed again with internal compiler error: Segmentation fault . At that point I aborted the rest of the process.
I am starting to think gcc is having problems with my make.conf or my processor.
I am hoping someone might have some insight into this problem and be able to help me sort it out.
Последний раз редактировалось: OldTango (вс янв 13, 2013 4:09 pm), всего редактировалось 1 раз Вернуться к началу
Jaglover
Watchman
Зарегистрирован: 29 мая 2005
Сообщений: 8291
Откуда: Saint Amant, Acadiana
Добавлено: сб янв 05, 2013 10:44 pm Заголовок сообщения: | |
The chances are very high you have a faulty memory module. Try removing them one by one and see if the trouble goes away. _________________ My Gentoo installation notes. Please learn how to denote units correctly! |
Вернуться к началу
DaggyStyle
Watchman
Зарегистрирован: 22 мар 2006
Сообщений: 5876
Добавлено: вс янв 06, 2013 6:59 am Заголовок сообщения: | |
any specific reason why you are compiling world with -ggdb switch? _________________ Only two things are infinite, the universe and human stupidity and I’m not sure about the former — Albert Einstein |
Вернуться к началу
OldTango
l33t
Зарегистрирован: 21 фев 2004
Сообщений: 712
Добавлено: вс янв 13, 2013 3:44 pm Заголовок сообщения: | ||
Thats what I thought at first and I tested the theory before I posted here. I originally built the system using only 16gigs am ram because that is what I had on hand while I waited for the other 16gigs to arrive. The system built just fine and it wasn’t until I added an additional 16gigs that I started to have these problems. It didn’t seem to matter which modules I would use as long as I was only using 16gigs I didn’t have serious issues. Going to 32gigs introduced consistent errors building packages and always in the same packages. Which is why I started to suspect I was having a problem with gcc. I was in the process of trying to determine which masked version of gcc would be the best version to install when sys-devel/gcc-4.6.3 went stable. I installed the newer version (with fingers crossed)switched over to it and emerged the packages that were consistently failing before. Problem appears to be solved. I no longer get internal compiler error: Segmentation fault or waiting for unfinished jobs with all 32gigs of ram installed. The only package that did fail was app-emulation/wine-1.5.9. It failed with a specific error. I don’t remember the exact error but it did provide insight as to how to solve the problem. Which was to build wine with the -win64 USE flag. Thanks for your advice. |
Вернуться к началу
OldTango
l33t
Зарегистрирован: 21 фев 2004
Сообщений: 712
Добавлено: вс янв 13, 2013 4:06 pm Заголовок сообщения: | ||
That is left over from a very old system build. I reuse my make.config on all new systems and try my best to update it to meet the specific requirements of newer hardware or packages. With portage stripping the debugging information from the builds it isn’t necessary and can be used on a per package instance when it becomes necessary to get backtraces for debugging purposes. Thanks for the catch I will remove it as it isn’t necessary it with «world». |
Вернуться к началу
_______0
Guru
Зарегистрирован: 15 окт 2012
Сообщений: 521
Добавлено: вс янв 13, 2013 4:39 pm Заголовок сообщения: | ||
and the solution was. I’ve had similar issue. I noticed that you have: The solution here is to compile the program throwing internal compiler error by running emerge with MAKEOPTS=»-j1″ . The funny thing is that sometimes the same package goes through others not. My theory is that the processor might be faster than gcc processes speed. Is like gcc can’t keep up with them megahurtz, trips over and throws that error message. |
Вернуться к началу
OldTango
l33t
Зарегистрирован: 21 фев 2004
Сообщений: 712
Добавлено: вс янв 13, 2013 6:43 pm Заголовок сообщения: | ||||||
Upgrading gcc from 4.5.4 to 4.6.3 appears to have solved the problem. It may still be to early to know for sure but so far all packages that failed before now build without any errors.
I also thought the same thing and tried everything form MAKEOPTS=»-j1″ to MAKEOPTS=»-j7″ without success. I may be wrong but from what I understand packages will use what ever is safe or sane regardless of the MAKEOPTS setting. I have two other stable Gentoo systems using the AMD-1090T (server machine) and AMD-1100T (desktop) six core processors and 16gigs of ram each. I have never had these errors on those systems and there using MAKEOPTS=»-j7″ and gcc-4.5.4. The problems started with a new build using the AMD FX-8350 eight core processor and 32 gigs of ram. Still trying to wrap my head around why, but for now the system is stable and working fine. Hardware always seems to develop faster than the software support dose so having the latest and greatest isn’t always better if your not willing to deal with the problems that will ultimately crop up. |
Вернуться к началу
_______0
Guru
Зарегистрирован: 15 окт 2012
Сообщений: 521
Добавлено: вс янв 13, 2013 7:05 pm Заголовок сообщения: | |
internal compiler error: Segmentation fault
do you know by any chance how to get a more verbose output that points to a specific cause for this error? The problem is not isolated to your own set up. |
Вернуться к началу
NeddySeagoon
Administrator
Зарегистрирован: 05 июл 2003
Сообщений: 51836
Откуда: 56N 3W
Добавлено: вс янв 13, 2013 7:29 pm Заголовок сообщения: | |
_______0,
These errors are always hardware related. Memory, CPU, motherboard and PSU are all suspects. Computer users fall into two groups:- |
Вернуться к началу
OldTango
l33t
Зарегистрирован: 21 фев 2004
Сообщений: 712
Добавлено: вс янв 13, 2013 9:51 pm Заголовок сообщения: | ||||
Sorry but I lack sufficient knowledge on how to get more verbose output for this type of error. Its not quite the same as debugging a specific application that builds but than fails and crashes and I haven’t found any documentation yet to help work out what breaks and why. As NeddySeagoon says
I am far from an expert on this, but what I have trouble wrapping my head around is that this always means the hardware is faulty in some way. If I google internal compiler error: Segmentation fault , (the exact error output) I can find 100’s of examples like this one HERE, where compile time CCFLAGS can cause this type of error. Sense I started using GENTOO several years ago I have ran into this error or similar ones at various times on a variety of systems and hardware. Almost always when posting to the forms has someone mentioned that I might have a ram or hardware problem. Certainly good advise and always worth looking into. Even if your ram passes memtest if the bios or chipset doesn’t provide proper support you can expect this type of problem. Just because its new, doesn’t mean it works properly if at all. However I have never solved this type of error on any of my systems by simply changing out hardware. Its always been solved by fixing some bad CCFLAG, make.conf, kernel or bios setting or upgrading to a newer version of a particular application. The challenge is sorting out the exact cause of the error. A long time ago I use to use -O3 in my make.conf. Thinking (in my much younger Gentoo days) that if -O2 optimizations were good than -O3 was even better. I have sense learned that this simply is not the case. The greater level of optimizations often caused certain applications to fail the build process or crash randomly even if they did build. As far as I can tell, except for the CCFLAGS settings used in make.conf all other compile time CCFLAGS are set by gcc, the application or the ebuild itself. Please feel free to correct me if I am mistaken here. For my new system, simply upgrading gcc seems to have solved the problem as the errors vanished after the upgrade. I may be to early to tell for sure as I haven’t had to use the new version of gcc extensively yet. I’ve never been keen on using the amd arch for critical system or world files so I was glad to see a newer version of gcc go stable. I may do an later this week just to verify I can build the system packages without error. A good way to test maybe. |
Вернуться к началу
Shamus397
Apprentice
Зарегистрирован: 03 апр 2005
Сообщений: 218
Откуда: Ur-th
Добавлено: вс авг 04, 2013 10:50 pm Заголовок сообщения: | ||
Not so fast! Maybe 99% of the time that error is hardware related, but that last 1% is real, and I had it bite me when trying to update my hardened server. Look at this bug if you’re doubtful. |
Вернуться к началу
vexatious
Tux’s lil’ helper
Зарегистрирован: 24 авг 2010
Сообщений: 84
Добавлено: чт янв 16, 2014 8:55 am Заголовок сообщения: | ||
I know it’s late but thought I’d post here just in case.
I had the exact same problem and it wasn’t hardware related! I’m using the same kind of hardware too (FX 6300 6 core AMD cpu and two sticks of 1866 ram) with -j7 and compiling in 12GB of RAM. I got random segmentation faults at different areas with the same packages the OP mentioned including others. I solved the problem switching to gcc-4.8.1 in my Slackware 14.0 64 install (non-multilib). I don’t seem to have problems using GCC-4.8.1 in gentoo either (but there’s too many leftovers from previous GCC versions I think). I have a bootstrapped slackware 64 install with gcc-4.8.1 (all packages compiled and re-installed with custom CFLAGS in three passes ala emerge -e world 3 times). When I used gcc-4.7.x, I got segmentation faults at random while building gcc. However, after building and using gcc-4.8.1 they’re completely gone! I successfully re-built my toolchain (rebuild-reinstall binutils, gcc-4.8.1, libtool, m4, glibc, zlib, mpfr, and others) more than 5 times with absolutely no errors whatsoever, after switching to GCC-4.8.1. I also compile in ram using 12GB of ramspace (have a total of 16GB) and have overloaded this space with no errors since using gcc-4.8.1. I solved my problem switching to GCC-4.8.1 on my piledriver FX-6300 CPU with 16GB of ram. I’m using a gigabyte motherboard with iommu enabled (iommu=pt at boot but not all the time). I hope you try gcc-4.8.1 first before swapping hardware and giving yourself a headache. As a note. You should use linpack to fill up your RAM and overload your CPU for stability check. This is the best tool for stability testing and I’ve found that even mild overclocking can cause errors whereas normal compiling does not. If you get no errors with linpack, then problems should be over 99% software related (besides graphic and sound hardware anyway). Best of luck and kind regards! EDIT:
You can also link to AMD’s library after downloading by adding this to the CFLAGS: System is suprisingly stable despite unrolling all loops. Only a couple packages don’t like loop unrolling and/or need fPIC. Playing emulators with a 300hz timer and a very small sound buffer (alsa) gives no lag; you get better throughput without high resolution timer as well. If you use msseregparm, everything needs to be compiled with it (even the kernel and modules). Also found my system more responsive with SMTP scheduler support disabled, and only Multi-core scheduler support enabled. Hope this helps. Последний раз редактировалось: vexatious (чт янв 16, 2014 9:42 pm), всего редактировалось 2 раз(а) |
Вернуться к началу
nlsa8z6zoz7lyih3ap
Guru
Зарегистрирован: 25 сен 2007
Сообщений: 388
Откуда: Canada
Добавлено: чт янв 16, 2014 4:34 pm Заголовок сообщения: | |
I also have an FX-8350 and initially had lots of hardware problems as recounted in https://forums.gentoo.org/viewtopic-p-7283404-highlight-.html#7283404 (I had thought that my 32gb memory was approved but it turned out that it was approved only if I used just 16gb of it . For the record I now never have any segfaults. Here is the way in which I run it. (1) Overclocked to just under 4.4GHZ using the mob’s «autotune» overclock feature. The discussion of memory-mob-cpu compatibility in the topic indicated above contains some surprising subtleties. This system is now rock solid stable despite the fact that I often run it for days at a time with between 6 to 8 of its cores at 100%, running my own programs. |
Вернуться к началу
Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете голосовать в опросах
Copyright 2001-2023 Gentoo Foundation, Inc. Designed by Kyle Manna © 2003; Style derived from original subSilver theme. | Hosting by Gossamer Threads Inc. © | Powered by phpBB 2.0.23-gentoo-p11 © 2001, 2002 phpBB Group
Privacy Policy
Источник
Adblock
detector
View previous topic :: View next topic | |||||||||||||
Author | Message | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
OldTango l33t Joined: 21 Feb 2004 |
|
||||||||||||
Back to top |
|
||||||||||||
Jaglover Watchman Joined: 29 May 2005 |
|
||||||||||||
Back to top |
|
||||||||||||
DaggyStyle Watchman Joined: 22 Mar 2006 |
|
||||||||||||
Back to top |
|
||||||||||||
OldTango l33t Joined: 21 Feb 2004 |
|
||||||||||||
Back to top |
|
||||||||||||
OldTango l33t Joined: 21 Feb 2004 |
|
||||||||||||
Back to top |
|
||||||||||||
_______0 Guru Joined: 15 Oct 2012 |
|
||||||||||||
Back to top |
|
||||||||||||
OldTango l33t Joined: 21 Feb 2004 |
|
||||||||||||
Back to top |
|
||||||||||||
_______0 Guru Joined: 15 Oct 2012 |
|
||||||||||||
Back to top |
|
||||||||||||
NeddySeagoon Administrator Joined: 05 Jul 2003 |
|
||||||||||||
Back to top |
|
||||||||||||
OldTango l33t Joined: 21 Feb 2004 |
|
||||||||||||
Back to top |
|
||||||||||||
Shamus397 Apprentice Joined: 03 Apr 2005 |
|
||||||||||||
Back to top |
|
||||||||||||
vexatious Tux’s lil’ helper Joined: 24 Aug 2010 |
|
||||||||||||
Back to top |
|
||||||||||||
nlsa8z6zoz7lyih3ap Guru Joined: 25 Sep 2007 |
|
||||||||||||
Back to top |
|
||||||||||||
|
You cannot post new topics in this forum |
Recently I have been re-organizing and re-compiling all third-party dependencies of NebulaGraph, an open-source distributed graph database. And I have come across two interesting issues and would like to share with you.
Flex Segmentation Fault——Segmentation fault (core dumped)
Segmentation fault happened upon compiling Flex:
make[2]: Entering directory '/home/dutor/flex-2.6.4/src'
./stage1flex -o stage1scan.c ./scan.l
make[2]: *** [Makefile:1696: stage1scan.c] Segmentation fault (core dumped)
Check coredump with gdb:
Core was generated by `./stage1flex -o stage1scan.c ./scan.l'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 flexinit (argc=4, argv=0x7ffd25bea718) at main.c:976
976 action_array[0] = '';
(gdb) disas
Dump of assembler code for function flexinit:
0x0000556c1b1ae040 <+0>: push %r15
0x0000556c1b1ae042 <+2>: lea 0x140fd(%rip),%rax # 0x556c1b1c2146
...
0x0000556c1b1ae20f <+463>: callq 0x556c1b1af460 <allocate_array> # Allocate buffer
...
=> 0x0000556c1b1ae24f <+527>: movb $0x0,(%rax) # Write to buffer[0], failed due to illegal address
...
(gdb) disas allocate_array
Dump of assembler code for function allocate_array:
0x0000556c1b1af460 <+0>: sub $0x8,%rsp
0x0000556c1b1af464 <+4>: mov %rsi,%rdx
0x0000556c1b1af467 <+7>: xor %eax,%eax
0x0000556c1b1af469 <+9>: movslq %edi,%rsi
0x0000556c1b1af46c <+12>: xor %edi,%edi
0x0000556c1b1af46e <+14>: callq 0x556c1b19a100 <reallocarray@plt> # Allocate buffer
0x0000556c1b1af473 <+19>: test %eax,%eax # Check if the result pointer is NULL
0x0000556c1b1af475 <+21>: je 0x556c1b1af47e <allocate_array+30># Jump to error handler if NULL
0x0000556c1b1af477 <+23>: cltq # Extend eax to rax, truncated
0x0000556c1b1af479 <+25>: add $0x8,%rsp
0x0000556c1b1af47d <+29>: retq
...
End of assembler dump.
We can see from the assembly code above that the issue was caused by the allocate_array
function. reallocarray
returned a pointer, which should be saved in the 64-bit register rax
. However, allocate_array
called reallocarray
and returned the 32-bit register eax
. Meanwhile it used instruction cltq
to extend eax
to rax
.
The possible reason could be that the prototype of reallocarray
that allocate_array
saw was different than the real prototype.
When looking at the compiling log, I did find such a warning, like _implicit declaration of function_ _reallocarray'_
.
This issue can be resolved by adding CFLAGS=-D_GNU_SOURCE
at the configure stage.
Please note that this issue is not supposed to appear every time. However, enabling compiling/link option -pie
and core parameter kernel.randomize_va_space
helps produce the issue.
Takeaways:
- The return type of an implicit declarative function is
int
in C - Pay attention to compiler warnings with
-Wall
and-Wextra
enabled. Better enable-Werror
under development mode.
GCC Illegal Instruction——internal compiler error: Illegal instruction
A while ago I have received feedback from NebulaGraph users that they encountered a compiler error: illegal instruction. See the details in this pull request: https://github.com/vesoft-inc/nebula/issues/978.
Below is the error message:
Scanning dependencies of target base_obj_gch
[ 0%] Generating Base.h.gch
In file included from /opt/nebula/gcc/include/c++/8.2.0/chrono:40,
from /opt/nebula/gcc/include/c++/8.2.0/thread:38,
from /home/zkzy/nebula/nebula/src/common/base/Base.h:15:
/opt/nebula/gcc/include/c++/8.2.0/limits:1599:7: internal compiler error: Illegal instruction
min() _GLIBCXX_USE_NOEXCEPT { return FLT_MIN; }
^~~
0xb48c5f crash_signal
../.././gcc/toplev.c:325
Please submit a full bug report,
with preprocessed source if appropriate.
Since it’s an _internal compiler error_, my assumption would be that an illegal instruction was encountered in g++ itself. To locate the specific illegal instruction set and the component it belongs to, we need to reproduce the error.
Luckily, the code snippet below can do the magic:
#include <thread>
int main()
{
return 0;
}
Illegal instruction is sure to trigger SIGIL. Since g++ acts only as the entrance of the compiler, the real compiler is cc1plus.
We can use gdb to perform the compiling process and catch the illegal instruction on spot:
$ gdb --args /opt/nebula/gcc/bin/g++ test.cpp
gdb> set follow-fork-mode child
gdb> run
Starting program: /opt/nebula/gcc/bin/g++ test.cpp
[New process 31172]
process 31172 is executing new program: /opt/nebula/gcc/libexec/gcc/x86_64-pc-linux-gnu/8.2.0/cc1plus
Thread 2.1 "cc1plus" received signal SIGILL, Illegal instruction.
[Switching to process 31172]
0x00000000013aa0fb in __gmpn_mul_1 ()
gdb> disas
...
0x00000000013aa086 <+38>: mulx (%rsi),%r10,%r8
...
Bingo!
mulx
belongs to BMI2 instruction set and the CPU of the machine in error doesn’t support this instruction set.
After a thorough investigation, I found that it was GMP, which is one of GCC’s dependencies, that introduced this instruction set. By default, GMP would detect the CPU type of the host machine at the configure stage to make use of the most recent instruction sets, which improves performance while sacrificing the portability of the binary.
To solve the issue, you can try to override two files in the GMP source tree, i.e. _config.guess_ and _config.sub_ with _configfsf.guess_ and _configfsf.sub_ respectively before configure
.
Conclusion
- GCC won’t adopt new instruction set due to compatibility issue by default.
- To balance compatibility and performance, you need to do some extra work. For example, select and bind a specific instance for gllibc when it is running.
Finally, if you are interested in compiling the source code of NebulaGraph, please refer to the instructions here
You might also like
- Automating Your Project Processes with Github Actions
- Dev Log | How to Release jar Package to the Maven Central Repository
Recommended Answers
A segmentation fault is normally a memory error, access to an invalid or NULL address. Basically your compiler has crashed compiling your code. This does not necessarily mean there is any error in the code, there could be an bug in the compiler.
Common fixes would be
- Use a new …
Jump to Post
Use a new version of the compiler with the bug fixed
I suggest this one, because ideally a compiler shouldn’t crash no matter what you feed it.
Jump to Post
All 7 Replies
Banfa
597
Posting Pro
Featured Poster
10 Years Ago
A segmentation fault is normally a memory error, access to an invalid or NULL address. Basically your compiler has crashed compiling your code. This does not necessarily mean there is any error in the code, there could be an bug in the compiler.
Common fixes would be
- Use a new version of the compiler with the bug fixed
- Restructure your code so it doesn’t produce the fault
Tumlee
42
Junior Poster in Training
10 Years Ago
Use a new version of the compiler with the bug fixed
I suggest this one, because ideally a compiler shouldn’t crash no matter what you feed it.
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
10 Years Ago
I suggest this one, because ideally a compiler shouldn’t crash no matter what you feed it.
Compilers often have bugs just like any other program. I’ve even had earlier versions of Microsoft compilers crash on me for internal compiler errors.
mike_2000_17
2,669
21st Century Viking
Team Colleague
Featured Poster
10 Years Ago
This happened to me a couple of times before, usually after switching to an experimental version of GCC from the svn development branch. Switching to a stable release or a newer version should fix the problem. This is definitely a problem with the compiler (GCC is usually pretty bug-free, but once in a while, shit happens).
10 Years Ago
Yes, I will try with the latest compiler. Thanks for all of your suggestions.
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
10 Years Ago
If you can post your code that broke the compiler here, it may be illustrative. Usually something weird in the code will cause this sort of problem, although I have broken many compilers with perfectly legal code. In some of those cases I had to rattle cages at the top of the company’s engineering heap (VP of engineering for HP, Sun, and DEC come to mind) to get the appropriate attention paid to the problem. Since these problems also jeopardized delivery of software their own companies needed to build their latest manufacturing facilities, usually I was able to get some pretty prompt service…
10 Years Ago
In case you plan to submit a bug report, check out the GCC Bugs page.
Reply to this topic
Be a part of the DaniWeb community
We’re a friendly, industry-focused community of developers, IT pros, digital marketers,
and technology enthusiasts meeting, networking, learning, and sharing knowledge.
You’re getting a compiler error. It happens in strange parts of code that really shouldn’t be having a problem. The error looks something like:
C:Program FilesWindowsAppsArduinoLLC.ArduinoIDE_1.8.15.0_x86__mdqgnx93n4wtthardwarearduinoavrcoresarduinoHardwareSerial.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 FilesWindowsAppsArduinoLLC.ArduinoIDE_1.8.15.0_x86__mdqgnx93n4wtthardwaretoolsavr/bin/avr-gcc returned 1 exit status
compilation terminated.
c:/program files/windowsapps/arduinollc.arduinoide_1.8.15.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
What is it, and how do you fix it?
asked Dec 5, 2018 at 0:23
1
This is a known fault with the compiler in Windows. The annoying thing is that it’s the version of the compiler that is included in the Windows Store App version of the Arduino IDE.
It also snuck into the Windows version of the IDE from version 1.8.6 from the Arduino.cc website, with the bundled version of the Arduino AVR core.
There are numerous Github issues open for the problem and navigating the tangled web of them is a bit of a chore, but this one seems to be the most promising for digging into the root cause:
- AVR core 1.6.22 (IDE 1.8.6) crashes avr-gcc compiler (5.4.0) when F() string is assigned to a static variable
The simplest fix is to downgrade your compiler to 4.9.2. This can be done by using the Boards Manager to install version 1.6.21 of the Arduino AVR Boards. This should give you compiler version 4.9.2-atmel3.5.4-arduino2
which doesn’t suffer from the problem.
3
I’ve been having this kind of error off and on lately for no apparent reason. What eliminated it for me was going into the IDE preferences and changing compiler output to verbose and also show all warnings. What??? I know it’s crazy. I was just trying to get more information about the error, but I haven’t gotten it since. And I was getting it a lot before.
1
Sometimes it seems like I have to reboot my PC, as exiting from Arduino and rerunning still doesn’t always allow me to compile again.
«changing compiler output to verbose and also show all warnings»
This worked for me too.
I put back the settings to its default state again, after a restart and compile. It worked. Not sure whats under this?