Bug 160718 - g++: Internal error: Segmentation fault (program cc1plus)
g++: Internal error: Segmentation fault (program cc1plus)
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc (Show other bugs)
3.0
x86_64 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-16 16:31 EDT by Ben Barefield
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-06-22 04:56:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
file with bug in it (9.22 KB, application/octet-stream)
2005-06-16 16:33 EDT, Ben Barefield
no flags Details
neccessary file (291 bytes, application/octet-stream)
2005-06-16 16:33 EDT, Ben Barefield
no flags Details
neccessary file (22.50 KB, application/octet-stream)
2005-06-16 16:33 EDT, Ben Barefield
no flags Details
neccessary file (1.39 KB, application/octet-stream)
2005-06-16 16:34 EDT, Ben Barefield
no flags Details
neccessary file (135 bytes, application/octet-stream)
2005-06-16 16:34 EDT, Ben Barefield
no flags Details
neccessary file (2.56 KB, application/octet-stream)
2005-06-16 16:34 EDT, Ben Barefield
no flags Details
neccessary file (170 bytes, application/octet-stream)
2005-06-16 16:35 EDT, Ben Barefield
no flags Details
neccessary file (5.42 KB, application/octet-stream)
2005-06-16 16:35 EDT, Ben Barefield
no flags Details
neccessary file (5.27 KB, application/octet-stream)
2005-06-16 16:35 EDT, Ben Barefield
no flags Details
neccessary file (97 bytes, application/octet-stream)
2005-06-16 16:36 EDT, Ben Barefield
no flags Details
neccessary file (3.68 KB, application/octet-stream)
2005-06-16 16:36 EDT, Ben Barefield
no flags Details
neccessary file (440 bytes, application/octet-stream)
2005-06-16 16:37 EDT, Ben Barefield
no flags Details
requested file (733.71 KB, application/octet-stream)
2005-06-17 13:08 EDT, Ben Barefield
no flags Details
the makefile (703 bytes, application/octet-stream)
2005-06-17 13:09 EDT, Ben Barefield
no flags Details

  None (edit)
Description Ben Barefield 2005-06-16 16:31:52 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

Description of problem:
I checked the other bug with the same error message and it didn't help me.  I get this error message when trying to compile.  I have isolated the line that causes the compiler to crash, but I see no error in the code.  The line that crashes the compiler is line 289 of the attached In_out.cpp.
Attached are the files needed to make the project, and the Makefile.  Use "make data_test.cpp" to compile the right one.

Version-Release number of selected component (if applicable):
gcc version 3.2.3

How reproducible:
Didn't try


Additional info:
Comment 1 Ben Barefield 2005-06-16 16:33:07 EDT
Created attachment 115562 [details]
file with bug in it
Comment 2 Ben Barefield 2005-06-16 16:33:47 EDT
Created attachment 115563 [details]
neccessary file
Comment 3 Ben Barefield 2005-06-16 16:33:57 EDT
Created attachment 115564 [details]
neccessary file
Comment 4 Ben Barefield 2005-06-16 16:34:13 EDT
Created attachment 115565 [details]
neccessary file
Comment 5 Ben Barefield 2005-06-16 16:34:35 EDT
Created attachment 115566 [details]
neccessary file
Comment 6 Ben Barefield 2005-06-16 16:34:59 EDT
Created attachment 115567 [details]
neccessary file
Comment 7 Ben Barefield 2005-06-16 16:35:12 EDT
Created attachment 115568 [details]
neccessary file
Comment 8 Ben Barefield 2005-06-16 16:35:28 EDT
Created attachment 115569 [details]
neccessary file
Comment 9 Ben Barefield 2005-06-16 16:35:50 EDT
Created attachment 115570 [details]
neccessary file
Comment 10 Ben Barefield 2005-06-16 16:36:07 EDT
Created attachment 115571 [details]
neccessary file
Comment 11 Ben Barefield 2005-06-16 16:36:26 EDT
Created attachment 115572 [details]
neccessary file
Comment 12 Ben Barefield 2005-06-16 16:37:16 EDT
Created attachment 115573 [details]
neccessary file
Comment 13 Ben Barefield 2005-06-16 16:38:06 EDT
Sorry for so many files and semi-ugly code.  It is rough and hasn't been touched
up yet.
Comment 14 Jakub Jelinek 2005-06-16 17:00:11 EDT
Please, can you instead:
1) post the full gcc (resp. g++) command line which causes the compiler crash
2) post the error output of that command
3) add -save-temps option to those alreadu used and rerun it
4) the last step creates an .i resp. .ii file, please attach it here
A preprocessed file has the advantage that it is self-contained, therefore
doesn't depend on the exact version of the system headers etc.
You can look at http://gcc.gnu.org/bugs.html for details why is that preferrable.
Thanks.
Comment 15 Ben Barefield 2005-06-16 19:37:33 EDT
"3) add -save-temps option to those alreadu used and rerun it"
add that to what already used?  I'm not sure what you want me to use that flag with.
Comment 16 Jakub Jelinek 2005-06-17 03:05:28 EDT
Say the full command line (as requested in 1) above) is
g++ -g -O2 -fPIC -Wall -march=i686 -msse2 somefile.C
and you get internal compiler error when compiling somefile.C with those options.
Then for 3) you run also
g++ -g -O2 -fPIC -Wall -march=i686 -msse2 somefile.C -save-temps
and attach here somefile.ii it creates.
Comment 17 Ben Barefield 2005-06-17 13:07:57 EDT
The full command line to compile the file that causes the error is:
g++ -g -Wall -c In_out.cpp
and I get the error message:
g++: Internal error: Segmentation fault (program cc1plus)
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.
make: *** [In_out.o] Error 1
(along with some unused variable warnings)
Comment 18 Ben Barefield 2005-06-17 13:08:51 EDT
Created attachment 115619 [details]
requested file
Comment 19 Ben Barefield 2005-06-17 13:09:48 EDT
Created attachment 115620 [details]
the makefile

forgot to attach this last time, this is the makefile I use.
Comment 20 Ben Barefield 2005-06-21 17:15:24 EDT
I would just like to give a small update.  I took pretty much the same code
(changed a litte for Microsoft's scoping) and it compiled fine on Visual C++. 
However, the reason I need it to compile on the Linux is so that I can compare
its results to the results of something else.
Thanks.
Comment 21 Jakub Jelinek 2005-06-22 04:56:45 EDT
The thing that the program is attempting to do (passing ~ 34.5MB argument by
value to Score(AEE, datavar)) requires that the stack is allowed to grow to
at least that size, but the default stack limit in RHEL3 is 8-10MB, see
ulimit -s (are you sure you did not mean to pass that argument by reference?).
Now, the compiler when compiling such program needs approximately the same size
on its stack as well.  The compiler perhaps could detect excessively huge
argument size and use malloc instead of alloca for the temporary array it uses,
but you need bigger stack limit when running the program anyway and passing
> 8MB arguments by value is certainly not something the vast majority of
programs ever does.  So I don't think this is something that needs to be
changed in RHEL3 errata.
Comment 22 Jakub Jelinek 2005-06-22 05:00:04 EDT
Oh, forgot to say, if you compile with ulimit -s 40000 or ulimit -s unlimited,
it will compile just fine.

Note You need to log in before you can comment on or make changes to this bug.