Red Hat Bugzilla – Bug 59731
gcc Segmentation faults compiling a simple program
Last modified: 2007-04-18 12:40:19 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i586)
Description of problem:
gcc cores out when trying to compile simple C code. The
Program below will compile, if the while statment is
take out (you can leave the condition there).
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.put the following code in a .c file:
struct parse *p;
2. gcc <filenme>
Actual Results: filename.c: In function foo:
filename.c:12: Internal error: Segmentation fault.
Please submut full bug report.
See <:http://bugzilla.redhat.com/bugzilla/> for instructions.
Note that this code has been simplified to make
finding the bug easier for you.
Also the code will compile if:
is replace with
Cannot reproduce this with either gcc-2.96-98 nor gcc3-3.0.1-3,
both on the exact example given above (with bad spelling) and after fixing
it so that it can actually compile.
What exact compiler version are you seeing this with and with what exact options?
I just bought the workstation verison of
gcc -v shows me that it's version:
2.96 20000731 (Red Hat Linux 126.96.36.199.98)
I'm trying to compile Apache and got this
segment fault on the first file. I reduced
the that file down the the .c above to make
it easy on you.
There are no options, just type:
gcc <.c filename>
That "while" statement is confusing it and causing
gcc to throw the segmentation fault.
The file won't link, of course, but it's
not even getting near that stage.
If it works for you, which I expect it
would or any C/C++ compiler, then I'm
probably missing something in my installation,
like a shared library. I'm hoping you've
seen similiar problems like this before and
can point me in the right direction, else I
won't be able to do develment work on this
What I was wondering if you really were using parce (with c) once and parse
(with s) the other time.
But as I said, I cannot reproduce this in either case on two different
gcc uses no special libs, just libc, so no missing library could cause this.
Are you actually able to compile anything non-trivial on this box
(say kernel or some other project)?
Random gcc failures in 99.9% cases mean bad hardware (well, maybe more,
I haven't ever seen a non-reproduceable gcc failure which wasn't caused by
Would you mind if I gave you an account on my system
and let you telnet in? I'll set up the test for you
and you can do what you want. I just installed this
system, so there's nothing worth a hacker's time.
I can tell I'm lossing you.
Can you give me a hint?
X is running, the network is running ok too.
Everything seems to be running ok on this
I have the exact same problem when compiling the kernel on my Redhat 7.2
system. It's a pure system - I have not installed any other software packages.
The segmentation fault occurs while compiling "floppy.c".
I'm quite sure it's not a hardware problem for the following reasons:
1) My system is *very* stable (have never been overclocked, everything within
2) I don't have problems with any other software.
3) The error occurs the exact same place every time I try to recompile the
kernel. Hardware errors seem to occur on a semi-random basis, so it seems more
like a software problem to me.
I've tried to find a solution in the errata section, but none of the fixes
there seem to be related to this.
I too get seg faults when compiling the kernel with gcc (2.4.18 in my case)
when I get to the make bzImage stage....
floppy.c: In function `format_interrupt':
floppy.c:2163: Internal error: Segmentation fault.
Same file, same function, same line # each time. Hardware appears to be fine
with everything else though. :( Will attempt with kgcc and see what happens.
I am consistently getting the same segmentation fault error when compiling
ardour, an audio editing/mixing program. Source code is at
http://ardour.sourceforge.net and is downloadable via cvs. The error seems to
happen at various places; see the output of make below:
/root/ardour/libs/gtkmm/src/gtk--/label.h:74: internal error: Segmentation
And on the next run:
In file included from /root/ardour/libs/gtkmm/src/gtk--.h:96,
/root/ardour/libs/gtkmm/src/gtk--/eventbox.h:69: internal error: Segmentation
/usr/include/c++/3.2/bits/stl_list.h: In member function `size_t std::list<_Tp,
_Alloc>::size() const [with _Tp = LADSPA::Info*, _Alloc =
plugin_manager.cc:111: instantiated from here
/usr/include/c++/3.2/bits/stl_list.h:401: internal error: Segmentation fault
This is on a working system, no bad hardware, just upgraded to RH 8.0 from 7.3.
Closing as a compendium of unrelated non-reproducable segvs.