Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Internal compiler error: Segmentation fault
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 496

PostPosted: Sat Jan 05, 2013 10:21 pm    Post subject: [SOLVED] Internal compiler error: Segmentation fault Reply with quote

I have been suffering form Internal compiler error: Segmentation faults, Internal error: Segmentation faults and waiting for unfinished jobs errors on a new system build. I can't identify the exact cause of the problem. The system is using the new AMD-FX-8350 processor with 32gigs of 1866 ram. The problem is that almost every package builds fine with the exception of.

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
Code:

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 <http://bugs.gentoo.org/> 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
Code:

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="${EPREFIX}/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
Code:
emerge -ae system
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
Code:
 emerge --resume
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.

TIA....................


Last edited by OldTango on Sun Jan 13, 2013 4:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
Jaglover
Advocate
Advocate


Joined: 29 May 2005
Posts: 4681
Location: Saint Amant, Acadiana

PostPosted: Sat Jan 05, 2013 10:44 pm    Post subject: Reply with quote

The chances are very high you have a faulty memory module. Try removing them one by one and see if the trouble goes away.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
DaggyStyle
Advocate
Advocate


Joined: 22 Mar 2006
Posts: 4941

PostPosted: Sun Jan 06, 2013 6:59 am    Post subject: Reply with quote

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
ProjectFootball
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 496

PostPosted: Sun Jan 13, 2013 3:44 pm    Post subject: Reply with quote

Jaglover wrote:
The chances are very high you have a faulty memory module. Try removing them one by one and see if the trouble goes away.

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................ :D
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 496

PostPosted: Sun Jan 13, 2013 4:06 pm    Post subject: Reply with quote

DaggyStyle wrote:
any specific reason why you are compiling world with -ggdb switch?

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"........... :D
Back to top
View user's profile Send private message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Sun Jan 13, 2013 4:39 pm    Post subject: Reply with quote

OldTango wrote:
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.


and the solution was...?


I've had similar issue. I noticed that you have:

MAKEOPTS="-j9"

The solution here is to compile the program throwing internal compiler errorby 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.
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 496

PostPosted: Sun Jan 13, 2013 6:43 pm    Post subject: Reply with quote

_______0 wrote:
OldTango wrote:
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.


and the solution was...?

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.

Quote:

I've had similar issue. I noticed that you have:

MAKEOPTS="-j9"

The solution here is to compile the program throwing internal compiler errorby 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.

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.
Back to top
View user's profile Send private message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Sun Jan 13, 2013 7:05 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 32088
Location: 56N 3W

PostPosted: Sun Jan 13, 2013 7:29 pm    Post subject: Reply with quote

_______0,

These errors are always hardware related.

Memory, CPU, motherboard and PSU are all suspects.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
OldTango
Guru
Guru


Joined: 21 Feb 2004
Posts: 496

PostPosted: Sun Jan 13, 2013 9:51 pm    Post subject: Reply with quote

_______0 wrote:
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.

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
NeddySeagoon wrote:

These errors are always hardware related.

Memory, CPU, motherboard and PSU are all suspects.

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
Code:
emerge -ave system
later this week just to verify I can build the system packages without error. A good way to test maybe????
Back to top
View user's profile Send private message
Shamus397
Apprentice
Apprentice


Joined: 03 Apr 2005
Posts: 163
Location: Ur-th

PostPosted: Sun Aug 04, 2013 10:50 pm    Post subject: Reply with quote

NeddySeagoon wrote:
_______0,

These errors are always hardware related.

Memory, CPU, motherboard and PSU are all suspects.

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. :)
Back to top
View user's profile Send private message
vexatious
n00b
n00b


Joined: 24 Aug 2010
Posts: 55

PostPosted: Thu Jan 16, 2014 8:55 am    Post subject: Reply with quote

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:
I'm using these CFLAGS as recommended per AMD's official GCC optimization guide with a couple being my choice (msseregparm and mfpmath):
Code:
export CFLAGS="-O2 -pipe -march=native -msse -msse2 -msse3 -msse4a -mno-3dnow -msseregparm -mfpmath=sse -fomit-frame-pointer -fopenmp -mprefer-avx128 -minline-all-stringops -fno-tree-pre -ftree-vectorize -funroll-all-loops -fprefetch-loop-arrays -mtune=bdver2"
# This flag gives "cannot compile executables" error with gcc-4.7.3.
# Didn't happen with gcc-4.7.1=WTH...
#--param prefetch-latency=300


You can also link to AMD's library after downloading by adding this to the CFLAGS:
[code]-L/wherever_you_put_them/acml5.0.0/gfortran64_fma4/lib -lacml[code]:

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.
_________________
Gentoo
Slackware


Last edited by vexatious on Thu Jan 16, 2014 9:42 pm; edited 2 times in total
Back to top
View user's profile Send private message
nlsa8z6zoz7lyih3ap
Guru
Guru


Joined: 25 Sep 2007
Posts: 332
Location: Canada

PostPosted: Thu Jan 16, 2014 4:34 pm    Post subject: Reply with quote

I also have an FX-8350 and initially had lots of hardware problems as recounted in http://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.
(2) CFLAGS="-O2 -march=native -pipe"
(3) MAKEOPTS="-j9 -l16"
(4) EMERGE_DEFAULT_OPTS="--jobs=8 --load-average=16 --keep-going=y --with-bdeps=y --complete-graph"
(5) Water cooler + 3332GB of memory that is fully compatible with both the mob and cpu.

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum