https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120013
Bug ID: 120013 Summary: SIGSEGV ICE with modules related to instantiation of templates across partition units Product: gcc Version: 15.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: miuna.oshino at gmail dot com Target Milestone: --- Issue originally discussed in a C++ Discord community. I am not familiar with g++'s internals at all so take my observations with a grain of salt. > In all cases g++ crashes because of including certain std headers in `hewwo` > in the partition chain `hewwo -> uwu -> owo`. > Many headers cause this, but we will use <chrono> as a scapegoat because it > is my sworn enemy > > CRASH 1: `export std::array<char, 5> owo;`, the original scenario: > <https://godbolt.org/z/c7cMP3roE> > - `hewwo`: Variable with <chrono> > - `uwu`: Alias to DIFFERENT array (no chrono) > - `owo`: Variable of DIFFERENT array WITH <chrono> > - Including <chrono> in all 3 fixes it. > - Referencing `hewwo`'s array instantiation in `uwu` is ok > - `export` or not doesn't change anything at all, on any of the 3 symbols > > CRASH 2: `export import :uwu;` <https://godbolt.org/z/h3Te6G6cx> > - `hewwo`: Variable with <chrono> > - `uwu`: Alias to DIFFERENT array **(no chrono)** > - `owo`: Variable of DIFFERENT array **(no chrono)** > - Happens when `owo` does not have <chrono>. > - Including <chrono> in `uwu` but NOT in `owo` changes the crash to `export > import :owo;` (passes through uwu without an issue) > - Removing the instantiation of a different array symbol in `uwu` changes the > crash to `export import :owo;`. (passes through uwu without an issue) > - Including <chrono> in all 3 fixes it. > - `export` or not doesn't change anything at all, on any of the 3 symbols > - Maybe same as crash 1 but different context for diagnostics? > > CRASH 3: some iterator stuff <https://godbolt.org/z/oa1T1MfG5> > - `hewwo`: Variable with <chrono> > - `uwu`: Alias to DIFFERENT array **(no chrono)** > - `owo`: **NOTHING**, but WITH <chrono> > - Including <chrono> in all 3 fixes it. > - Eerily similar again, wondering if it's just the same issue > - **This one does give some information** > > I feel like crash 1 and 2 are red herrings, and crash 3 gives real information > **Again in all 3 cases the crash happens because we include <chrono> (or > other specific headers) in `hewwo` with those array definitions, but NOT in > importing modules.** > > Crash #3 makes me think a chain of 3 module units is required for this bug