[Bug c++/83372] Compiler segfaults building Mir
dmalcolm at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Feb 9 23:18:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83372
--- Comment #13 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(In reply to David Malcolm from comment #12)
> Turning the cgraphunit.c:493
> gcc_collect ();
> into
> selftest::forcibly_ggc_collect ();
> and removing the:
> --param ggc-min-expand=0 --param ggc-min-heapsize=0
> allows it to be reproduced in a few seconds, rather than many minutes.
Sadly, I got it wrong; I wasn't honoring the "nocollect" flag here; reproducing
this still takes a long time, and I tend to see:
virtual memory exhausted: can't allocate 4072 bytes.
from gdb which is making it hard to debug.
That said, I managed to trap this under the gdb; it's failing here:
#4 0x0000000000a181f1 in gt_ggc_mx<deferred_access_check> (v=0x7ffe425ca6c0)
at ../../src/gcc/vec.h:1203
1203 gt_ggc_mx ((*v)[i]);
(gdb) p *v
$2 = {m_vecpfx = {m_alloc = 1919901535, m_using_auto_storage = 0, m_num =
1953709151}, m_vecdata = {{binfo = 0x75665f73693a3a64,
decl = 0x763c6e6f6974636e, diag_decl = 0x26262a282064696f, loc =
1803036713}}}
#6 0x0000000000a15a3c in gt_ggc_mx_tree_check (x_p=0x7ffe425cd3f0) at
./gt-cp-parser.h:57
57 gt_ggc_m_32vec_deferred_access_check_va_gc_ ((*x).checks);
(gdb) list
52 {
53 struct tree_check * const x = (struct tree_check *)x_p;
54 if (ggc_test_and_set_mark (x))
55 {
56 gt_ggc_m_9tree_node ((*x).value);
57 gt_ggc_m_32vec_deferred_access_check_va_gc_ ((*x).checks);
58 gt_ggc_m_9tree_node ((*x).qualifying_scope);
59 }
60 }
(gdb) p *x
$4 = {value = 0x7ffe4295b7e0, checks = 0x7ffe425ca6c0, qualifying_scope = 0x0}
(gdb) p x->value
$5 = (tree) 0x7ffe4295b7e0
(gdb) call debug (x->value)
[tcsetpgrp failed in terminal_inferior: No such process]
full-name "class std::unique_ptr<xkb_state, void (*)(xkb_state*)>"
needs-constructor needs-destructor X() has-type-conversion X(constX&)
this=(X&) n_parents=0 use_template=1 interface-unknown
Given that it's failing when collecting a deferred_access_check, it sounds like
this could be a dup of Nathan's issue:
[PR c++/84263] GC ICE with decltype
https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00435.html
where that patch fixes a GC issue with deferring_access_checks.
I'm going to try with and without Nathan's patch to see if his patch affects
it.
More information about the Gcc-bugs
mailing list