public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42355] Segmentation fault
       [not found] <bug-42355-4@http.gcc.gnu.org/bugzilla/>
@ 2021-12-10  6:58 ` pinskia at gcc dot gnu.org
  2024-02-20 13:51 ` [Bug c++/42355] Segmentation fault with -g rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-10  6:58 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2010-01-04 19:39:44         |2021-12-9
      Known to fail|                            |

--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Interesting clang is able to compile this reasonably but GCC and ICC have a
hard time.

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

* [Bug c++/42355] Segmentation fault with -g
       [not found] <bug-42355-4@http.gcc.gnu.org/bugzilla/>
  2021-12-10  6:58 ` [Bug c++/42355] Segmentation fault pinskia at gcc dot gnu.org
@ 2024-02-20 13:51 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-02-20 13:51 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2021-12-09 00:00:00         |2024-2-20
                 CC|                            |rguenth at gcc dot gnu.org
            Summary|Segmentation fault          |Segmentation fault with -g

--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> ---
Re-confirmed.  GCC 14 crashed on me after allocating > 30GB of memory at

/users/pfoelsch/boost_1_41_0/boost/mpl/joint_view.hpp:44:8: internal compiler
error: Segmentation fault
0xf042a2 crash_signal
        /space/rguenther/src/gcc-forceslp/gcc/toplev.cc:317
0xefd3c3 ggc_alloc_string(char const*, int)
        /space/rguenther/src/gcc-forceslp/gcc/stringpool.cc:92
0x8292be pp_ggc_formatted_text(pretty_printer*)
        /space/rguenther/src/gcc-forceslp/gcc/cp/error.cc:3171
0x8292be decl_as_string(tree_node*, int)
        /space/rguenther/src/gcc-forceslp/gcc/cp/error.cc:3224
0x8292be decl_as_dwarf_string(tree_node*, int)
        /space/rguenther/src/gcc-forceslp/gcc/cp/error.cc:3212
0xae0fe4 type_tag
        /space/rguenther/src/gcc-forceslp/gcc/dwarf2out.cc:22459
0xb0bb08 gen_struct_or_union_type_die
        /space/rguenther/src/gcc-forceslp/gcc/dwarf2out.cc:26020
...

it seems to be an inherent issue with the way we produce DWARF for the
types here, possibly duplicating a lot of long DW_AT_name strings
(30GB worth of it).

Changing the testcase to have

typedef CDer1<8>::type CDer12;
typedef CDer<
 boost::mpl::set<
  boost::mpl::long_<5>,
  boost::mpl::long_<4>,
  boost::mpl::long_<3>,
  boost::mpl::long_<2>,
  boost::mpl::long_<1>,
  boost::mpl::long_<0>
 >
> CDer9;

makes it "only" take 3.5GB and finish compiling.

You then can see things like

 <3><e59>: Abbrev Number: 29 (DW_TAG_structure_type)
    <e5a>   DW_AT_name        : (indirect string, offset: 0x629):
s_item<mpl_::long_<4>, boost::mpl::s_item<mpl_::long_<5>,
boost::mpl::set0<mpl_::na> > >

or

 <1><18a5>: Abbrev Number: 29 (DW_TAG_structure_type)
    <18a6>   DW_AT_name        : (indirect string, offset: 0x1b7f):
CDer<boost::
mpl::s_item<mpl_::long_<7>, boost::mpl::s_item<mpl_::long_<6>,
boost::mpl::s_ite
m<mpl_::long_<5>, boost::mpl::s_item<mpl_::long_<4>,
boost::mpl::s_item<mpl_::lo
ng_<3>, boost::mpl::s_item<mpl_::long_<2>, boost::mpl::s_item<mpl_::long_<1>,
bo
ost::mpl::s_item<mpl_::long_<0>, boost::mpl::set0<mpl_::na> > > > > > > > >,
dou
ble>

and worse.

Interestingly enough we still end up throwing most stuff away ending up
with just an 20kb object file.

So I just guess we're somehow "recursively" building up the above strings,
not re-using substrings but exponentially grow memory usage when producing
them.

There's definitely a cycle involving dump_type and dump_template_argument.

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-42355-4@http.gcc.gnu.org/bugzilla/>
2021-12-10  6:58 ` [Bug c++/42355] Segmentation fault pinskia at gcc dot gnu.org
2024-02-20 13:51 ` [Bug c++/42355] Segmentation fault with -g rguenth 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).