public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rscohn2 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/108245] New: parser segv
Date: Wed, 28 Dec 2022 18:08:29 +0000	[thread overview]
Message-ID: <bug-108245-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108245

            Bug ID: 108245
           Summary: parser segv
           Product: gcc
           Version: 12.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rscohn2 at gmail dot com
  Target Milestone: ---

Created attachment 54161
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54161&action=edit
reproducer

The attached program has a syntax error that causes a segv in the parser. 

Here is the compiler version:

g++-12 (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0

It fails the same way with g++ 12.2 in compiler exporer:

https://godbolt.org/z/zKjYE44WW

And here is the error.

rscohn1@rscohn1-mobl1:test$ g++-12 -c short.ii
In file included from /usr/include/c++/12/type_traits:38,
                 from /usr/include/c++/12/bits/stl_pair.h:60,
                 from /usr/include/c++/12/tuple:38,
                 from short.cpp:1:
/usr/include/x86_64-linux-gnu/c++/12/bits/c++config.h: In function ‘auto
local_zipped_range()’:
/usr/include/x86_64-linux-gnu/c++/12/bits/c++config.h:298:36: internal compiler
error: Segmentation fault
  298 |   typedef __SIZE_TYPE__         size_t;
      |                                    ^~~~
0xd910e3 crash_signal
        ../../src/gcc/toplev.cc:322
0x7fd3ecb7451f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x81ca65 tsubst_decl
        ../../src/gcc/cp/pt.cc:14899
0x7e6f97 cp_parser_parameter_declaration
        ../../src/gcc/cp/parser.cc:24868
0x7e7512 cp_parser_parameter_declaration_list
        ../../src/gcc/cp/parser.cc:24564
0x7e78c4 cp_parser_parameter_declaration_clause
        ../../src/gcc/cp/parser.cc:24491
0x7e885f cp_parser_lambda_declarator_opt
        ../../src/gcc/cp/parser.cc:11579
0x7cf854 cp_parser_lambda_expression
        ../../src/gcc/cp/parser.cc:11105
0x7d03d3 cp_parser_primary_expression
        ../../src/gcc/cp/parser.cc:5698
0x7d2fed cp_parser_postfix_expression
        ../../src/gcc/cp/parser.cc:7654
0x7bc7c6 cp_parser_binary_expression
        ../../src/gcc/cp/parser.cc:10035
0x7bcfce cp_parser_assignment_expression
        ../../src/gcc/cp/parser.cc:10339
0x7beaf9 cp_parser_constant_expression
        ../../src/gcc/cp/parser.cc:10642
0x7beb91 cp_parser_initializer_clause
        ../../src/gcc/cp/parser.cc:25223
0x7c1b7c cp_parser_initializer
        ../../src/gcc/cp/parser.cc:25163
0x7ef733 cp_parser_init_declarator
        ../../src/gcc/cp/parser.cc:22773
0x7cbb28 cp_parser_simple_declaration
        ../../src/gcc/cp/parser.cc:15280
0x7cd750 cp_parser_declaration_statement
        ../../src/gcc/cp/parser.cc:14361
0x7cdf3c cp_parser_statement
        ../../src/gcc/cp/parser.cc:12446
0x7cee5d cp_parser_statement_seq_opt
        ../../src/gcc/cp/parser.cc:12850
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-12/README.Bugs> for instructions.
rscohn1@rscohn1-mobl1:test$

             reply	other threads:[~2022-12-28 18:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-28 18:08 rscohn2 at gmail dot com [this message]
2022-12-28 18:17 ` [Bug c++/108245] " pinskia at gcc dot gnu.org
2022-12-28 18:19 ` pinskia at gcc dot gnu.org
2022-12-28 18:23 ` pinskia at gcc dot gnu.org
2022-12-28 18:28 ` [Bug c++/108245] ICE with invalid variable auto arguments and supplying an extra type pinskia at gcc dot gnu.org
2023-01-06  7:13 ` pinskia at gcc dot gnu.org
2023-09-26 17:11 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-108245-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).