Bug 160718 - g++: Internal error: Segmentation fault (program cc1plus)
Summary: g++: Internal error: Segmentation fault (program cc1plus)
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc
Version: 3.0
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-06-16 20:31 UTC by Ben Barefield
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-06-22 08:56:45 UTC
Target Upstream Version:
Embargoed:


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

Description Ben Barefield 2005-06-16 20:31:52 UTC
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 20:33:07 UTC
Created attachment 115562 [details]
file with bug in it

Comment 2 Ben Barefield 2005-06-16 20:33:47 UTC
Created attachment 115563 [details]
neccessary file

Comment 3 Ben Barefield 2005-06-16 20:33:57 UTC
Created attachment 115564 [details]
neccessary file

Comment 4 Ben Barefield 2005-06-16 20:34:13 UTC
Created attachment 115565 [details]
neccessary file

Comment 5 Ben Barefield 2005-06-16 20:34:35 UTC
Created attachment 115566 [details]
neccessary file

Comment 6 Ben Barefield 2005-06-16 20:34:59 UTC
Created attachment 115567 [details]
neccessary file

Comment 7 Ben Barefield 2005-06-16 20:35:12 UTC
Created attachment 115568 [details]
neccessary file

Comment 8 Ben Barefield 2005-06-16 20:35:28 UTC
Created attachment 115569 [details]
neccessary file

Comment 9 Ben Barefield 2005-06-16 20:35:50 UTC
Created attachment 115570 [details]
neccessary file

Comment 10 Ben Barefield 2005-06-16 20:36:07 UTC
Created attachment 115571 [details]
neccessary file

Comment 11 Ben Barefield 2005-06-16 20:36:26 UTC
Created attachment 115572 [details]
neccessary file

Comment 12 Ben Barefield 2005-06-16 20:37:16 UTC
Created attachment 115573 [details]
neccessary file

Comment 13 Ben Barefield 2005-06-16 20:38:06 UTC
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 21:00:11 UTC
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 23:37:33 UTC
"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 07:05:28 UTC
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 17:07:57 UTC
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 17:08:51 UTC
Created attachment 115619 [details]
requested file

Comment 19 Ben Barefield 2005-06-17 17:09:48 UTC
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 21:15:24 UTC
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 08:56:45 UTC
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 09:00:04 UTC
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.