public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55109] New: internal compiler error: Segmentation fault while reporting error in template function instantiation
@ 2012-10-28 17:20 ZetaetaDaniel at gmail dot com
  2012-10-28 17:55 ` [Bug c++/55109] " paolo.carlini at oracle dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ZetaetaDaniel at gmail dot com @ 2012-10-28 17:20 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55109
           Summary: internal compiler error: Segmentation fault while
                    reporting error in template function instantiation
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ZetaetaDaniel@gmail.com


The compiler command was:

g++ -DHAVE_CONFIG_H -I.    -O0 -g -std=c++11  -I src/ -Wall -Wextra -Werror
-Wno-error=unused-variable -Wno-error=unused-parameter
-Wno-error=unused-but-set-variable  -MT mc___server-NetworkServer.o -MD -MP -MF
.deps/mc___server-NetworkServer.Tpo -c -o mc___server-NetworkServer.o `test -f
'src/network/NetworkServer.cpp' || echo './'`src/network/NetworkServer.cpp

The compiler output was (template stuff formatted for readability):

In file included from src/network/NetworkServer.cpp:22:0:
src/Scheduler.hpp: In instantiation of ‘typename std::enable_if<
    std::__and_<
        std::is_convertible<
            MemberFunc, std::function<
                decltype (MCServer::Scheduler::startThread::obj->
                    **MCServer::Scheduler::startThread::func(
                        MCServer::Scheduler::startThread::args ...
                    )
                ) (Args ...)
            >
        >,
        std::is_member_function_pointer<MemberFunc>
    >::value, long unsigned int
>::type
MCServer::Scheduler::startImportantThread(MemberFunc&&, Class*, Args&& ...)
[with MemberFunc = void (MCServer::Network::NetworkServer::*)();
Class = MCServer::Network::NetworkServer;
Args = {};
typename std::enable_if<
    std::__and_<
        std::is_convertible<
            MemberFunc, std::function<
                decltype (MCServer::Scheduler::startThread::obj->
                    **MCServer::Scheduler::startThread::func(
                        MCServer::Scheduler::startThread::args ...
                    )
                ) (Args ...)
            >
        >,
        std::is_member_function_pointer<MemberFunc>
    >::value, long unsigned int
>::type = long unsigned int]’:
src/network/NetworkServer.cpp:69:74:   required from here
src/Scheduler.hpp:187:156: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.

The backtrace of the segfault is:

#0  0x00000000004e00e7 in ?? ()
#1  0x00000000004e0464 in tsubst_copy_and_build ()
#2  0x00000000004dbffa in ?? ()
#3  0x00000000004e7ddf in ?? ()
#4  0x00000000004e105b in tsubst_copy_and_build ()
#5  0x00000000004dbffa in ?? ()
#6  0x00000000004e28c0 in tsubst ()
#7  0x00000000004e881c in ?? ()
#8  0x00000000004e2ceb in tsubst ()
#9  0x00000000004e5b13 in ?? ()
#10 0x00000000004df422 in ?? ()
#11 0x00000000004e2ec9 in tsubst ()
#12 0x00000000004e0dac in tsubst_copy_and_build ()
#13 0x00000000004e0ffe in tsubst_copy_and_build ()
#14 0x00000000004dbffa in ?? ()
#15 0x00000000004dcd0f in ?? ()
#16 0x00000000004dcc4c in ?? ()
#17 0x00000000004dc118 in ?? ()
#18 0x00000000004f0da3 in instantiate_decl ()
#19 0x00000000004f37ac in instantiate_pending_templates ()
#20 0x000000000050979d in cp_write_global_declarations ()
#21 0x0000000000831a58 in toplev_main ()
#22 0x00007ffff5eca725 in __libc_start_main () from /usr/lib/libc.so.6
#23 0x00000000004abaf1 in _start ()

which is of course very incomplete, and I am currently compiling gcc with debug
symbols to get a better backtrace, but it will take some time.

The preprocessed source of the file being compiled is here:
http://www.mediafire.com/?hdv6qddwnwclj82


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

* [Bug c++/55109] internal compiler error: Segmentation fault while reporting error in template function instantiation
  2012-10-28 17:20 [Bug c++/55109] New: internal compiler error: Segmentation fault while reporting error in template function instantiation ZetaetaDaniel at gmail dot com
@ 2012-10-28 17:55 ` paolo.carlini at oracle dot com
  2012-10-30 10:17 ` ZetaetaDaniel at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-28 17:55 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2012-10-28
     Ever Confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-28 17:55:32 UTC ---
Please reduce the testcase as much as possible - there are many tools which you
can use for that, delta, creduce - and attach here what you get.


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

* [Bug c++/55109] internal compiler error: Segmentation fault while reporting error in template function instantiation
  2012-10-28 17:20 [Bug c++/55109] New: internal compiler error: Segmentation fault while reporting error in template function instantiation ZetaetaDaniel at gmail dot com
  2012-10-28 17:55 ` [Bug c++/55109] " paolo.carlini at oracle dot com
@ 2012-10-30 10:17 ` ZetaetaDaniel at gmail dot com
  2012-10-30 11:42 ` ZetaetaDaniel at gmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ZetaetaDaniel at gmail dot com @ 2012-10-30 10:17 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Daniel Mulcahy <ZetaetaDaniel at gmail dot com> 2012-10-30 10:17:30 UTC ---
Reduced test case here https://gist.github.com/3979454, as provided by creduce.


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

* [Bug c++/55109] internal compiler error: Segmentation fault while reporting error in template function instantiation
  2012-10-28 17:20 [Bug c++/55109] New: internal compiler error: Segmentation fault while reporting error in template function instantiation ZetaetaDaniel at gmail dot com
  2012-10-28 17:55 ` [Bug c++/55109] " paolo.carlini at oracle dot com
  2012-10-30 10:17 ` ZetaetaDaniel at gmail dot com
@ 2012-10-30 11:42 ` ZetaetaDaniel at gmail dot com
  2012-10-30 11:54 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ZetaetaDaniel at gmail dot com @ 2012-10-30 11:42 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Daniel Mulcahy <ZetaetaDaniel at gmail dot com> 2012-10-30 11:41:43 UTC ---
New, improved backtrace:

#0  0x00000000004e00d7 in tsubst_copy (t=<optimized out>, args=0x7ffff5602578,
complain=3, in_decl=<optimized out>) at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:12149
#1  0x00000000004e0454 in tsubst_copy_and_build (t=t@entry=0x7ffff54a5bb0,
args=args@entry=0x7ffff5602578, complain=complain@entry=3,
in_decl=in_decl@entry=0x7ffff55ffda8, 
    function_p=function_p@entry=0 '\000',
integral_constant_expression_p=integral_constant_expression_p@entry=0 '\000')
    at /home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:14337
#2  0x00000000004dbfea in tsubst_expr (t=t@entry=0x7ffff54a5bb0,
args=args@entry=0x7ffff5602578, complain=complain@entry=3,
in_decl=in_decl@entry=0x7ffff55ffda8, 
    integral_constant_expression_p=integral_constant_expression_p@entry=0
'\000') at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:13387
#3  0x00000000004e7dcf in tsubst_pack_expansion (t=0x7ffff56022d8,
args=args@entry=0x7ffff5602578, complain=complain@entry=3,
in_decl=in_decl@entry=0x7ffff55ffda8)
    at /home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:9523
#4  0x00000000004e104b in tsubst_copy_and_build (t=t@entry=0x7ffff55d5d00,
args=args@entry=0x7ffff5602578, complain=complain@entry=3,
in_decl=in_decl@entry=0x7ffff55ffda8, 
    function_p=function_p@entry=0 '\000',
integral_constant_expression_p=integral_constant_expression_p@entry=0 '\000')
    at /home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:13894
#5  0x00000000004dbfea in tsubst_expr (t=0x7ffff55d5d00,
args=args@entry=0x7ffff5602578, complain=complain@entry=3,
in_decl=0x7ffff55ffda8, 
    integral_constant_expression_p=integral_constant_expression_p@entry=0
'\000') at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:13387
#6  0x00000000004e28b0 in tsubst (in_decl=<optimized out>, complain=<optimized
out>, args=<optimized out>, t=0x7ffff56095e8)
    at /home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:11839
#7  tsubst (t=<optimized out>, args=0x7ffff5602578, complain=3,
in_decl=<optimized out>) at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:11170
#8  0x00000000004e880c in tsubst_function_type (t=t@entry=0x7ffff56099d8,
args=args@entry=0x7ffff5602578, complain=complain@entry=3,
in_decl=0x7ffff55ffda8)
    at /home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:10992
#9  0x00000000004e2cdb in tsubst (in_decl=<optimized out>, complain=<optimized
out>, args=<optimized out>, t=0x7ffff56099d8)
    at /home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:11667
#10 tsubst (t=<optimized out>, args=0x7ffff5602578, complain=3,
in_decl=<optimized out>) at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:11170
#11 0x00000000004e5b03 in tsubst_template_args (t=0x7ffff5604f28,
args=args@entry=0x7ffff5602578, complain=complain@entry=3,
in_decl=in_decl@entry=0x7ffff55ffda8)
    at /home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:9731
#12 0x00000000004df412 in tsubst_aggr_type (t=0x7ffff5609a80,
args=0x7ffff5602578, complain=3, in_decl=0x7ffff55ffda8, entering_scope=0)
    at /home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:9927
#13 0x00000000004e2eb9 in tsubst (in_decl=<optimized out>, complain=<optimized
out>, args=<optimized out>, t=0x7ffff5609a80)
    at /home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:11261
#14 tsubst (t=<optimized out>, args=0x7ffff5602578, complain=3,
in_decl=<optimized out>) at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:11170
#15 0x00000000004e0d9c in tsubst_copy_and_build (t=0x7ffff560e780,
args=args@entry=0x7ffff5602578, complain=complain@entry=3,
in_decl=in_decl@entry=0x7ffff55ffda8, 
    function_p=function_p@entry=0 '\000',
integral_constant_expression_p=integral_constant_expression_p@entry=0 '\000')
    at /home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:13557
#16 0x00000000004e0fee in tsubst_copy_and_build (t=t@entry=0x7ffff549ff30,
args=args@entry=0x7ffff5602578, complain=complain@entry=3,
in_decl=in_decl@entry=0x7ffff55ffda8, 
    function_p=function_p@entry=0 '\000',
integral_constant_expression_p=integral_constant_expression_p@entry=0 '\000')
    at /home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:13888
#17 0x00000000004dbfea in tsubst_expr (t=0x7ffff549ff30,
args=args@entry=0x7ffff5602578, complain=complain@entry=3,
in_decl=in_decl@entry=0x7ffff55ffda8, 
    integral_constant_expression_p=integral_constant_expression_p@entry=0
'\000') at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:13387
#18 0x00000000004dc55a in tsubst_expr (t=0x7ffff560e898,
args=args@entry=0x7ffff5602578, complain=complain@entry=3,
in_decl=in_decl@entry=0x7ffff55ffda8, 
    integral_constant_expression_p=integral_constant_expression_p@entry=0
'\000') at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:12879
#19 0x00000000004dcc3c in tsubst_expr (t=0x7ffff55f0ee0,
args=args@entry=0x7ffff5602578, complain=complain@entry=3,
in_decl=in_decl@entry=0x7ffff55ffda8, 
    integral_constant_expression_p=integral_constant_expression_p@entry=0
'\000') at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:12865
#20 0x00000000004dc108 in tsubst_expr (t=0x7ffff56023b8,
args=args@entry=0x7ffff5602578, complain=complain@entry=3,
in_decl=in_decl@entry=0x7ffff55ffda8, 
    integral_constant_expression_p=integral_constant_expression_p@entry=0
'\000') at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:13049
#21 0x00000000004f0d93 in instantiate_decl (d=d@entry=0x7ffff560b800,
defer_ok=<optimized out>, defer_ok@entry=0,
expl_inst_class_mem_p=expl_inst_class_mem_p@entry=0 '\000')
    at /home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:18821
#22 0x00000000004f379c in instantiate_pending_templates
(retries=retries@entry=0) at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/pt.c:18920
#23 0x000000000050978d in cp_write_global_declarations () at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/cp/decl2.c:3770
#24 0x0000000000831a48 in compile_file () at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/toplev.c:573
#25 do_compile () at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/toplev.c:1938
#26 toplev_main (argc=5, argv=0x7fffffffdfa8) at
/home/daniel/Documents/packages/ABS/gcc/src/gcc-4.7.2/gcc/toplev.c:2014
#27 0x00007ffff5eca725 in __libc_start_main () from /usr/lib/libc.so.6
#28 0x00000000004abaf1 in _start ()


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

* [Bug c++/55109] internal compiler error: Segmentation fault while reporting error in template function instantiation
  2012-10-28 17:20 [Bug c++/55109] New: internal compiler error: Segmentation fault while reporting error in template function instantiation ZetaetaDaniel at gmail dot com
                   ` (2 preceding siblings ...)
  2012-10-30 11:42 ` ZetaetaDaniel at gmail dot com
@ 2012-10-30 11:54 ` paolo.carlini at oracle dot com
  2012-10-30 11:56 ` paolo.carlini at oracle dot com
  2013-06-06 22:51 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-30 11:54 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-30 11:53:22 UTC ---
Created attachment 28572
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28572
Testcase


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

* [Bug c++/55109] internal compiler error: Segmentation fault while reporting error in template function instantiation
  2012-10-28 17:20 [Bug c++/55109] New: internal compiler error: Segmentation fault while reporting error in template function instantiation ZetaetaDaniel at gmail dot com
                   ` (3 preceding siblings ...)
  2012-10-30 11:54 ` paolo.carlini at oracle dot com
@ 2012-10-30 11:56 ` paolo.carlini at oracle dot com
  2013-06-06 22:51 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-30 11:56 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-30 11:56:33 UTC ---
Thanks. In general, we don't work with URLs, simply attach the testcase as-is.


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

* [Bug c++/55109] internal compiler error: Segmentation fault while reporting error in template function instantiation
  2012-10-28 17:20 [Bug c++/55109] New: internal compiler error: Segmentation fault while reporting error in template function instantiation ZetaetaDaniel at gmail dot com
                   ` (4 preceding siblings ...)
  2012-10-30 11:56 ` paolo.carlini at oracle dot com
@ 2013-06-06 22:51 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-06-06 22:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |4.8.0, 4.9.0
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.8.0

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


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

end of thread, other threads:[~2013-06-06 22:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-28 17:20 [Bug c++/55109] New: internal compiler error: Segmentation fault while reporting error in template function instantiation ZetaetaDaniel at gmail dot com
2012-10-28 17:55 ` [Bug c++/55109] " paolo.carlini at oracle dot com
2012-10-30 10:17 ` ZetaetaDaniel at gmail dot com
2012-10-30 11:42 ` ZetaetaDaniel at gmail dot com
2012-10-30 11:54 ` paolo.carlini at oracle dot com
2012-10-30 11:56 ` paolo.carlini at oracle dot com
2013-06-06 22:51 ` 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).