[Bug 697719] New: g++ -ftemplate-depth=4496 segfaults. 4495 ok.
https://bugzilla.novell.com/show_bug.cgi?id=697719 https://bugzilla.novell.com/show_bug.cgi?id=697719#c0 Summary: g++ -ftemplate-depth=4496 segfaults. 4495 ok. Classification: openSUSE Product: openSUSE 11.3 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Development AssignedTo: pth@novell.com ReportedBy: malcolm.douglas@gmail.com QAContact: qa@suse.de Found By: --- Blocker: --- Created an attachment (id=432692) --> (http://bugzilla.novell.com/attachment.cgi?id=432692) C++ source file that causes g++ to bug out. User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24 When compiling attachment with the command: g++ -ftemplate-depth=4496 -o submission submission.cc I get a segfault. Doesn't segfault with -ftemplate-depth=4495, in that case I get an error saying I'm above the recursive depth for templates, and that I need to increase it. On my system I guess this is the breaking point. Reproducible: Always Steps to Reproduce: 1.try to compile the attached source code with the command source code. The command I used is: g++ -ftemplate-depth=4496 -o submission submission.cc 2.If it doesn't seg fault on your system, maybe try to increase the -ftemplate-depth and add a bigger integer to check the primeness of in the source code in the main function. My system is: gcc -v : Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.5/lto-wrapper Target: x86_64-suse-linux Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.5 --enable-ssp --disable-libssp --disable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --program-suffix=-4.5 --enable-linux-futex --without-system-libunwind --enable-gold --with-plugin-ld=/usr/bin/gold --with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux Thread model: posix gcc version 4.5.0 20100604 [gcc-4_5-branch revision 160292] (SUSE Linux) uname -a: Linux linux-o9py 2.6.34.7-0.7-desktop #1 SMP PREEMPT 2010-12-13 11:13:53 +0100 x86_64 x86_64 x86_64 GNU/Linux 3. Actual Results: g++ -ftemplate-depth=4496 -o submission submission.cc g++: Internal error: Segmentation fault (program cc1plus) Please submit a full bug report. See <http://bugs.opensuse.org/> for instructions. Compilation exited abnormally with code 1 at Thu Jun 2 11:11:04 Expected Results: Segfaults! Eep! Might be upstream though, don't have an upstream gcc to try it on. I don't really care about this at present because I was just experimenting with template meta-programming. That being said, in my case it was pretty easy to determine the cause of the segfault, which I suppose isn't always true. Since this can be caused by an increased constant in a parameter of the template, and sometimes template stuff gets buried by typedefs and inheritance, this might be hard to pinpoint in a larger project. And the error message said to report the bug, so I figured I would do so. But as far as I'm concerned it's not important. I will respond to follow up correspondence if I can help, however. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=697719 https://bugzilla.novell.com/show_bug.cgi?id=697719#c1 Malcolm Douglas <malcolm.douglas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #432692|0 |1 is obsolete| | --- Comment #1 from Malcolm Douglas <malcolm.douglas@gmail.com> 2011-06-02 15:48:57 UTC --- Created an attachment (id=432695) --> (http://bugzilla.novell.com/attachment.cgi?id=432695) ok this one causes it. I had commented out the part of the last file that causes the segfault while I was poking around with it, sorry about that. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=697719 https://bugzilla.novell.com/show_bug.cgi?id=697719#c Philipp Thomas <pth@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pth@novell.com AssignedTo|pth@novell.com |rguenther@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=697719 https://bugzilla.novell.com/show_bug.cgi?id=697719#c2 Richard Guenther <rguenther@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #2 from Richard Guenther <rguenther@novell.com> 2011-06-06 10:03:47 UTC --- You are running into the GCC process stack limit, use ulimit -s unlimited. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=697719 https://bugzilla.novell.com/show_bug.cgi?id=697719#c3 --- Comment #3 from Malcolm Douglas <malcolm.douglas@gmail.com> 2011-06-07 17:04:37 UTC --- That did it, thanks! (In reply to comment #2)
You are running into the GCC process stack limit, use ulimit -s unlimited.
-- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com