public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/57047] New: [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor
@ 2013-04-23 12:49 mattyclarkson at gmail dot com
  2013-04-23 13:19 ` [Bug c++/57047] " redi at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: mattyclarkson at gmail dot com @ 2013-04-23 12:49 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 57047
           Summary: [C++11] stl_pair.h:137:64: internal compiler error:
                    Segmentation fault in constexpr constructor
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mattyclarkson@gmail.com


template<class _U1, class _U2, class = typename
       enable_if<__and_<is_convertible<_U1, _T1>,
      is_convertible<_U2, _T2>>::value>::type>
constexpr pair(_U1&& __x, _U2&& __y)
: first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }

Fails for my program when compiled with the following command line:

/usr/lib64/ccache/g++ -m64 -std=c++11 -Wall -Wextra -pedantic -pthread -flto
-DNDEBUG -O3 -Werror -pedantic-errors -fvisibility=hidden
-fvisibility-inlines-hidden -I/home/matt/svn/KS/lib
-I/home/matt/svn/KS/build/release/lib -I/home/matt/svn/KS/build/release/include
-I/home/matt/svn/KS/include -I/usr/include ../../lib/messaging/tests/task.cpp
-c -o lib/messaging/tests/task.cpp.4.o

With the following error:

In file included from
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_algobase.h:65:0,
                 from
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/char_traits.h:41,
                 from
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/string:42,
                 from
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/stdexcept:40,
                 from ../../lib/messaging/tests/task.cpp:15:
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_pair.h:
In instantiation of ‘constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with
_U1 = const char (&)[35]; _U2 = const char (&)[11]; <template-parameter-2-3> =
void; _T1 = udp::ks::messaging::Id; _T2 = udp::ks::messaging::Id]’:
../../lib/messaging/tests/task.cpp:371:7:   required from here
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_pair.h:137:64:
  in constexpr expansion of ‘((std::pair<udp::ks::messaging::Id,
udp::ks::messaging::Id>*)this)->std::pair<udp::ks::messaging::Id,
udp::ks::messaging::Id>::first.udp::ks::messaging::Id::Id(((const
char*)std::forward<const char (&)[35]>((* & __x))))’
/home/matt/svn/KS/include/udp/keystone/messaging/id.hpp:260:30:   in constexpr
expansion of ‘udp::ks::messaging::Name::Validate(((const Char*)string))’
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_pair.h:137:64:
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/cc99Hnms.out file, please attach this to
your bugreport.

Have attached the preprocessed output.
>From gcc-bugs-return-420811-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 23 12:53:21 2013
Return-Path: <gcc-bugs-return-420811-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5864 invoked by alias); 23 Apr 2013 12:53:21 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 5845 invoked by uid 48); 23 Apr 2013 12:53:18 -0000
From: "mattyclarkson at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/57047] [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor
Date: Tue, 23 Apr 2013 12:53:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Keywords:
X-Bugzilla-Severity: blocker
X-Bugzilla-Who: mattyclarkson at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57047-4-2J8FkdloWt@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57047-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57047-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg01956.txt.bz2
Content-length: 276


http://gcc.gnu.org/bugzilla/show_bug.cgi?idW047

--- Comment #1 from Matt Clarkson <mattyclarkson at gmail dot com> 2013-04-23 12:53:18 UTC ---
Created attachment 29919
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id)919
The preprocessed output before the ICE


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

* [Bug c++/57047] [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor
  2013-04-23 12:49 [Bug libstdc++/57047] New: [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor mattyclarkson at gmail dot com
@ 2013-04-23 13:19 ` redi at gcc dot gnu.org
  2013-04-23 13:22 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2013-04-23 13:19 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-04-23
          Component|libstdc++                   |c++
     Ever Confirmed|0                           |1
           Severity|blocker                     |normal

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-04-23 13:19:41 UTC ---
A segfault in the compiler cannot be a library issue.

Priority=blocker means this should block a GCC release, not "I need this to
work"


Can you try to reduce the code to less than 70kloc?

The error happens on line 15 of task.cpp, so you could at least remove
everything after that, and anything else not necessary to reproduce the
failure.


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

* [Bug c++/57047] [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor
  2013-04-23 12:49 [Bug libstdc++/57047] New: [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor mattyclarkson at gmail dot com
  2013-04-23 13:19 ` [Bug c++/57047] " redi at gcc dot gnu.org
@ 2013-04-23 13:22 ` jakub at gcc dot gnu.org
  2013-04-23 13:26 ` redi at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-23 13:22 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-23 13:22:05 UTC ---
I'm already delta reducing it.


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

* [Bug c++/57047] [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor
  2013-04-23 12:49 [Bug libstdc++/57047] New: [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor mattyclarkson at gmail dot com
  2013-04-23 13:19 ` [Bug c++/57047] " redi at gcc dot gnu.org
  2013-04-23 13:22 ` jakub at gcc dot gnu.org
@ 2013-04-23 13:26 ` redi at gcc dot gnu.org
  2013-04-23 13:42 ` mattyclarkson at gmail dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2013-04-23 13:26 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-04-23 13:26:46 UTC ---
(In reply to comment #2)
> The error happens on line 15 of task.cpp, so you could at least remove
> everything after that, and anything else not necessary to reproduce the
> failure.

Sorry, should have said line 371:

../../lib/messaging/tests/task.cpp:371:7:   required from here


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

* [Bug c++/57047] [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor
  2013-04-23 12:49 [Bug libstdc++/57047] New: [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor mattyclarkson at gmail dot com
                   ` (2 preceding siblings ...)
  2013-04-23 13:26 ` redi at gcc dot gnu.org
@ 2013-04-23 13:42 ` mattyclarkson at gmail dot com
  2013-04-23 13:47 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mattyclarkson at gmail dot com @ 2013-04-23 13:42 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Matt Clarkson <mattyclarkson at gmail dot com> 2013-04-23 13:42:50 UTC ---
Jonathan, apologies for putting it under libstdc++ and also for putting it as a
blocker.  I didn't do that because I thought it was blocking my work but more
because I thought an ICE is a blocker for a release.  Will make sure to
remember this with any future bug reports.

I am currently trying to get this down to a nice reproducible test case. 
Currently trying to get a single main.cpp that reproduces.  Will post if I can
get that, otherwise I'll reduce the code.

Get the same error with tuple.  So I'm sure it is in the Name::Validate
constexpr function.


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

* [Bug c++/57047] [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor
  2013-04-23 12:49 [Bug libstdc++/57047] New: [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor mattyclarkson at gmail dot com
                   ` (3 preceding siblings ...)
  2013-04-23 13:42 ` mattyclarkson at gmail dot com
@ 2013-04-23 13:47 ` redi at gcc dot gnu.org
  2013-04-23 13:53 ` mattyclarkson at gmail dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2013-04-23 13:47 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-04-23 13:47:52 UTC ---
We have lots of ICEs, they can't all block a release :)


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

* [Bug c++/57047] [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor
  2013-04-23 12:49 [Bug libstdc++/57047] New: [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor mattyclarkson at gmail dot com
                   ` (4 preceding siblings ...)
  2013-04-23 13:47 ` redi at gcc dot gnu.org
@ 2013-04-23 13:53 ` mattyclarkson at gmail dot com
  2013-04-23 14:07 ` mattyclarkson at gmail dot com
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mattyclarkson at gmail dot com @ 2013-04-23 13:53 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Matt Clarkson <mattyclarkson at gmail dot com> 2013-04-23 13:53:04 UTC ---
Created attachment 29920
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29920
A simplified reproducible test case


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

* [Bug c++/57047] [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor
  2013-04-23 12:49 [Bug libstdc++/57047] New: [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor mattyclarkson at gmail dot com
                   ` (5 preceding siblings ...)
  2013-04-23 13:53 ` mattyclarkson at gmail dot com
@ 2013-04-23 14:07 ` mattyclarkson at gmail dot com
  2013-04-23 14:17 ` mattyclarkson at gmail dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mattyclarkson at gmail dot com @ 2013-04-23 14:07 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #8 from Matt Clarkson <mattyclarkson at gmail dot com> 2013-04-23 14:07:44 UTC ---
Created attachment 29921
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29921
A very short reproducible test case (85 loc)


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

* [Bug c++/57047] [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor
  2013-04-23 12:49 [Bug libstdc++/57047] New: [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor mattyclarkson at gmail dot com
                   ` (6 preceding siblings ...)
  2013-04-23 14:07 ` mattyclarkson at gmail dot com
@ 2013-04-23 14:17 ` mattyclarkson at gmail dot com
  2013-04-23 15:10 ` [Bug c++/57047] [4.7/4.8/4.9 Regression] " jakub at gcc dot gnu.org
  2013-05-10 14:36 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: mattyclarkson at gmail dot com @ 2013-04-23 14:17 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #9 from Matt Clarkson <mattyclarkson at gmail dot com> 2013-04-23 14:17:10 UTC ---
This is a problem with both 4.7.2 and 4.8.0.  Checked on
http://coliru.stacked-crooked.com/


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

* [Bug c++/57047] [4.7/4.8/4.9 Regression] [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor
  2013-04-23 12:49 [Bug libstdc++/57047] New: [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor mattyclarkson at gmail dot com
                   ` (7 preceding siblings ...)
  2013-04-23 14:17 ` mattyclarkson at gmail dot com
@ 2013-04-23 15:10 ` jakub at gcc dot gnu.org
  2013-05-10 14:36 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-23 15:10 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org
   Target Milestone|---                         |4.7.4
            Summary|[C++11] stl_pair.h:137:64:  |[4.7/4.8/4.9 Regression]
                   |internal compiler error:    |[C++11] stl_pair.h:137:64:
                   |Segmentation fault in       |internal compiler error:
                   |constexpr constructor       |Segmentation fault in
                   |                            |constexpr constructor

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-23 15:10:32 UTC ---
Reduced testcase:
template <typename>
struct A;
template <typename T>
struct A <T &>
{
  typedef T type;
};
template <typename T>
constexpr T && foo (typename A <T>::type & __t) noexcept
{
  return static_cast <T &&>(__t);
}
template <class T1, class T2>
struct B
{
  T1 t1;
  T2 t2;
  template <class U>
  constexpr B (U && __x, const T2 & __y) : t1 (foo <U> (__x)), t2 (__y) {}
};
static inline constexpr bool
fn1 (const char c)
{
  return ('0' <= c) && (c <= '9');
}
static inline constexpr bool
fn2 (const char c)
{
  return (('A' <= c) && (c <= 'Z')) || (('a' <= c) && (c <= 'z'));
}
static constexpr bool
fn3 (const char *const x)
{
  return (x[1] == '\0' && x[0] == ']') ? true : (!fn1 (x[0])) ? false : fn3
(&x[1]);
}
static constexpr bool
fn4 (const char *const x)
{
  return (x[0] == '\0') ? fn3 (&x[1]) : fn4 (&x[1]);
}
static inline constexpr bool
fn5 (const char *const x)
{
  return fn2 (x[0]) ? fn4 (x) : false;
}
struct C final
{
  constexpr C (const char *const t1) : c (fn5 (t1) ? 199 : 69) {}
  unsigned c;
};
B <C, C> p ("a", "b");

Started to ICE in between r175000 and r175062.


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

* [Bug c++/57047] [4.7/4.8/4.9 Regression] [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor
  2013-04-23 12:49 [Bug libstdc++/57047] New: [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor mattyclarkson at gmail dot com
                   ` (8 preceding siblings ...)
  2013-04-23 15:10 ` [Bug c++/57047] [4.7/4.8/4.9 Regression] " jakub at gcc dot gnu.org
@ 2013-05-10 14:36 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2013-05-10 14:36 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org

--- Comment #11 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2013-05-10 14:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-23 12:49 [Bug libstdc++/57047] New: [C++11] stl_pair.h:137:64: internal compiler error: Segmentation fault in constexpr constructor mattyclarkson at gmail dot com
2013-04-23 13:19 ` [Bug c++/57047] " redi at gcc dot gnu.org
2013-04-23 13:22 ` jakub at gcc dot gnu.org
2013-04-23 13:26 ` redi at gcc dot gnu.org
2013-04-23 13:42 ` mattyclarkson at gmail dot com
2013-04-23 13:47 ` redi at gcc dot gnu.org
2013-04-23 13:53 ` mattyclarkson at gmail dot com
2013-04-23 14:07 ` mattyclarkson at gmail dot com
2013-04-23 14:17 ` mattyclarkson at gmail dot com
2013-04-23 15:10 ` [Bug c++/57047] [4.7/4.8/4.9 Regression] " jakub at gcc dot gnu.org
2013-05-10 14:36 ` jason at gcc dot gnu.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).