public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99243] New: internal compiler error: in set_filename, at cp/module.cc:19143
@ 2021-02-24  8:44 alexander.lelyakin at googlemail dot com
  2021-03-27  6:53 ` [Bug c++/99243] [modules] ICE " alexander.lelyakin at googlemail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: alexander.lelyakin at googlemail dot com @ 2021-02-24  8:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99243
           Summary: internal compiler error: in set_filename, at
                    cp/module.cc:19143
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alexander.lelyakin at googlemail dot com
  Target Milestone: ---

g++ -std=c++20 -fmodules-ts -x c++-system-header algorithm
g++ -std=c++20 -fmodules-ts -x c++-system-header variant
g++ -std=c++20 -fmodules-ts -x c++-system-header iosfwd
g++ -std=c++20 -fmodules-ts -x c++-system-header ostream
g++ -std=c++20 -fmodules-ts -x c++-system-header memory
-----
/usr/local/include/c++/11.0.0/bits/shared_ptr.h:1: internal compiler error: in
set_filename, at cp/module.cc:19143
    1 | // shared_ptr and weak_ptr implementation -*- C++ -*-
      | 
0x6de59f module_state::set_filename(Cody::Packet const&)
        ../../gcc/gcc/cp/module.cc:19143
0xa56159 maybe_translate_include
        ../../gcc/gcc/cp/module.cc:19186
0xa56159 maybe_translate_include
        ../../gcc/gcc/cp/module.cc:19157
0x1ce7396 _cpp_stack_file
        ../../gcc/libcpp/files.c:913
0x1cdf36e do_include_common
        ../../gcc/libcpp/directives.c:853
0x1cdf8b8 _cpp_handle_directive
        ../../gcc/libcpp/directives.c:541
0x1cee760 _cpp_lex_token
        ../../gcc/libcpp/lex.c:2809
0x1cf6597 cpp_get_token_1
        ../../gcc/libcpp/macro.c:2839
0xbeab6e c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int)
        ../../gcc/gcc/c-family/c-lex.c:470
0xa8a166 cp_lexer_get_preprocessor_token
        ../../gcc/gcc/cp/parser.c:862
0xad43cf cp_lexer_new_main
        ../../gcc/gcc/cp/parser.c:661
0xad43cf c_parse_file()
        ../../gcc/gcc/cp/parser.c:45168
0xbf7dfd c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1218
-----
g++ (GCC) 11.0.0 20210223 (experimental)

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

* [Bug c++/99243] [modules] ICE in set_filename, at cp/module.cc:19143
  2021-02-24  8:44 [Bug c++/99243] New: internal compiler error: in set_filename, at cp/module.cc:19143 alexander.lelyakin at googlemail dot com
@ 2021-03-27  6:53 ` alexander.lelyakin at googlemail dot com
  2022-02-11 13:40 ` egor.pugin at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: alexander.lelyakin at googlemail dot com @ 2021-03-27  6:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Alexander Lelyakin <alexander.lelyakin at googlemail dot com> ---
There is a shorter sequence

/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header concepts
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header utility
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header regex
----
In file included from
/usr/local/include/c++/11.0.1/bits/stl_iterator_base_types.h:71,
                 from /usr/local/include/c++/11.0.1/bits/stl_algobase.h:65,
                 from /usr/local/include/c++/11.0.1/algorithm:61,
                 from /usr/local/include/c++/11.0.1/regex:38:
/usr/local/include/c++/11.0.1/bits/iterator_concepts.h:34: internal compiler
error: in set_filename, at cp/module.cc:19100
   34 | 
      | 
0x6e0cbb module_state::set_filename(Cody::Packet const&)
        ../../gcc/gcc/cp/module.cc:19100
0xa5a979 maybe_translate_include
        ../../gcc/gcc/cp/module.cc:19143
0xa5a979 maybe_translate_include
        ../../gcc/gcc/cp/module.cc:19114
0x1cf5606 _cpp_stack_file
        ../../gcc/libcpp/files.c:913
0x1ced69e do_include_common
        ../../gcc/libcpp/directives.c:853
0x1cedbe8 _cpp_handle_directive
        ../../gcc/libcpp/directives.c:541
0x1cfca60 _cpp_lex_token
        ../../gcc/libcpp/lex.c:2809
0x1d048c7 cpp_get_token_1
        ../../gcc/libcpp/macro.c:2839
0xbf070e c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int)
        ../../gcc/gcc/c-family/c-lex.c:470
0xa8ee76 cp_lexer_get_preprocessor_token
        ../../gcc/gcc/cp/parser.c:864
0xad93af cp_lexer_new_main
        ../../gcc/gcc/cp/parser.c:663
0xad93af c_parse_file()
        ../../gcc/gcc/cp/parser.c:45253
0xbfd98d c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1218
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
----
g++ (GCC) 11.0.1 20210326 (experimental)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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

* [Bug c++/99243] [modules] ICE in set_filename, at cp/module.cc:19143
  2021-02-24  8:44 [Bug c++/99243] New: internal compiler error: in set_filename, at cp/module.cc:19143 alexander.lelyakin at googlemail dot com
  2021-03-27  6:53 ` [Bug c++/99243] [modules] ICE " alexander.lelyakin at googlemail dot com
@ 2022-02-11 13:40 ` egor.pugin at gmail dot com
  2022-09-16  9:33 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: egor.pugin at gmail dot com @ 2022-02-11 13:40 UTC (permalink / raw)
  To: gcc-bugs

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

Egor Pugin <egor.pugin at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egor.pugin at gmail dot com

--- Comment #2 from Egor Pugin <egor.pugin at gmail dot com> ---
See explanation of this issue and the potential fix at the second part of the
PR.
https://github.com/urnathan/libcody/pull/27#issue-1132612910

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

* [Bug c++/99243] [modules] ICE in set_filename, at cp/module.cc:19143
  2021-02-24  8:44 [Bug c++/99243] New: internal compiler error: in set_filename, at cp/module.cc:19143 alexander.lelyakin at googlemail dot com
  2021-03-27  6:53 ` [Bug c++/99243] [modules] ICE " alexander.lelyakin at googlemail dot com
  2022-02-11 13:40 ` egor.pugin at gmail dot com
@ 2022-09-16  9:33 ` redi at gcc dot gnu.org
  2022-09-16  9:34 ` redi at gcc dot gnu.org
  2022-09-16  9:41 ` egor.pugin at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2022-09-16  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-09-16
     Ever confirmed|0                           |1

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Egor Pugin from comment #2)
> See explanation of this issue and the potential fix at the second part of
> the PR.
> https://github.com/urnathan/libcody/pull/27#issue-1132612910

Please provide that info here (separate from the whitespace change that was the
subject of that pull request).

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

* [Bug c++/99243] [modules] ICE in set_filename, at cp/module.cc:19143
  2021-02-24  8:44 [Bug c++/99243] New: internal compiler error: in set_filename, at cp/module.cc:19143 alexander.lelyakin at googlemail dot com
                   ` (2 preceding siblings ...)
  2022-09-16  9:33 ` redi at gcc dot gnu.org
@ 2022-09-16  9:34 ` redi at gcc dot gnu.org
  2022-09-16  9:41 ` egor.pugin at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2022-09-16  9:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |boris at kolpackov dot net

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
*** Bug 98719 has been marked as a duplicate of this bug. ***

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

* [Bug c++/99243] [modules] ICE in set_filename, at cp/module.cc:19143
  2021-02-24  8:44 [Bug c++/99243] New: internal compiler error: in set_filename, at cp/module.cc:19143 alexander.lelyakin at googlemail dot com
                   ` (3 preceding siblings ...)
  2022-09-16  9:34 ` redi at gcc dot gnu.org
@ 2022-09-16  9:41 ` egor.pugin at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: egor.pugin at gmail dot com @ 2022-09-16  9:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Egor Pugin <egor.pugin at gmail dot com> ---
Possible naive fix is to change in module.cc (void module_state::set_filename
(const Cody::Packet &packet)):

-      error_at (loc, "unknown Compiled Module Interface: %s",
                packet.GetString ().c_str ());
+      fatal_error (loc, "unknown Compiled Module Interface: %s",
                packet.GetString ().c_str ());

If we do not fail here, tons of ICEs come later because other code does not
expect such mismatches. (There can be communication error, so we do not get
same number of packets sent about querying modules, or another error.)

For example, the following function

static void
name_pending_imports (cpp_reader *reader)

iterates over responses and does not check for r_iter == response.end()

              module->set_filename (*r_iter);
              ++r_iter;

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

end of thread, other threads:[~2022-09-16  9:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24  8:44 [Bug c++/99243] New: internal compiler error: in set_filename, at cp/module.cc:19143 alexander.lelyakin at googlemail dot com
2021-03-27  6:53 ` [Bug c++/99243] [modules] ICE " alexander.lelyakin at googlemail dot com
2022-02-11 13:40 ` egor.pugin at gmail dot com
2022-09-16  9:33 ` redi at gcc dot gnu.org
2022-09-16  9:34 ` redi at gcc dot gnu.org
2022-09-16  9:41 ` egor.pugin at gmail 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).