* [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; 14+ 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] 14+ 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; 14+ 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] 14+ messages in thread
* [Bug c++/42355] Segmentation fault
2009-12-12 1:34 [Bug c++/42355] New: Segmentation fault peter_foelsche at agilent dot com
@ 2009-12-12 1:35 ` peter_foelsche at agilent dot com
2009-12-12 1:36 ` peter_foelsche at agilent dot com
` (10 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: peter_foelsche at agilent dot com @ 2009-12-12 1:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from peter_foelsche at agilent dot com 2009-12-12 01:34 -------
Created an attachment (id=19280)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19280&action=view)
console output of the compiler
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42355
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/42355] Segmentation fault
2009-12-12 1:34 [Bug c++/42355] New: Segmentation fault peter_foelsche at agilent dot com
2009-12-12 1:35 ` [Bug c++/42355] " peter_foelsche at agilent dot com
@ 2009-12-12 1:36 ` peter_foelsche at agilent dot com
2009-12-12 1:38 ` peter_foelsche at agilent dot com
` (9 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: peter_foelsche at agilent dot com @ 2009-12-12 1:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from peter_foelsche at agilent dot com 2009-12-12 01:36 -------
maybe on Monday I can create an instance like described of the offending
classes
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42355
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/42355] Segmentation fault
2009-12-12 1:34 [Bug c++/42355] New: Segmentation fault peter_foelsche at agilent dot com
2009-12-12 1:35 ` [Bug c++/42355] " peter_foelsche at agilent dot com
2009-12-12 1:36 ` peter_foelsche at agilent dot com
@ 2009-12-12 1:38 ` peter_foelsche at agilent dot com
2009-12-12 1:40 ` peter_foelsche at agilent dot com
` (8 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: peter_foelsche at agilent dot com @ 2009-12-12 1:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from peter_foelsche at agilent dot com 2009-12-12 01:37 -------
the compiler takes more than 10GB of RAM.
There is 40GB of RAM available.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42355
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/42355] Segmentation fault
2009-12-12 1:34 [Bug c++/42355] New: Segmentation fault peter_foelsche at agilent dot com
` (2 preceding siblings ...)
2009-12-12 1:38 ` peter_foelsche at agilent dot com
@ 2009-12-12 1:40 ` peter_foelsche at agilent dot com
2009-12-13 15:04 ` rguenth at gcc dot gnu dot org
` (7 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: peter_foelsche at agilent dot com @ 2009-12-12 1:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from peter_foelsche at agilent dot com 2009-12-12 01:40 -------
the same happens with boost 1_40
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42355
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/42355] Segmentation fault
2009-12-12 1:34 [Bug c++/42355] New: Segmentation fault peter_foelsche at agilent dot com
` (3 preceding siblings ...)
2009-12-12 1:40 ` peter_foelsche at agilent dot com
@ 2009-12-13 15:04 ` rguenth at gcc dot gnu dot org
2009-12-15 20:59 ` peter_foelsche at agilent dot com
` (6 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-12-13 15:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from rguenth at gcc dot gnu dot org 2009-12-13 15:04 -------
Please update to 4.4.2 at least. Without a testcase we can't do anything
here.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42355
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/42355] Segmentation fault
2009-12-12 1:34 [Bug c++/42355] New: Segmentation fault peter_foelsche at agilent dot com
` (4 preceding siblings ...)
2009-12-13 15:04 ` rguenth at gcc dot gnu dot org
@ 2009-12-15 20:59 ` peter_foelsche at agilent dot com
2009-12-26 14:05 ` paolo dot carlini at oracle dot com
` (5 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: peter_foelsche at agilent dot com @ 2009-12-15 20:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from peter_foelsche at agilent dot com 2009-12-15 20:58 -------
Created an attachment (id=19313)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19313&action=view)
tmp.cpp
g++ -c tmp.cpp -I ~/boost_1_40_0 -g
-g is important
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42355
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/42355] Segmentation fault
2009-12-12 1:34 [Bug c++/42355] New: Segmentation fault peter_foelsche at agilent dot com
` (5 preceding siblings ...)
2009-12-15 20:59 ` peter_foelsche at agilent dot com
@ 2009-12-26 14:05 ` paolo dot carlini at oracle dot com
2009-12-26 14:06 ` paolo dot carlini at oracle dot com
` (4 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-12-26 14:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from paolo dot carlini at oracle dot com 2009-12-26 14:04 -------
Please provide a self-contained .ii, see:
http://gcc.gnu.org/bugs/#report
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42355
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/42355] Segmentation fault
2009-12-12 1:34 [Bug c++/42355] New: Segmentation fault peter_foelsche at agilent dot com
` (6 preceding siblings ...)
2009-12-26 14:05 ` paolo dot carlini at oracle dot com
@ 2009-12-26 14:06 ` paolo dot carlini at oracle dot com
2010-01-04 18:12 ` peter_foelsche at agilent dot com
` (3 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-12-26 14:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from paolo dot carlini at oracle dot com 2009-12-26 14:06 -------
Also, please do your best to minimize it, see:
http://gcc.gnu.org/wiki/A_guide_to_testcase_reduction
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42355
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/42355] Segmentation fault
2009-12-12 1:34 [Bug c++/42355] New: Segmentation fault peter_foelsche at agilent dot com
` (7 preceding siblings ...)
2009-12-26 14:06 ` paolo dot carlini at oracle dot com
@ 2010-01-04 18:12 ` peter_foelsche at agilent dot com
2010-01-04 19:45 ` rguenth at gcc dot gnu dot org
` (2 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: peter_foelsche at agilent dot com @ 2010-01-04 18:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from peter_foelsche at agilent dot com 2010-01-04 18:12 -------
Created an attachment (id=19464)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19464&action=view)
tmp.ii
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42355
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/42355] Segmentation fault
2009-12-12 1:34 [Bug c++/42355] New: Segmentation fault peter_foelsche at agilent dot com
` (8 preceding siblings ...)
2010-01-04 18:12 ` peter_foelsche at agilent dot com
@ 2010-01-04 19:45 ` rguenth at gcc dot gnu dot org
2010-01-04 20:00 ` peter_foelsche at agilent dot com
2010-01-08 21:37 ` peter_foelsche at agilent dot com
11 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-01-04 19:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from rguenth at gcc dot gnu dot org 2010-01-04 19:45 -------
A random backtrace from where we take endless time and memory:
#0 0x00000000007b8a46 in pp_c_type_qualifier_list (pp=0x18b6280,
t=0x7ffff56b8dc8)
at /space/rguenther/src/svn/trunk/gcc/c-pretty-print.c:245
#1 0x00000000006174be in dump_aggr_type (t=0x7ffff56b8dc8, flags=4100)
at /space/rguenther/src/svn/trunk/gcc/cp/error.c:560
#2 0x00000000006161a2 in dump_type (t=0x7ffff56b8dc8, flags=4100)
at /space/rguenther/src/svn/trunk/gcc/cp/error.c:384
#3 0x0000000000614a83 in dump_template_argument (arg=0x7ffff56b8dc8,
flags=4100) at /space/rguenther/src/svn/trunk/gcc/cp/error.c:152
#4 0x0000000000620afd in dump_template_parms (info=0x7ffff59b80e0, primary=0,
flags=4100) at /space/rguenther/src/svn/trunk/gcc/cp/error.c:1513
#5 0x0000000000618acf in dump_aggr_type (t=0x7ffff59bcbd0, flags=4100)
at /space/rguenther/src/svn/trunk/gcc/cp/error.c:622
#6 0x00000000006161a2 in dump_type (t=0x7ffff59bcbd0, flags=4100)
at /space/rguenther/src/svn/trunk/gcc/cp/error.c:384
...
#88 0x0000000000620afd in dump_template_parms (info=0x7ffff1f7f4a0, primary=0,
flags=4100) at /space/rguenther/src/svn/trunk/gcc/cp/error.c:1513
#89 0x0000000000618acf in dump_aggr_type (t=0x7ffff1f922a0, flags=4100)
at /space/rguenther/src/svn/trunk/gcc/cp/error.c:622
#90 0x00000000006161a2 in dump_type (t=0x7ffff1f922a0, flags=6148)
at /space/rguenther/src/svn/trunk/gcc/cp/error.c:384
#91 0x000000000061a447 in dump_decl (t=0x7ffff1f88cf0, flags=6148)
at /space/rguenther/src/svn/trunk/gcc/cp/error.c:909
#92 0x0000000000626eb5 in decl_as_string (decl=0x7ffff1f88cf0, flags=6148)
at /space/rguenther/src/svn/trunk/gcc/cp/error.c:2357
#93 0x000000000049fdec in cxx_dwarf_name (t=0x7ffff1f88cf0, verbosity=2)
at /space/rguenther/src/svn/trunk/gcc/cp/cp-lang.c:144
#94 0x00000000008d4e36 in type_tag (type=0x7ffff1f922a0)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:16764
#95 0x00000000008db989 in gen_struct_or_union_type_die (type=0x7ffff1f922a0,
context_die=0x7ffff5694528, usage=DINFO_USAGE_DIR_USE)
at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18618
I guess these are _very_ long names (why again don't we output them
in mangled form?). C++ component again.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|debug |c++
Keywords| |compile-time-hog, memory-hog
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42355
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/42355] Segmentation fault
2009-12-12 1:34 [Bug c++/42355] New: Segmentation fault peter_foelsche at agilent dot com
` (9 preceding siblings ...)
2010-01-04 19:45 ` rguenth at gcc dot gnu dot org
@ 2010-01-04 20:00 ` peter_foelsche at agilent dot com
2010-01-08 21:37 ` peter_foelsche at agilent dot com
11 siblings, 0 replies; 14+ messages in thread
From: peter_foelsche at agilent dot com @ 2010-01-04 20:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from peter_foelsche at agilent dot com 2010-01-04 20:00 -------
(In reply to comment #10)
> Please also provide output of g++ -v. If you manage to compile this
> successfully then the output of -ftime-report will also be interesting.
> Confirmed with -g (-g0 is very fast and lean). G++ 4.1 doesn't want to
> grok the testcase.
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/users/pfoelsch
--with-mpfr=/users/pfoelsch --with-gmp=/users/pfoelsch
Thread model: posix
gcc version 4.4.2 (GCC)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42355
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/42355] Segmentation fault
2009-12-12 1:34 [Bug c++/42355] New: Segmentation fault peter_foelsche at agilent dot com
` (10 preceding siblings ...)
2010-01-04 20:00 ` peter_foelsche at agilent dot com
@ 2010-01-08 21:37 ` peter_foelsche at agilent dot com
11 siblings, 0 replies; 14+ messages in thread
From: peter_foelsche at agilent dot com @ 2010-01-08 21:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from peter_foelsche at agilent dot com 2010-01-08 21:37 -------
boost::mpl::sort seems to be known to be a memory hog.
Also on other platforms.
I replaced this with other code.
--
peter_foelsche at agilent dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42355
^ permalink raw reply [flat|nested] 14+ messages in thread