public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/31804] New: gcc segfaults on very long pointer chains
@ 2007-05-03 20:10 rwxr-xr-x at gmx dot de
2007-05-03 21:03 ` [Bug c/31804] " rguenth at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: rwxr-xr-x at gmx dot de @ 2007-05-03 20:10 UTC (permalink / raw)
To: gcc-bugs
$ perl -wle 'print "int", "*" x 999999, "p;"' >try.c && gcc try.c
gcc: Internal error: Segmentation fault (program cc1)
...
$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-4.1.1-r3/work/gcc-4.1.1/configure --prefix=/usr
--bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.1
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --enable-secureplt --disable-libunwind-exceptions
--disable-multilib --disable-libmudflap --disable-libssp --enable-java-awt=gtk
--enable-languages=c,c++,java,fortran --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.1 (Gentoo 4.1.1-r3)
gcc-4.3-20070427 seems to have the same problem.
3.4.6 works fine, but after increasing the number of *'s to 99999999 it says:
cc1: out of memory allocating 1677721600 bytes after a total of 845819904 bytes
So this problem seems to be new in gcc4.
--
Summary: gcc segfaults on very long pointer chains
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rwxr-xr-x at gmx dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31804
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/31804] gcc segfaults on very long pointer chains
2007-05-03 20:10 [Bug c/31804] New: gcc segfaults on very long pointer chains rwxr-xr-x at gmx dot de
@ 2007-05-03 21:03 ` rguenth at gcc dot gnu dot org
2007-05-04 2:41 ` fang at csl dot cornell dot edu
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-05-03 21:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2007-05-03 22:02 -------
you must be kidding.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |WONTFIX
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31804
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/31804] gcc segfaults on very long pointer chains
2007-05-03 20:10 [Bug c/31804] New: gcc segfaults on very long pointer chains rwxr-xr-x at gmx dot de
2007-05-03 21:03 ` [Bug c/31804] " rguenth at gcc dot gnu dot org
@ 2007-05-04 2:41 ` fang at csl dot cornell dot edu
2007-05-04 3:50 ` bangerth at dealii dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: fang at csl dot cornell dot edu @ 2007-05-04 2:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from fang at csl dot cornell dot edu 2007-05-04 03:40 -------
adding to personal favorite list :)
--
fang at csl dot cornell dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fang at csl dot cornell dot
| |edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31804
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/31804] gcc segfaults on very long pointer chains
2007-05-03 20:10 [Bug c/31804] New: gcc segfaults on very long pointer chains rwxr-xr-x at gmx dot de
2007-05-03 21:03 ` [Bug c/31804] " rguenth at gcc dot gnu dot org
2007-05-04 2:41 ` fang at csl dot cornell dot edu
@ 2007-05-04 3:50 ` bangerth at dealii dot org
2007-05-04 11:00 ` joseph at codesourcery dot com
2007-12-15 20:46 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2007-05-04 3:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from bangerth at dealii dot org 2007-05-04 04:50 -------
(In reply to comment #0)
> $ perl -wle 'print "int", "*" x 999999, "p;"' >try.c && gcc try.c
> gcc: Internal error: Segmentation fault (program cc1)
Yo, dude, that would take a seriously long program to even initialize
that pointer :-)
But seriously, while I do think that we should strive to compile even
programs that are "weird" or "unusual" in their requirements on the
compiler, I think that this one goes a little overboard. I would,
however, be interested to hear how many levels of pointers gcc
actually *can* compile. I would imagine it's at least a few
hundred, maybe thousand. Maybe you could try to figure out?
Best
Wolfgang
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31804
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/31804] gcc segfaults on very long pointer chains
2007-05-03 20:10 [Bug c/31804] New: gcc segfaults on very long pointer chains rwxr-xr-x at gmx dot de
` (2 preceding siblings ...)
2007-05-04 3:50 ` bangerth at dealii dot org
@ 2007-05-04 11:00 ` joseph at codesourcery dot com
2007-12-15 20:46 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: joseph at codesourcery dot com @ 2007-05-04 11:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from joseph at codesourcery dot com 2007-05-04 12:00 -------
Subject: Re: gcc segfaults on very long pointer chains
On Fri, 4 May 2007, bangerth at dealii dot org wrote:
> But seriously, while I do think that we should strive to compile even
> programs that are "weird" or "unusual" in their requirements on the
> compiler, I think that this one goes a little overboard. I would,
> however, be interested to hear how many levels of pointers gcc
> actually *can* compile. I would imagine it's at least a few
> hundred, maybe thousand. Maybe you could try to figure out?
That would depend on your stack limit (so the question would really be,
for each extra MB of stack limit how many more levels can it compile)?
For such extreme programs I think it's reasonable to expect users to
increase their stack limit when running the compiler.
Although in this case, it would be reasonably straightforward to make
c_parser_declarator iterative (with an internal linked list on the parser
obstack) rather than recursive - if that were actually of use in compiling
real code with real stack limits.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31804
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c/31804] gcc segfaults on very long pointer chains
2007-05-03 20:10 [Bug c/31804] New: gcc segfaults on very long pointer chains rwxr-xr-x at gmx dot de
` (3 preceding siblings ...)
2007-05-04 11:00 ` joseph at codesourcery dot com
@ 2007-12-15 20:46 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-12-15 20:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2007-12-15 20:46 -------
*** Bug 34308 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dominique dot pelle at free
| |dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31804
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-12-15 20:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-03 20:10 [Bug c/31804] New: gcc segfaults on very long pointer chains rwxr-xr-x at gmx dot de
2007-05-03 21:03 ` [Bug c/31804] " rguenth at gcc dot gnu dot org
2007-05-04 2:41 ` fang at csl dot cornell dot edu
2007-05-04 3:50 ` bangerth at dealii dot org
2007-05-04 11:00 ` joseph at codesourcery dot com
2007-12-15 20:46 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).