On Feb 18, 2021, at 6:15 AM, Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > On Wed, Feb 17, 2021 at 01:46:37PM -0500, Nathan Sidwell wrote: >> I'd missed that macros were allocated from GC storage, and that they can >> become unattached from an identifier, and therefore not GC-reachable. >> And then bad things happen. Fixed by making the module machinery's >> reference vector a GC root. >> >> PR c++/99023 >> gcc/cp/ >> * module.cc (struct macro_export): Add GTY markers. >> (macro_exports): Likewise, us a va_gc Vector. >> gcc/testsuite/ >> * g++.dg/modules/pr99023_a.H: New. >> * g++.dg/modules/pr99023_b.H: New. > > I must say I don't know much about modules, but seeing the second set > of > 100KB g++.dg/modules/ testcases
Indeed, a test case that shows a memory error, likely is misguided at any size as we don't have a system to reliably detect when we are wondering outside the GTY sandbox.