Summary: | [3.4/ICE] gcc bombs in sweep_string_variable with ssp | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Mark <mark.morschhaeuser> |
Component: | [OLD] Library | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | basic, castan.o, charlie, chris, christian.korff, dennis.freise, dragonheart, durchanek, eibarbu, exio82, gentoobox, hardened, hellfire3k, howard_b_golden, hramrach, hurikhan77+bgo, jason.b.phillips, jedsen, jiri.pittner, juergennagel, kfm, kumba, Manfred.Kroehnert, matthias.kaeser, mcrawford, nicolas-laplante, nihilist84, only_bugzilla_automail.era.ssokolow, powerman-asdf, raggae, simons, social-gentoobugzilla, storri, tetromino, vladimir.dolzhenko, ybdragon |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Preprocessed source leading to internal compiler error
Pre-processed code causing an ICE with i686-pc-linux-gnu-3.4.4 preprocessed.c++.bz2 Avoid sweep string variable ICE; issue a warning when it occurs preprocessed source that fails to compile another failed source Reduced testcase |
Description
Mark
2004-12-15 01:23:43 UTC
I have the problem if using gcc-3.3.3. I only did 'gcc-config 2' (2=gcc-3.4.3) and 'source /etc/profile' and it compiled fine even with CFLAGS="-O3 -march=athlon-xp -mfpmath=sse -mmmx -msse -mno-sse2 -mno-sse3 -m3dnow -funroll-loops -fomit-frame-pointer -pipe". I have the same error, but only with hardened gcc-3.4.3 (vanilla gcc-3.4.3 works fine) and CFLAGS="-march=athlon-xp -O2 -pipe -frename-registers -fomit-frame-pointer ". *** Bug 76466 has been marked as a duplicate of this bug. *** *** Bug 77752 has been marked as a duplicate of this bug. *** *** Bug 94229 has been marked as a duplicate of this bug. *** *** Bug 81191 has been marked as a duplicate of this bug. *** *** Bug 97166 has been marked as a duplicate of this bug. *** I'm getting the same internal compiler error when compiling net-libs/libtorrent-0.7.1 using gcc (GCC) 3.4.4 (Gentoo 3.4.4, ssp-3.4.4-1.0, pie-8.7.8): g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I. -I./.. -I../.. -march=athlon-xp -O2 -pipe -fstack-protector -DNDEBUG -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -c connection_list.cc -fPIC -DPIC -o connection_list.lo /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/g++-v3/bits/stl_algo.h: In function `_RandomAccessIterator std::find_if(_RandomAccessIterator, _RandomAccessIterator, _Predicate, std::random_access_iterator_tag) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<torrent::PeerConnectionBase**, std::vector<torrent::PeerConnectionBase*, std::allocator<torrent::PeerConnectionBase*> > >, _Predicate = rak::_equal<torrent::PeerInfo, std::const_mem_fun_t<const torrent::PeerInfo&, torrent::PeerConnectionBase> >]': /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/g++-v3/bits/stl_algo.h:292: internal compiler error: in sweep_string_variable, at protector.c:1158 Preprocessed source attached as requested. Created attachment 65975 [details] Preprocessed source leading to internal compiler error Preprocessed source for comment #8. *** Bug 103500 has been marked as a duplicate of this bug. *** Created attachment 71237 [details] Pre-processed code causing an ICE with i686-pc-linux-gnu-3.4.4 I get the same ICE: /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/g++-v3/bits/stl_pair.h: In function `std::pair<_T1, _T2> std::make_pair(_T1, _T2) [with _T1 = const XML_Char*, _T2 = boost::variant<bool, int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, float, double, std::string, std::wstring, boost::gregorian::date, mantra::duration, boost::posix_time::ptime, mantra::NullValue, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>]': /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/g++-v3/bits/stl_pair.h:144: internal compiler error: in sweep_string_variable, at protector.c:1158 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugs.gentoo.org/> for instructions. Preprocessed source stored into /tmp/ccVMKFeL.out file, please attach this to your bugreport. I've attached the pre-processed code. Though the original source file (http://www.neuromancy.net/viewcvs/Mantra-I/src/storage/xml.cpp?root=mantra&rev=1.40&view=markup) is only 1400 lines (including comments), when I try to compile this code, I've seen it use >330mb of RAM. Could everyone who has this problem, please post combinations of: 1) Compiler version 2) CFLAGS which cause the ICE? (In reply to comment #12) > Could everyone who has this problem, please post combinations of: > > 1) Compiler version > 2) CFLAGS > > which cause the ICE? > ICE occurs during compilation of libfpx-1.2.0.9 1) gcc-config gives i686-pc-linux-gnu-3.4.4 2) CFLAGS="-O2 -march=i686 -pipe" Compiles successfully with: i686-pc-linux-gnu-3.3.6 i686-pc-linux-gnu-3.4.4-vanilla Fails with: i686-pc-linux-gnu-3.4.4 CFLAGS,CXXFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer" CFLAGS,CXXFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer" CFLAGS,CXXFLAGS="" Created attachment 74471 [details]
preprocessed.c++.bz2
The ICE reproducible by simply "g++ -c preprocessed.c++".
fails for: 6,7
compiles for: 1,2,3,4,5,8,9,10
gcc-config -l
[1] i686-pc-linux-gnu-3.3.6
[2] i686-pc-linux-gnu-3.3.6-hardenednopie
[3] i686-pc-linux-gnu-3.3.6-hardenednopiessp
[4] i686-pc-linux-gnu-3.3.6-hardenednossp
[5] i686-pc-linux-gnu-3.3.6-vanilla
[6] i686-pc-linux-gnu-3.4.4 *
[7] i686-pc-linux-gnu-3.4.4-hardenednopie
[8] i686-pc-linux-gnu-3.4.4-hardenednopiessp
[9] i686-pc-linux-gnu-3.4.4-hardenednossp
[10] i686-pc-linux-gnu-3.4.4-vanilla
---
test:
gcc-config <n>
source /etc/profile
g++ -c preprocessed.c++
Fails with: gcc version 3.4.4 (Gentoo Hardened 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8) CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe" CXXFLAGS="${CFLAGS}" CHOST="i686-pc-linux-gnu" Works with: Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/vanilla.specs sigh... I think this also applies to media-libs/libfpx-1.2.0.9 Same error message (internal compiler error: in sweep_string_variable) and works fine with vanilla gcc. (i686-pc-linux-gnu-3.4.4) Tested with: i686-pc-linux-gnu-3.4.4-hardened CFLAGS/CXXFLAGS="-O2 -march=pentium4 -pipe -msse3" *** Bug 117174 has been marked as a duplicate of this bug. *** *** Bug 109833 has been marked as a duplicate of this bug. *** *** Bug 107833 has been marked as a duplicate of this bug. *** Created attachment 76527 [details, diff]
Avoid sweep string variable ICE; issue a warning when it occurs
Ok; here goes nothing. Patch is for gcc-3 (NOT gcc-4 where everything is different). It avoids the ICE that occurs in the affected packages, and instead issues a warning.
It should generate working executables, however it may mean that one of the steps SSP takes to protect functions is not taken properly. In other words, while it's better than switching off SSP completely, it may leave some functions partly unprotected.
To try it out, add this patch to sys-devel/gcc, and remove 'filter-flags -fstack-protector' from the ebuilds of the affected packages if present (all in your overlay or course).
Please report here if any of the packages that previously ICE'd in sweep_string_variable still ICE, or if the application builds but doesn't run properly.
Any final versions should probably be wrappered in #ifdef __i386__ as it seems this only effects x86 arch according to kumba I applied Kevin's patch to gcc-3.4.5 and it fixed up my compile problems with both versions of hylafax currently in the tree (4.2.3-r1 and 4.2.4). These problems are described in bug 109833. Thanks :) Only tested on a Mips box atm. I'll have to reboot my sparc64 box (it's deadlocked) and test it later on to see if it's affected as well. Will update on how that works out. *** Bug 119586 has been marked as a duplicate of this bug. *** *** Bug 120569 has been marked as a duplicate of this bug. *** Created attachment 78347 [details]
preprocessed source that fails to compile
compiles with gcc 3.3.6 (hardened), and gcc 3.4.4-hardened-nossp.
It fails with 3.4.4 (hardened).
I did not apply any optoins, just tried g++ -c failed.cc
(In reply to comment #27) > It fails with 3.4.4 (hardened). > I did not apply any optoins, just tried g++ -c failed.cc Adding -O2 optimises away the ICEs (i.e. 'g++ -O2 -c failed.cc' compiles cleanly). (In reply to comment #28) > (In reply to comment #27) > > It fails with 3.4.4 (hardened). > > I did not apply any optoins, just tried g++ -c failed.cc > > Adding -O2 optimises away the ICEs (i.e. 'g++ -O2 -c failed.cc' compiles > cleanly). As well as -O3 and -Os. I patched boost to always optimize (even for debug libraries), and I will see if it builds. Created attachment 79129 [details]
another failed source
This one is from libfpx, and compiles with -fno-stack-protector.
A few -O options I tried do not affect it, and it does not compile with just gcc -c (gcc 3.4.4).
gcc 3.3.6 compiles it.
*** Bug 122349 has been marked as a duplicate of this bug. *** The gcc patch also fixes boost and libfpx. Thanks *** Bug 122765 has been marked as a duplicate of this bug. *** *** Bug 125583 has been marked as a duplicate of this bug. *** Created attachment 81777 [details]
Reduced testcase
Incase anyone wants this to look at it, here is a reduced testcase which triggers the bug.
I confirm that the problem is exposed by the latest test case provided. Error --------------- storri@base ~ $ g++ -fstack-protector -o test test.cc test.cc: In constructor `PErrorsList::PErrorsList(OSErr, FicNom)': test.cc:33: internal compiler error: in sweep_string_variable, at protector.c:1158 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugs.gentoo.org/> for instructions. Preprocessed source stored into /tmp/ccWWEgva.out file, please attach this to your bugreport. Compiler ---------------------- storri@base ~ $ gcc -v Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.5/specs Configured with: /var/tmp/portage/gcc-3.4.5/work/gcc-3.4.5/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4.5 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.5 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.5/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.5/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --enable-java-awt=gtk --enable-languages=c,c++,java,f77 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 3.4.5 (Gentoo 3.4.5, ssp-3.4.5-1.0, pie-8.7.9) *** Bug 127325 has been marked as a duplicate of this bug. *** *** Bug 128238 has been marked as a duplicate of this bug. *** *** Bug 134901 has been marked as a duplicate of this bug. *** *** Bug 133759 has been marked as a duplicate of this bug. *** Fails with: /usr/lib/gcc/i686-pc-linux-gnu/3.4.6/include/g++-v3/bits/stl_algo.h:292: internal compiler error: in sweep_string_variable, at protector.c:1158 Please submit a full bug report, with preprocessed source if appropriate. Preprocessed source stored into /var/tmp/portage/libtorrent-0.8.3/temp/ccGRYuLy.out file, please attach this to your bugreport. make[3]: *** [connection_list.lo] Error 1 make[3]: *** Waiting for unfinished jobs.... emerge --info Portage 2.0.54-r2 (hardened/x86/2.6, gcc-3.4.6, glibc-2.3.6-r3, 2.6.14-hardened-r7 i686) ================================================================= System uname: 2.6.14-hardened-r7 i686 Pentium III (Coppermine) Gentoo Base System version 1.6.14 dev-lang/python: 2.4.2 dev-python/pycrypto: [Not Present] dev-util/ccache: [Not Present] dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1-r2 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-Os -march=pentium3 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /var/qmail/alias /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-Os -march=pentium3 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" MAKEOPTS="-j3" PKGDIR="/usr/portage//packages/x86/" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage/" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="apache2 berkdb bzip2 crypt curl dlloader expat gd gif gmp hardened idn jpeg mhash mysql ncurses nls pam pcre perl php pic png postgres python qmail readline sqlite ssl tcpd udev userlocales x86 xml xml2 xorg zlib userland_GNU kernel_linux elibc_glibc" Unset: CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS, PORTDIR_OVERLAY Mark, I've committed my change to protector.c to remove this ICE for 3.4.6; if you could roll it up if you release 3.4.6 again that'd be great. you want a revbump ? ultimately, yes please - but I'll do #104754 (SSP specs consistency) first to avoid unnecessary bumps (it's top of my list), and maybe if we can find what's wrong, a fix for #133301. *** Bug 136712 has been marked as a duplicate of this bug. *** *** Bug 137698 has been marked as a duplicate of this bug. *** *** Bug 137873 has been marked as a duplicate of this bug. *** Is it possible to post patch somewhere? I want to use it as overlay as i'm need of pdns-recursor. (In reply to comment #48) > Is it possible to post patch somewhere? I want to use it as overlay as i'm need > of pdns-recursor. It's already attached to this bug - see the 4th attachment "Avoid sweep string variable ICE; issue a warning when it occurs" (actually the final patch is a little tidier, but that's just cosmetic). SpanKY - when you get chance, can you do the bump including also the fix for #104754? The patches for this bug and #104754 are in the patchset CVS in ssp and piepatches directories respectively. I did a trial-run of a bump with gcc-3.4.6-ssp-1.0.tar.bz2 and gcc-3.4.6-piepatches-v8.7.9.tar.bz2 and it seemed to go fine. Or give me the nod if you're happy for me to do it. Sorry, i was confused about its creation date. Thanks a lot. feel free to push out ssp/pie fixes for gcc-3.x ... if you need something, just grab me on irc ok; sys-devel/gcc-3.4.6-r2 is in, with this fix gcc-3.4.6-r2 emerges ok, pdns-recursor emerges ok, everything is working great. Thank you guys. *** Bug 140363 has been marked as a duplicate of this bug. *** *** Bug 142246 has been marked as a duplicate of this bug. *** *** Bug 142890 has been marked as a duplicate of this bug. *** *** Bug 148594 has been marked as a duplicate of this bug. *** *** Bug 158298 has been marked as a duplicate of this bug. *** (In reply to comment #52) > ok; sys-devel/gcc-3.4.6-r2 is in, with this fix ... and stable for some time, closing. Yay! :) |