FS#41636 - [gcc] /usr/include/features.h:1:0: internal compiler error: Segmentation fault

Attached to Project: Arch Linux
Opened by T (mrTwistedTruth) - Wednesday, 20 August 2014, 14:49 GMT
Last edited by Jan de Groot (JGC) - Friday, 29 August 2014, 09:14 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Allan McRae (Allan)
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
$ gcc main.cpp
In file included from /usr/include/c++/4.9.1/x86_64-unknown-linux-gnu/bits/os_defines.h:39:0,
from /usr/include/c++/4.9.1/x86_64-unknown-linux-gnu/bits/c++config.h:430,
from /usr/include/c++/4.9.1/iostream:38,
from main.cpp:1:
/usr/include/features.h:1:0: internal compiler error: Segmentation fault
/* Copyright (C) 1991-2014 Free Software Foundation, Inc.
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.


Additional info:
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc-4.9.1/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-cloog-backend=isl --disable-isl-version-check --disable-cloog-version-check --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --disable-multilib --disable-werror --enable-checking=release
Thread model: posix
gcc version 4.9.1 (GCC)

This task depends upon

Closed by  Jan de Groot (JGC)
Friday, 29 August 2014, 09:14 GMT
Reason for closing:  Not a bug
Comment by Dave Reisner (falconindy) - Thursday, 21 August 2014, 00:02 GMT
> Please submit a full bug report, with preprocessed source if appropriate.
...could you provide this? There's insufficient info here to replicate the crash.
Comment by T (mrTwistedTruth) - Thursday, 21 August 2014, 20:46 GMT
The main.cpp can be anything, even nothing. This is what makes me think It's something I've not done.
This one was just:

#include <iostream>
using namespace std;

int main()
{

}


I think it used to work before I switched to multilib repo and then back again to gcc-libs. I'm not sure what else you need??
Comment by Allan McRae (Allan) - Thursday, 21 August 2014, 22:06 GMT
Given many packages are built using gcc and C++, it is clear we are not replicating the problem...

Do you still have any multilib packages? pacman -Qs multilib
Comment by Jan de Groot (JGC) - Thursday, 21 August 2014, 22:11 GMT
You're compiling c++ code with gcc and not g++? Still shouldn't segfault though...
Comment by T (mrTwistedTruth) - Saturday, 23 August 2014, 14:52 GMT
No multilib packages left. I did everything it says in the wiki about reverting back. It's the only thing I can think of that caused it though. Compiling with g++ spits out the exact same error. I can't compile anything with either.

Compiling c++ code with makepkg -s gives me a different one I've just noticed.

[twistedtruth] $ makepkg -s
==> Making package: blobwars 1.19-5 (Sat 23 Aug 15:36:58 BST 2014)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found blobwars-1.19.tar.gz
==> Validating source files with md5sums...
blobwars-1.19.tar.gz ... Passed
==> Extracting sources...
-> Extracting blobwars-1.19.tar.gz with bsdtar
==> Removing existing pkg/ directory...
==> Starting build()...
g++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 `sdl-config --cflags` -DVERSION=1.19 -DRELEASE=1 -DUSEPAK=0 -DPAKNAME=\"blobwars.pak\" -DPAKLOCATION=\"/usr/share/games/blobwars/\" -DUNIX -DGAMEPLAYMANUAL=\"/usr/share/doc/blobwars/index.html\" -Wall -DLOCALEDIR=\"/usr/share/locale/\" -DMEDAL_SERVER_HOST=\"www.parallelrealities.co.uk\" -DMEDAL_SERVER_PORT=80 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Werror -Wno-error=unused-result -c src/CAudio.cpp
In file included from src/CAudio.cpp:21:0:
src/headers.h:21:19: fatal error: errno.h: No such file or directory
#include <errno.h>
^
compilation terminated.
makefile:81: recipe for target 'CAudio.o' failed
make: *** [CAudio.o] Error 1
==> ERROR: A failure occurred in build().
Aborting...

=====================================================================

After adding a few directories to $CPATH one by one it eventually gets to the same error.

[twistedtruth] $ makepkg -s
==> Making package: blobwars 1.19-5 (Sat 23 Aug 15:50:15 BST 2014)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found blobwars-1.19.tar.gz
==> Validating source files with md5sums...
blobwars-1.19.tar.gz ... Passed
==> Extracting sources...
-> Extracting blobwars-1.19.tar.gz with bsdtar
==> Removing existing pkg/ directory...
==> Starting build()...
g++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 `sdl-config --cflags` -DVERSION=1.19 -DRELEASE=1 -DUSEPAK=0 -DPAKNAME=\"blobwars.pak\" -DPAKLOCATION=\"/usr/share/games/blobwars/\" -DUNIX -DGAMEPLAYMANUAL=\"/usr/share/doc/blobwars/index.html\" -Wall -DLOCALEDIR=\"/usr/share/locale/\" -DMEDAL_SERVER_HOST=\"www.parallelrealities.co.uk\" -DMEDAL_SERVER_PORT=80 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Werror -Wno-error=unused-result -c src/CAudio.cpp
In file included from /usr/include/c++/4.9.1/x86_64-unknown-linux-gnu/bits/os_defines.h:39:0,
from /usr/include/c++/4.9.1/x86_64-unknown-linux-gnu/bits/c++config.h:430,
from /usr/include/c++/4.9.1/bits/stl_algobase.h:59,
from /usr/include/c++/4.9.1/tr1/cmath:1017,
from /usr/include/c++/4.9.1/tr1/math.h:32,
from src/headers.h:24,
from src/CAudio.cpp:21:
/usr/include/features.h:1:0: internal compiler error: Segmentation fault
/* Copyright (C) 1991-2014 Free Software Foundation, Inc.
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.
makefile:81: recipe for target 'CAudio.o' failed
make: *** [CAudio.o] Error 1
==> ERROR: A failure occurred in build().
Aborting...
Comment by Allan McRae (Allan) - Tuesday, 26 August 2014, 04:50 GMT
Well...

fatal error: errno.h: No such file or directory
#include <errno.h>


That is weird! Do you have a /usr/include/errno.h file?
Comment by T (mrTwistedTruth) - Tuesday, 26 August 2014, 14:29 GMT
No, I just have /usr/include/linux/errno.h, /usr/include/asm/errno.h, /usr/include/asm-generic/errno.h.

But that error went away when I added /usr/include/linux/ to $CPATH. And after adding a few more it gets back to the segfault. I've reinstalled gcc and gcc-libs and still no change
Comment by T (mrTwistedTruth) - Tuesday, 26 August 2014, 14:31 GMT
Oh, I also have /usr/include/err.h
Comment by Allan McRae (Allan) - Tuesday, 26 August 2014, 21:33 GMT
Reinstall glibc.
Comment by Allan McRae (Allan) - Tuesday, 26 August 2014, 21:34 GMT
Also, run "pacman -Qk" and look for packages with missing files.
Comment by T (mrTwistedTruth) - Wednesday, 27 August 2014, 17:14 GMT
Thank you! It was as simple as reinstalling glibc. I thought I'd reinstalled all necessary packages. Also, sorry for wasting your time.

Loading...