public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50390] New: gcc hangs while compiling invalid c++ code
@ 2011-09-13 22:16 pipping at exherbo dot org
  2011-09-15 21:22 ` [Bug c++/50390] " pipping at exherbo dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: pipping at exherbo dot org @ 2011-09-13 22:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50390

             Bug #: 50390
           Summary: gcc hangs while compiling invalid c++ code
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pipping@exherbo.org


Created attachment 25266
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25266
likely hang delta-reduced from a preprocessor dump (that was valid code and did
not cause a hang)

I'm attaching a preprocessor dump of C++ code that appears to make g++ hang for
me.

This happens with g++ 4.4.6, 4.5.3, and 4.6.1.

This file (likely-hang6-bcpp.ii) is a delta reduction of the file
test-edges0-memGKN.ii.xz from bug #50388 (attachment 25263). The differences to
the file

  reduce-gcc-segfault/test-edges0-memGKN-segfault-bcpp.ii (attachment 25264)

which is also attached to bug #50388, are marginal.

g++ 4.6.1 hangs at this point:

% g++- -c likely-hang6-bcpp.ii 
likely-hang6-bcpp.ii:150:36: warning: variadic templates only available with
-std=c++0x or -std=gnu++0x [enabled by default]
likely-hang6-bcpp.ii:154:52: warning: variadic templates only available with
-std=c++0x or -std=gnu++0x [enabled by default]
likely-hang6-bcpp.ii:158:26: warning: variadic templates only available with
-std=c++0x or -std=gnu++0x [enabled by default]
likely-hang6-bcpp.ii:322:90: error: template instantiation depth exceeds
maximum of 1024 (use -ftemplate-depth= to increase the maximum) instantiating
‘class Dune::GenericGeometry::HybridMappingBase<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>,
4294966286u>’
likely-hang6-bcpp.ii:322:90:   recursively instantiated from
‘Dune::GenericGeometry::HybridMappingBase<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>, 1u>’
likely-hang6-bcpp.ii:322:90:   instantiated from
‘Dune::GenericGeometry::HybridMappingBase<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>, 2u>’
likely-hang6-bcpp.ii:325:70:   instantiated from
‘Dune::GenericGeometry::HybridMapping<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false> >’
likely-hang6-bcpp.ii:335:68:   instantiated from
‘Dune::GenericGeometry::VirtualMapping<Dune::GenericGeometry::Prism<Dune::GenericGeometry::Prism<Dune::GenericGeometry::Point>
>, Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false> >’
likely-hang6-bcpp.ii:345:60:   recursively instantiated from ‘const int
Dune::GenericGeometry::StaticMaximum<Dune::GenericGeometry::VirtualMappingFactory<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>
>::MappingSize<1>, Dune::GenericForLoop<Dune::GenericGeometry::StaticMaximum,
Dune::GenericGeometry::VirtualMappingFactory<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>
>::MappingSize, 2, 3> >::v’
likely-hang6-bcpp.ii:345:60:   instantiated from ‘const int
Dune::GenericGeometry::StaticMaximum<Dune::GenericGeometry::VirtualMappingFactory<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>
>::MappingSize<0>, Dune::GenericForLoop<Dune::GenericGeometry::StaticMaximum,
Dune::GenericGeometry::VirtualMappingFactory<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>
>::MappingSize, 1, 3> >::v’
likely-hang6-bcpp.ii:360:100:   instantiated from ‘const unsigned int
Dune::GenericGeometry::VirtualMappingFactory<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>
>::maxMappingSize’
likely-hang6-bcpp.ii:396:80:   instantiated from ‘const unsigned int
Dune::GenericGeometry::MappingProvider<Dune::GenericGeometry::HybridMapping<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false> >,
0u>::maxMappingSize’
likely-hang6-bcpp.ii:423:67:   instantiated from
‘Dune::GenericGeometry::BasicGeometry<2,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false> >’
likely-hang6-bcpp.ii:426:76:   instantiated from ‘Dune::MockGeometry<double,
2ul, 2ul>’
likely-hang6-bcpp.ii:447:9:   instantiated from ‘TestGeometries<ctype,
2ul>::TestGeometries() [with ctype = double]’
likely-hang6-bcpp.ii:453:27:   instantiated from ‘void testEdgeS0_5(int&) [with
long unsigned int dim = 2ul]’
likely-hang6-bcpp.ii:462:31:   instantiated from here

likely-hang6-bcpp.ii:322:90: error: invalid use of incomplete type ‘class
Dune::GenericGeometry::HybridMappingBase<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>,
4294966286u>’
likely-hang6-bcpp.ii:322:90: error: declaration of ‘class
Dune::GenericGeometry::HybridMappingBase<2u,
Dune::GenericGeometry::DefaultGeometryTraits<double, 2, 2, false>,
4294966286u>’


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/50390] gcc hangs while compiling invalid c++ code
  2011-09-13 22:16 [Bug c++/50390] New: gcc hangs while compiling invalid c++ code pipping at exherbo dot org
@ 2011-09-15 21:22 ` pipping at exherbo dot org
  2011-09-16  6:25 ` pipping at exherbo dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pipping at exherbo dot org @ 2011-09-15 21:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50390

Elias Pipping <pipping at exherbo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #25266|0                           |1
        is obsolete|                            |

--- Comment #1 from Elias Pipping <pipping at exherbo dot org> 2011-09-15 20:51:37 UTC ---
Created attachment 25298
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25298
further reduced


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/50390] gcc hangs while compiling invalid c++ code
  2011-09-13 22:16 [Bug c++/50390] New: gcc hangs while compiling invalid c++ code pipping at exherbo dot org
  2011-09-15 21:22 ` [Bug c++/50390] " pipping at exherbo dot org
@ 2011-09-16  6:25 ` pipping at exherbo dot org
  2011-09-16  6:58 ` pipping at exherbo dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pipping at exherbo dot org @ 2011-09-16  6:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50390

Elias Pipping <pipping at exherbo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #25298|0                           |1
        is obsolete|                            |

--- Comment #2 from Elias Pipping <pipping at exherbo dot org> 2011-09-15 23:45:36 UTC ---
Created attachment 25300
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25300
further reduced

automatically reduced -- by character (so the file makes no effort to make
sense anymore. just to make g++ hang)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/50390] gcc hangs while compiling invalid c++ code
  2011-09-13 22:16 [Bug c++/50390] New: gcc hangs while compiling invalid c++ code pipping at exherbo dot org
  2011-09-15 21:22 ` [Bug c++/50390] " pipping at exherbo dot org
  2011-09-16  6:25 ` pipping at exherbo dot org
@ 2011-09-16  6:58 ` pipping at exherbo dot org
  2011-09-16 10:00 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pipping at exherbo dot org @ 2011-09-16  6:58 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50390

Elias Pipping <pipping at exherbo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #3 from Elias Pipping <pipping at exherbo dot org> 2011-09-16 00:23:07 UTC ---
I'm starting to think that gcc is not actually hanging. If I use
-ftemplate-depth with values around 100 I can get it to exit after a while. The
order of growth is alarming, though (going from depth 100 to 150 makes it take
~6 times as long to exit), so since 1024 is the default it would certainly feel
endless with that.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/50390] gcc hangs while compiling invalid c++ code
  2011-09-13 22:16 [Bug c++/50390] New: gcc hangs while compiling invalid c++ code pipping at exherbo dot org
                   ` (2 preceding siblings ...)
  2011-09-16  6:58 ` pipping at exherbo dot org
@ 2011-09-16 10:00 ` redi at gcc dot gnu.org
  2011-09-16 22:26 ` pipping at exherbo dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2011-09-16 10:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50390

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-09-16 09:44:21 UTC ---
your final version exits immediately using 4.6.1, but not with 4.5

although it might finish eventually I do think this can be considered a bug


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/50390] gcc hangs while compiling invalid c++ code
  2011-09-13 22:16 [Bug c++/50390] New: gcc hangs while compiling invalid c++ code pipping at exherbo dot org
                   ` (3 preceding siblings ...)
  2011-09-16 10:00 ` redi at gcc dot gnu.org
@ 2011-09-16 22:26 ` pipping at exherbo dot org
  2011-09-17  0:32 ` pipping at exherbo dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pipping at exherbo dot org @ 2011-09-16 22:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50390

Elias Pipping <pipping at exherbo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |

--- Comment #5 from Elias Pipping <pipping at exherbo dot org> 2011-09-16 22:04:55 UTC ---
If you say it's a bug, it's a bug. :)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/50390] gcc hangs while compiling invalid c++ code
  2011-09-13 22:16 [Bug c++/50390] New: gcc hangs while compiling invalid c++ code pipping at exherbo dot org
                   ` (4 preceding siblings ...)
  2011-09-16 22:26 ` pipping at exherbo dot org
@ 2011-09-17  0:32 ` pipping at exherbo dot org
  2011-09-17  1:19 ` redi at gcc dot gnu.org
  2013-06-11 15:30 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: pipping at exherbo dot org @ 2011-09-17  0:32 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50390

--- Comment #6 from Elias Pipping <pipping at exherbo dot org> 2011-09-16 22:08:16 UTC ---
Created attachment 25308
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25308
reduction for gcc 4.6.1

I used gcc 4.5 during reduction, assuming that a reduced test case would "hang"
for all versions since the original code did.

Here's a reduced version that makes gcc 4.6 "hang" (but not 4.4 or 4.5).


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/50390] gcc hangs while compiling invalid c++ code
  2011-09-13 22:16 [Bug c++/50390] New: gcc hangs while compiling invalid c++ code pipping at exherbo dot org
                   ` (5 preceding siblings ...)
  2011-09-17  0:32 ` pipping at exherbo dot org
@ 2011-09-17  1:19 ` redi at gcc dot gnu.org
  2013-06-11 15:30 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2011-09-17  1:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50390

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-09-16
     Ever Confirmed|0                           |1

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-09-16 22:26:08 UTC ---
great, thanks for reducing them


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/50390] gcc hangs while compiling invalid c++ code
  2011-09-13 22:16 [Bug c++/50390] New: gcc hangs while compiling invalid c++ code pipping at exherbo dot org
                   ` (6 preceding siblings ...)
  2011-09-17  1:19 ` redi at gcc dot gnu.org
@ 2013-06-11 15:30 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-06-11 15:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50390

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |4.7.3, 4.8.1, 4.9.0
         Resolution|---                         |FIXED

--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed in 4.7.0.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-06-11 15:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-13 22:16 [Bug c++/50390] New: gcc hangs while compiling invalid c++ code pipping at exherbo dot org
2011-09-15 21:22 ` [Bug c++/50390] " pipping at exherbo dot org
2011-09-16  6:25 ` pipping at exherbo dot org
2011-09-16  6:58 ` pipping at exherbo dot org
2011-09-16 10:00 ` redi at gcc dot gnu.org
2011-09-16 22:26 ` pipping at exherbo dot org
2011-09-17  0:32 ` pipping at exherbo dot org
2011-09-17  1:19 ` redi at gcc dot gnu.org
2013-06-11 15:30 ` paolo.carlini at oracle dot com

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).