You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GCC 16 modules: definitions in the interface of mcpp.pm.descriptor make an importer of mcpp.cli segfault at its import #968
GCC 16.1.0 (-std=c++23 -fmodules, the payload gcc@16.1.0, Linux x86_64) segfaults compiling src/main.cpp of mcpp, at its second line that imports a module:
It happened when a new module interface, mcpp.pm.descriptor (src/pm/descriptor.cppm, reached from mcpp.cli through the package-management modules), defined its functions in the interface unit: descriptor_is_inline, descriptor_payload_present and descriptor_manifest, each returning std::expected<..., std::string> over a DescriptorManifest that holds a std::optional<mcpp::manifest::Manifest>. The interface itself compiled; src/main.cpp, which reaches it through mcpp.cli, did not.
The same sources build when the interface declares the functions and a module implementation unit (src/pm/descriptor.cpp) defines them: the importer then sees declarations only.
Reproduction
mcpp at 0ca2a18a (mcpp#960): move the definitions of src/pm/descriptor.cpp into src/pm/descriptor.cppm below the declarations, remove descriptor.cpp, and run mcpp build with gcc@16.1.0. The reduction to a self-contained case has not been made.
Workaround in place
0ca2a18a: the interface declares, the implementation unit defines. This follows the workaround of #905 (function bodies that importers do not need are compiled once, in their module's object).
Upstream
Not reported to GCC yet; a reduced case is needed first.
Activity