Bug 35696 - Segmentation fault
Summary: Segmentation fault
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.1.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-25 20:43 UTC by Jonathan Sprinkle
Modified: 2012-02-02 18:37 UTC (History)
2 users (show)

See Also:
Host:
Target: i486-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Output from the preprocessor, requested in attachment (209.80 KB, application/x-gzip)
2008-03-25 20:45 UTC, Jonathan Sprinkle
Details
Preprocessed file created by seg fault (247.24 KB, text/plain)
2008-07-18 20:00 UTC, Sam Hendley
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Sprinkle 2008-03-25 20:43:17 UTC
/usr/bin/c++   -g -D_DEBUG -fprofile-arcs -ftest-coverage -I/home/dimble/svn/trunk/ece473-573/dgc-ece473-573/src/libs -I/opt/Ice-3.2.0/include -I/home/dimble/svn/trunk/ece473-573/dgc-ece473-573/build/src/interfaces/cpp -I/opt/orca2-dgc/include -I/home/dimble/svn/trunk/ece473-573/dgc-ece473-573/src/components/dgclocalnav   -DPROJECT_VERSION=\"testing\" -fno-stack-protector -Wall -o src/components/dgclocalnav/CMakeFiles/DgcLocalNavSources.dir/mainloop.o -c /home/dimble/svn/trunk/ece473-573/dgc-ece473-573/src/components/dgclocalnav/mainloop.cpp


/home/dimble/svn/trunk/ece473-573/dgc-ece473-573/src/components/dgclocalnav/mainloop.cpp: In function ‘(static initializers for /home/dimble/svn/trunk/ece473-573/dgc-ece473-573/src/components/dgclocalnav/mainloop.cpp)’:
/home/dimble/svn/trunk/ece473-573/dgc-ece473-573/src/components/dgclocalnav/mainloop.cpp:959: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.
Preprocessed source stored into /tmp/ccWXBOsD.out file, please attach this to your bugreport.
Comment 1 Jonathan Sprinkle 2008-03-25 20:45:35 UTC
Created attachment 15375 [details]
Output from the preprocessor, requested in attachment
Comment 2 Andrew Pinski 2008-03-25 20:52:52 UTC
I think this is a dup of bug 32197.
Comment 3 Jonathan Sprinkle 2008-03-25 22:24:34 UTC
(In reply to comment #2)
> I think this is a dup of bug 32197.
> 

After this ping, I tried on the same machine, with gcov off, and it worked. However, it also worked by not using ccache (it seems that on this machine, CC and CXX are environment variables mapping to ccache). Perhaps that is the real issue? If I set
 unset CC
 unset CXX
 cd build
 rm -rf *
 cmake .. && make

Then I achieve success, even with gcov enabled...
Comment 4 Sam Hendley 2008-07-18 20:00:52 UTC
Created attachment 15929 [details]
Preprocessed file created by seg fault
Comment 5 Sam Hendley 2008-07-21 13:51:04 UTC
Hello, I would like to report that I have had the same type of issue. I run into this issue only when compiling with the coverage flags turned on. Here is the output (inlcuding the location and version of g++):

Compiling PositionEstimator.cpp with g++ (for coverage)
which g++
/usr/bin/g++
g++  --version
g++ (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g++  -Wall -Wextra -g -O0 -I ../Astro -I /home/sam/dnp/External/tools/boost_1_35_0 -I ../DNPStack -I ../External/TrackerLib -I ../External/TrackerLib/leastsquares -I ../External/quat -I includes -I ../ETracker -pg -fprofile-arcs -ftest-coverage -D PSI_CYGWIN -fprofile-arcs -ftest-coverage -c PositionEstimator.cpp -MD -o  Linux_i686/PositionEstimator.o -save-temps
PositionEstimator.cpp: In function ‘(static initializers for PositionEstimator.cpp)’:
PositionEstimator.cpp:47: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.
Preprocessed source stored into /tmp/ccWZm8Cl.out file, please attach this to your bugreport.


Whats really strange about this error is that a tiny source update resolves the problem for that file but causes a previously fine file to have a similar issue. If I move the call to "FloatEqual" out of the if block it works without a problem. Also if I remove the -fstack-protector flags it works as well. So I'm pretty sure it has to do with the -fstack-protector flag. However if I add the -fno-stack-protector flag the same sort of problem can pop up in a totally different file. I had this same problem with a previous file and adding a single new line into the file fixed the compilation.
Comment 6 Andrew Pinski 2012-02-02 18:37:07 UTC
The testcase in comment #1 works for me with 4.3 and 4.4