public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107191] New: [modules] ICE when importing module partition (internal compiler error: in tree_node, at cp/module.cc:9061)
@ 2022-10-09 11:08 tortoise_74 at yahoo dot co.uk
  2022-10-09 11:35 ` [Bug c++/107191] " tortoise_74 at yahoo dot co.uk
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tortoise_74 at yahoo dot co.uk @ 2022-10-09 11:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107191
           Summary: [modules] ICE when importing module partition
                    (internal compiler error: in tree_node, at
                    cp/module.cc:9061)
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tortoise_74 at yahoo dot co.uk
  Target Milestone: ---

Created attachment 53681
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53681&action=edit
Sample code to reproduce the above

I have been trying to create a module composed of 2 partitions one of which
imports the other.
This gives me the error as below:

```
[ 25%] Building CXX object CMakeFiles/gccice.dir/Foo.cpp.o
/usr/bin/c++   -fmodules-ts -std=gnu++20 -MD -MT
CMakeFiles/gccice.dir/Foo.cpp.o -MF CMakeFiles/gccice.dir/Foo.cpp.o.d -o
CMakeFiles/gccice.dir/Foo.cpp.o -c /home/brucea/projects/jobs/gccice/Foo.cpp
/home/brucea/projects/jobs/gccice/Foo.cpp:2:8: internal compiler error: in
tree_node, at cp/module.cc:9061
    2 | export module Foo;
      |        ^~~~~~
0x7fe43f807d8f __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
0x7fe43f807e3f __libc_start_main_impl
        ../csu/libc-start.c:392
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.
make[2]: *** [CMakeFiles/gccice.dir/build.make:76:
CMakeFiles/gccice.dir/Foo.cpp.o] Error 1
make[2]: Leaving directory '/home/brucea/projects/jobs/gccice/target'
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/gccice.dir/all] Error 2
make[1]: Leaving directory '/home/brucea/projects/jobs/gccice/target'
```

I thought this might be the same as
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99769
The line number is different but I am using the ubuntu version of gcc which
might have small differences:

> gcc --version
gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0


In trying to create a reproducer I have encountered different errors:

```
/tmp/codetest/Foo.cpp:2:8: internal compiler error: in tree_node, at
cp/module.cc:9061
    2 | export module Foo;
      |        ^~~~~~
0xe3223b internal_error(char const*, ...)
        ???:0
0xe28d63 fancy_abort(char const*, int, char const*)
        ???:0
0x9dd5e6 trees_out::tree_node(tree_node*)
        ???:0
0x9ddbdf trees_out::core_vals(tree_node*)
        ???:0
0x9de4ba trees_out::tree_node_vals(tree_node*)
        ???:0
0x9df707 trees_out::tree_value(tree_node*)
        ???:0
0x9dd60d trees_out::tree_node(tree_node*)
        ???:0
0x9ddbdf trees_out::core_vals(tree_node*)
        ???:0
0x9de4ba trees_out::tree_node_vals(tree_node*)
        ???:0
0x9df707 trees_out::tree_value(tree_node*)
        ???:0
0x9dd60d trees_out::tree_node(tree_node*)
        ???:0
0x9ddbdf trees_out::core_vals(tree_node*)
        ???:0
0x9de4ba trees_out::tree_node_vals(tree_node*)
        ???:0
0x9df707 trees_out::tree_value(tree_node*)
        ???:0
0x9dd60d trees_out::tree_node(tree_node*)
        ???:0
0x9ddbdf trees_out::core_vals(tree_node*)
        ???:0
0x9de4ba trees_out::tree_node_vals(tree_node*)
        ???:0
0x9df707 trees_out::tree_value(tree_node*)
        ???:0
0x9dd60d trees_out::tree_node(tree_node*)
        ???:0
0x9ddbdf trees_out::core_vals(tree_node*)
        ???:0
Please submit a full bug report,
```

And by just adding #include <string>:

```
 50%] Building CXX object CMakeFiles/gccice.dir/Snafu.cpp.o
/usr/bin/c++   -fmodules-ts -std=gnu++20 -MD -MT
CMakeFiles/gccice.dir/Snafu.cpp.o -MF CMakeFiles/gccice.dir/Snafu.cpp.o.d -o
CMakeFiles/gccice.dir/Snafu.cpp.o -c /tmp/codetest/Snafu.cpp
In file included from /usr/include/c++/11/bits/locale_classes.h:857,
                 from /usr/include/c++/11/bits/ios_base.h:41,
                 from /usr/include/c++/11/ios:42,
                 from /usr/include/c++/11/istream:38,
                 from /usr/include/c++/11/sstream:38,
                 from /tmp/codetest/Bar.cpp:7,
of module Foo:Bar, imported at /tmp/codetest/Snafu.cpp:9:
/usr/include/c++/11/bits/locale_classes.tcc: In instantiation of 'const _Facet&
std::use_facet(const std::locale&) [with _Facet =
std::__cxx11::numpunct<char>]':
/usr/include/c++/11/bits/locale_facets.tcc:80:66:   required from 'void
std::__numpunct_cache@Foo:Bar<_CharT>::_M_cache(const std::locale&) [with
_CharT = char]'
/usr/include/c++/11/bits/locale_facets.tcc:63:18:   required from 'const
std::__numpunct_cache@Foo:Bar<_CharT>*
std::__use_cache@Foo:Bar<std::__numpunct_cache@Foo:Bar<_CharT>
>::operator()(const std::locale&) const [with _CharT = char]'
/usr/include/c++/11/bits/locale_facets.tcc:384:33:   required from '_InIter
std::num_get<_CharT, _InIter>::_M_extract_int(_InIter, _InIter, std::ios_base&,
std::ios_base::iostate&, _ValueT&) const [with _ValueT = long int; _CharT =
char; _InIter = std::istreambuf_iterator<char, std::char_traits<char> >;
std::ios_base::iostate = std::ios_base::iostate]'
/usr/include/c++/11/bits/locale_facets.h:2220:30:   required from
'std::num_get<_CharT, _InIter>::iter_type std::num_get<_CharT,
_InIter>::do_get(std::num_get<_CharT, _InIter>::iter_type, std::num_get<_CharT,
_InIter>::iter_type, std::ios_base&, std::ios_base::iostate&, long int&) const
[with _CharT = char; _InIter = std::istreambuf_iterator<char,
std::char_traits<char> >; std::num_get<_CharT, _InIter>::iter_type =
std::istreambuf_iterator<char, std::char_traits<char> >; std::ios_base::iostate
= std::ios_base::iostate]'
/usr/include/c++/11/bits/locale_facets.h:2218:7:   required from here
/usr/include/c++/11/bits/locale_classes.tcc:135:40: internal compiler error: in
tsubst_copy, at cp/pt.c:16663
  135 |       const locale::facet** __facets = __loc._M_impl->_M_facets;
      |                                        ^~~~~
0xe3223b internal_error(char const*, ...)
        ???:0
0xe28d63 fancy_abort(char const*, int, char const*)
        ???:0
0x10ddc30 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ???:0
0x10de120 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ???:0
0x10de00e tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ???:0
0x10de843 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ???:0
0x10de00e tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ???:0
0x11709a7 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ???:0
0x1170ced tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ???:0
0x1170a93 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ???:0
0x1170a05 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ???:0
0x122bbfa instantiate_decl(tree_node*, bool, bool)
        ???:0
0xfa8a00 instantiate_pending_templates(int)
        ???:0
0xfa4663 c_parse_final_cleanups()
        ???:0
Please submit a full bug report,
```

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

* [Bug c++/107191] [modules] ICE when importing module partition (internal compiler error: in tree_node, at cp/module.cc:9061)
  2022-10-09 11:08 [Bug c++/107191] New: [modules] ICE when importing module partition (internal compiler error: in tree_node, at cp/module.cc:9061) tortoise_74 at yahoo dot co.uk
@ 2022-10-09 11:35 ` tortoise_74 at yahoo dot co.uk
  2022-10-09 15:31 ` tortoise_74 at yahoo dot co.uk
  2024-02-15 20:16 ` ppalka at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: tortoise_74 at yahoo dot co.uk @ 2022-10-09 11:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Bruce Adams <tortoise_74 at yahoo dot co.uk> ---
I also produced a different segfault while trying to reproduce this - see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107192

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

* [Bug c++/107191] [modules] ICE when importing module partition (internal compiler error: in tree_node, at cp/module.cc:9061)
  2022-10-09 11:08 [Bug c++/107191] New: [modules] ICE when importing module partition (internal compiler error: in tree_node, at cp/module.cc:9061) tortoise_74 at yahoo dot co.uk
  2022-10-09 11:35 ` [Bug c++/107191] " tortoise_74 at yahoo dot co.uk
@ 2022-10-09 15:31 ` tortoise_74 at yahoo dot co.uk
  2024-02-15 20:16 ` ppalka at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: tortoise_74 at yahoo dot co.uk @ 2022-10-09 15:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Bruce Adams <tortoise_74 at yahoo dot co.uk> ---
Also tried with gcc 12.1

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

```
/usr/bin/g++-12   -fmodules-ts -std=gnu++20 -MD -MT
CMakeFiles/gccice.dir/Foo.cpp.o -MF CMakeFiles/gccice.dir/Foo.cpp.o.d -o
CMakeFiles/gccice.dir/Foo.cpp.o -c /home/brucea/projects/jobs/gccice/Foo.cpp
/home/brucea/projects/jobs/gccice/Foo.cpp:2:8: internal compiler error: in
tree_node, at cp/module.cc:9078
    2 | export module Foo;
      |        ^~~~~~
0x65fabd trees_out::tree_node(tree_node*)
        ../../src/gcc/cp/module.cc:9078
0x78a72b trees_out::core_vals(tree_node*)
        ../../src/gcc/cp/module.cc:5922
0x78e3bf trees_out::tree_node_vals(tree_node*)
        ../../src/gcc/cp/module.cc:7072
0x78e3bf trees_out::tree_value(tree_node*)
        ../../src/gcc/cp/module.cc:8909
0x787354 trees_out::tree_node(tree_node*)
        ../../src/gcc/cp/module.cc:9107
0x78a72b trees_out::core_vals(tree_node*)
```

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

* [Bug c++/107191] [modules] ICE when importing module partition (internal compiler error: in tree_node, at cp/module.cc:9061)
  2022-10-09 11:08 [Bug c++/107191] New: [modules] ICE when importing module partition (internal compiler error: in tree_node, at cp/module.cc:9061) tortoise_74 at yahoo dot co.uk
  2022-10-09 11:35 ` [Bug c++/107191] " tortoise_74 at yahoo dot co.uk
  2022-10-09 15:31 ` tortoise_74 at yahoo dot co.uk
@ 2024-02-15 20:16 ` ppalka at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-02-15 20:16 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |14.0
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
GCC 14 no longer ICEs.

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

end of thread, other threads:[~2024-02-15 20:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-09 11:08 [Bug c++/107191] New: [modules] ICE when importing module partition (internal compiler error: in tree_node, at cp/module.cc:9061) tortoise_74 at yahoo dot co.uk
2022-10-09 11:35 ` [Bug c++/107191] " tortoise_74 at yahoo dot co.uk
2022-10-09 15:31 ` tortoise_74 at yahoo dot co.uk
2024-02-15 20:16 ` ppalka 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).