This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
With today's mainline, I get this failure while compiling libstdc++3: /home/Administrator/gcc/mainline/out/gcc/xgcc -shared-libgcc - B/home/Administrator/gcc/mainline/out/gcc/ -nostdinc++ - L/home/Administrator/gcc/mainline/out/i686-pc-cygwin/libstdc++-v3/src - L/home/Administrator/gcc/mainline/out/i686-pc-cygwin/libstdc++-v3/src/.libs - B/usr/local/i686-pc-cygwin/bin/ -B/usr/local/i686-pc-cygwin/lib/ - isystem /usr/local/i686-pc-cygwin/include -isystem /usr/local/i686-pc- cygwin/sys-include -Winvalid-pch -Wno-deprecated -x c++-header -g -O2 - nostdinc++ -I/home/Administrator/gcc/mainline/out/i686-pc-cygwin/libstdc++- v3/include/i686-pc-cygwin -I/home/Administrator/gcc/mainline/out/i686-pc- cygwin/libstdc++-v3/include -I../../../../gcc/libstdc++- v3/libsupc++ /home/Administrator/gcc/mainline/gcc/libstdc++- v3/include/stdc++.h -O2 -g -o ./i686-pc-cygwin/bits/stdc++.h.gch/O2g; /home/Administrator/gcc/mainline/out/i686-pc-cygwin/libstdc++-v3/include/valarra y: In constructor `std::valarray<_Tp>::valarray() [with _Tp = size_t]': /home/Administrator/gcc/mainline/out/i686-pc-cygwin/libstdc++-v3/include/valarra y:245: instantiated from `std::valarray<_Tp>::valarray() [with _Tp = size_t]' /home/Administrator/gcc/mainline/out/i686-pc-cygwin/libstdc++-v3/include/bits/gs lice.h:86: instantiated from here /home/Administrator/gcc/mainline/out/i686-pc-cygwin/libstdc++-v3/include/valarra y:245: 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. Reducing the problem, I have this: $ ./xgcc.exe -O2 -g -x c++-header stc++.ii /home/Administrator/gcc/mainline/gcc/libstdc++-v3/include/stdc++.h:83: 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. This is using the stage 3 compiler (the last built) and the preprocessed source generated from above. I would be interested in seeing if this bug can be reproduced on other platforms. While reducing the command line options, I was sometimes getting this ICE instead: /home/Administrator/gcc/mainline/gcc/libstdc++-v3/include/stdc++.h:84: internal compiler error: in ggc_pop_context, at ggc-page.c:1441 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. hence the summary. It seems like it switches from a standard segmentation fault to this ICE without a sensible reason.
Created an attachment (id=4289) [edit] Preprocessed source
I forgot this, might be useful: $ ./xgcc -v Reading specs from /usr/local/lib/gcc-lib/i686-pc-cygwin/3.4/specs Configured with: ../gcc/configure --program-suffix=-3.4 --enable-languages=c,c++ ,java --enable-threads=posix --enable-sjlj-exceptions --with-system-zlib --enabl e-nls --enable-version-specific-runtime-libs --without-included-gettext --disabl e-shared Thread model: posix gcc version 3.4 20030626 (experimental)
I think this is the same error almost every one is getting see <http://gcc.gnu.org/ml/gcc/2003- 06/msg02270.html> for a patch which looks the most correct one so far but I have little experience with GGC and PCH. Can you try this patch, if it works then it is the same problem as everyone and can be confirmed.
I can compile this on Linux with this gcc from tonight: tmp/gg> ~/tmp/build-gcc/gcc-install/bin/c++ -v Reading specs from /homes/csm2/bangerth/tmp/build-gcc/gcc-install/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.4/specs Configured with: ../gcc/configure --enable-languages=c,c++ --prefix=/ticam/bangerth/tmp/build-gcc/gcc-install --disable-checking Thread model: posix gcc version 3.4 20030626 (experimental) I just get this: tmp/gg> ~/tmp/build-gcc/gcc-install/bin/c++ -O2 -g -x c++-header stc++.ii /usr/lib/crt1.o(.text+0x18): In function `_start': ../sysdeps/i386/elf/start.S:77: undefined reference to `main' collect2: ld returned 1 exit status tmp/gg> ~/tmp/build-gcc/gcc-install/bin/c++ -O2 -g -c -x c++-header stc++.ii W.
Some platforms do not have the problem reported in this bug, I think it does not happen on i686- pc-linux-gnu and powerpc-apple-darwin6.6 at least these are the ones that seems to be able to bootstrap so far.
No, the patch does not help, I get the same segmentation fault. That patch seems to help only on 64bit systems since it replaces an unsigned int with size_t, but on i686-pc-cygwin is no help.
I talked with Ulrich offlist and he believes it's not related. Anybody knows a patch to disable PCH during v3 build? Cygwin bootstrap issues lasts months usually, so I'd rather have a workaround.
Actually I think this was a known problem with cygwin. For some reason cygwin has always had problems with PCH. Here is the patch which disables PCH generation for libstdc++ stolen from someone (I forgot who though, it is in the test-result mailing list): Needs this patch to disable PCH in libstdc++-v3 testsuite --- libstdc++-v3/testsuite_flags.in 26 Apr 2003 04:01:47 -0000 1.17 +++ libstdc++-v3/testsuite_flags.in 7 May 2003 02:37:34 -0000 @@ -43,7 +43,7 @@ echo \${CXX} ;; --build-cxx) - PCHFLAGS="-include bits/stdc++.h" + PCHFLAGS= #"-include bits/stdc++.h" CXX_build="@glibcpp_CXX@ \${PCHFLAGS}" CXX=\`echo "\$CXX_build" | sed 's,gcc/xgcc ,gcc/g++ ,'\` echo \${CXX}
Your patch didn't apply. I installed this: Index: testsuite_flags.in =================================================================== RCS file: /cvsroot/gcc/gcc/libstdc++-v3/scripts/testsuite_flags.in,v retrieving revision 1.1 diff -c -w -r1.1 testsuite_flags.in *** testsuite_flags.in 18 Jun 2003 01:52:08 -0000 1.1 --- testsuite_flags.in 28 Jun 2003 01:40:07 -0000 *************** *** 43,49 **** echo ${CXX} ;; --build-cxx) ! PCHFLAGS="@glibcpp_PCHFLAGS@" CXX_build="@glibcpp_CXX@ ${PCHFLAGS}" CXX=`echo "$CXX_build" | sed 's,gcc/xgcc ,gcc/g++ ,'` echo ${CXX} --- 43,49 ---- echo ${CXX} ;; --build-cxx) ! PCHFLAGS=#"@glibcpp_PCHFLAGS@" CXX_build="@glibcpp_CXX@ ${PCHFLAGS}" CXX=`echo "$CXX_build" | sed 's,gcc/xgcc ,gcc/g++ ,'` echo ${CXX} but I still get the segmentation fault. Besides, isn't this for testsuite only?
Subject: Re: [cygwin] ICE in ggc_pop_context, at ggc-page.c:1441 while compiling libstc++3 Your patch didn't apply. I installed this: Index: testsuite_flags.in =================================================================== RCS file: /cvsroot/gcc/gcc/libstdc++-v3/scripts/testsuite_flags.in,v retrieving revision 1.1 diff -c -w -r1.1 testsuite_flags.in *** testsuite_flags.in 18 Jun 2003 01:52:08 -0000 1.1 --- testsuite_flags.in 28 Jun 2003 01:40:07 -0000 *************** *** 43,49 **** echo ${CXX} ;; --build-cxx) ! PCHFLAGS="@glibcpp_PCHFLAGS@" CXX_build="@glibcpp_CXX@ ${PCHFLAGS}" CXX=`echo "$CXX_build" | sed 's,gcc/xgcc ,gcc/g++ ,'` echo ${CXX} --- 43,49 ---- echo ${CXX} ;; --build-cxx) ! PCHFLAGS=#"@glibcpp_PCHFLAGS@" CXX_build="@glibcpp_CXX@ ${PCHFLAGS}" CXX=`echo "$CXX_build" | sed 's,gcc/xgcc ,gcc/g++ ,'` echo ${CXX} but I still get the segmentation fault. Besides, isn't this for testsuite only?
you are right that only disables for the testsuite, you can disable the gch from creating for the testsuite by switching GLIBCPP_BUILD_PCH_TRUE and GLIBCPP_BUILD_PCH_FALSE around in src/libstdc++-v3/include/Makefile.in, this will disable the creation of the gch but it does not fill the bug which causes the ICE.
Geoff, I'm CC'ing you since this seems to be a PCH bug. Have you seen this failure before? Would reducing the preprocessed file that's ICEing my bootstrapped GCC help fixing the bug?
*** Bug 11360 has been marked as a duplicate of this bug. ***
Andrew, I installed this: Index: Makefile.in =================================================================== RCS file: /cvsroot/gcc/gcc/libstdc++-v3/include/Makefile.in,v retrieving revision 1.76 diff -c -w -r1.76 Makefile.in *** Makefile.in 12 Jun 2003 03:24:14 -0000 1.76 --- Makefile.in 28 Jun 2003 15:56:43 -0000 *************** *** 463,472 **** pch_output_builddir = ${target_builddir}/stdc++.h.gch pch_source = ${glibcpp_srcdir}/include/stdc++.h PCHFLAGS = -Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS) ! @GLIBCPP_BUILD_PCH_TRUE@pch_build = @GLIBCPP_BUILD_PCH_TRUE@${pch_input} ! @GLIBCPP_BUILD_PCH_FALSE@pch_build = ! @GLIBCPP_BUILD_PCH_TRUE@pch_install = @GLIBCPP_BUILD_PCH_TRUE@install-pch ! @GLIBCPP_BUILD_PCH_FALSE@pch_install = # List of all timestamp files. By keeping only one copy of this list, both # CLEANFILES and all-local are kept up-to-date. --- 463,472 ---- pch_output_builddir = ${target_builddir}/stdc++.h.gch pch_source = ${glibcpp_srcdir}/include/stdc++.h PCHFLAGS = -Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS) ! @GLIBCPP_BUILD_PCH_TRUE@pch_build = ! @GLIBCPP_BUILD_PCH_FALSE@pch_build = @GLIBCPP_BUILD_PCH_TRUE@${pch_input} ! @GLIBCPP_BUILD_PCH_TRUE@pch_install = ! @GLIBCPP_BUILD_PCH_FALSE@pch_install = @GLIBCPP_BUILD_PCH_TRUE@install-pch # List of all timestamp files. By keeping only one copy of this list, both # CLEANFILES and all-local are kept up-to-date. and I end up with: make[4]: Entering directory `/home/Administrator/gcc/mainline/out/i686-pc-cygwin /libstdc++-v3/testsuite' Makefile:495: warning: overriding commands for target `check-am' Makefile:408: warning: ignoring old commands for target `check-am' `/home/Administrator/gcc/mainline/out/i686-pc-cygwin/libstdc++-v3/scripts/testsu ite_flags --build-cxx` -DHAVE_CONFIG_H -I. -I../../../../gcc/libstdc++-v3/testsu ite -I.. -nostdinc++ -I/home/Administrator/gcc/mainline/out/i686-pc-cygwin/libst dc++-v3/include/i686-pc-cygwin -I/home/Administrator/gcc/mainline/out/i686-pc-cy gwin/libstdc++-v3/include -I../../../../gcc/libstdc++-v3/libsupc++ -O2 -g -O2 -g -O2 -c ../../../../gcc/libstdc++-v3/testsuite/testsuite_hooks.cc cc1plus: bits/stdc++.h: No such file or directory Still no luck bootstrapping :/
Subject: Re: [cygwin] ICE in ggc_pop_context, at ggc-page.c:1441 while compiling libstc++3 > Date: 28 Jun 2003 02:37:32 -0000 > From: "giovannibajo at libero dot it" <gcc-bugzilla@gcc.gnu.org> > Geoff, I'm CC'ing you since this seems to be a PCH bug. Have you seen this > failure before? Would reducing the preprocessed file that's ICEing my > bootstrapped GCC help fixing the bug? No, I've never seen this before. It's probably specific to Cygwin. I doubt that a reduced testcase would be very interesting. It seems to be a random-memory-corruption bug, and so there's no guarantee that it's actually related to PCH at all; but it's well worth tracking down. I would start by spending some time with the debugger.
Subject: Re: [cygwin] [pch] ICE in ggc_pop_context, at ggc-page.c:1441 while compiling libstc++3 geoffk at geoffk dot org <gcc-bugzilla@gcc.gnu.org> wrote: > No, I've never seen this before. It's probably specific to Cygwin. I > doubt that a reduced testcase would be very interesting. It seems to > be a random-memory-corruption bug, and so there's no guarantee that > it's actually related to PCH at all; but it's well worth tracking > down. I would start by spending some time with the debugger. Geoff, do you have any patch to completely disable PCH during bootstrap? At least that would be a check if it's PCH related or not. If you look in the audit trail of the bug, you will see two different patches that I tried to apply without success. I was thinking it's PCH related because the bug requires the "-x" parameter on the command line to show up. Besides, I was able to bootstrap cygwin with no problems till two weeks ago. Can you think of any patches in this timeframe that might have caused/uncovered this problem? Giovanni Bajo
Subject: Re: [cygwin] [pch] ICE in ggc_pop_context, at ggc-page.c:1441 while compiling libstc++3 > Date: 28 Jun 2003 20:06:33 -0000 > From: "giovannibajo at libero dot it" <gcc-bugzilla@gcc.gnu.org> > ------- Additional Comments From giovannibajo at libero dot it 2003-06-28 20:06 ------- > Subject: Re: [cygwin] [pch] ICE in ggc_pop_context, at ggc-page.c:1441 while compiling libstc++3 > > geoffk at geoffk dot org <gcc-bugzilla@gcc.gnu.org> wrote: > > > No, I've never seen this before. It's probably specific to Cygwin. I > > doubt that a reduced testcase would be very interesting. It seems to > > be a random-memory-corruption bug, and so there's no guarantee that > > it's actually related to PCH at all; but it's well worth tracking > > down. I would start by spending some time with the debugger. > > Geoff, do you have any patch to completely disable PCH during bootstrap? At > least that would be a check if it's PCH related or not. That wouldn't prove that it's really anything to do with PCH. It could be a random memory corruption bug that just happens to only turn up when PCH is in use. > Besides, I was able to bootstrap cygwin with no problems till two weeks ago. > Can you think of any patches in this timeframe that might have > caused/uncovered this problem? No, but it might be interesting to find if there's one patch that caused the problem to appear.
Subject: Re: [cygwin] [pch] ICE in ggc_pop_context, at ggc-page.c:1441 while compiling libstc++3 geoffk at geoffk dot org <gcc-bugzilla@gcc.gnu.org> wrote: >> Geoff, do you have any patch to completely disable PCH during bootstrap? At >> least that would be a check if it's PCH related or not. > > That wouldn't prove that it's really anything to do with PCH. It > could be a random memory corruption bug that just happens to only turn > up when PCH is in use. Ok. I would appreciate a patch anyway since it would let me bootstrap again. Meanwhile, I cannot reduce the testcase properly because of PR11361 coming into my way while reducing it (everytime #line infos are a little screwed). Giovanni Bajo
Subject: RE: [cygwin] ICE in ggc_pop_context, at ggc-page.c:1441 while compiling libstc++3 I just continue over this error with another "make bootstrap". I haven't had time to follow up.
Yes, but if you continue after this error the testsuite shows a lot of failures. I would like a proper fix for this. I'll try to isolate this after PR11361 gets fixed. BTW, I tried with configure --disable-pch but it still uses PCH.
Subject: RE: [cygwin] [pch] ICE in ggc_pop_context, at ggc-page.c:1441 while compiling libstc++3 I use the patch to testsuite.in as well.
For some reason unknown to me, gcc 3.4 cvs HEAD as of Mon Jun 30 19:39:54 GMT 2003 bootstraps... see http://gcc.gnu.org/ml/gcc-testresults/2003-07/msg00021.html Cheers, /ChJ
*** Bug 10935 has been marked as a duplicate of this bug. ***
Still there as of yesterday (20030710).
*** Bug 11324 has been marked as a duplicate of this bug. ***
Does this work now?
Subject: RE: [cygwin] [pch] ICE in ggc_pop_context, at ggc-page.c:1441 while compiling libstc++3 Last time I checked, gcc 3.4 compiled fine with PCH. I've not tried it lately, though. -----Original Message----- From: pinskia at gcc dot gnu dot org [mailto:gcc-bugzilla@gcc.gnu.org] Sent: Sunday, November 09, 2003 5:19 PM To: bmj2001@bellsouth.net Subject: [Bug bootstrap/11341] [cygwin] [pch] ICE in ggc_pop_context, at ggc-page.c:1441 while compiling libstc++3 ------- Additional Comments From pinskia at gcc dot gnu dot org 2003-11-09 23:19 ------- Does this work now? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11341 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
AFAIK, cygwin virtually never works with PCH, which IIRC is because of the fact that PCH hasn't had PIC support properly implemented yet, and PIC is always enabled with Cygwin. On the other hand, a libstdc++ autoconf test verifying that PCH works before using it was put in place quite some time ago, so libstdc++ under cygwin will no longer attempt to use PCH and therefore build correctly. Certainly this particular PR should be closed. There probably should be a different PR asking to implement PCH with PIC though.
Okay Darwin's backend handles PIC just fine, most likely you just want to copy how they do it. Also the same thing for Linux because it also has the same problem now.
Not as serious now.
Also a host bug now.
This is an enchanment for cygwin so moving to 3.5 and noone is working on this.
*** Bug 15316 has been marked as a duplicate of this bug. ***
Fixed by: 2005-03-08 Earl Chew <earl_chew@agilent.com> David Billinghurst <David.Billinghurst@riotinto.com> * config/i386/host-cygwin.c: New file to support precompiled headers on cygwin * config/i386/x-cygwin: Use host-cygwin.c on cygwin host * config.host: Use above files for cygwin host.
*** Bug 26596 has been marked as a duplicate of this bug. ***