Repository navigation
Backlog
Labels
upstream-bug根因在上游(编译器/构建工具/依赖),mcpp 只能绕过或声明为缺口
Description
Register of upstream defects mcpp depends on: compilers, linkers, standard libraries and SDKs whose behaviour mcpp works around, documents or waits for. This body is the index; each comment below is one problem.
mcpp builds itself with GCC 16.1.0 on Linux x86_64 and with LLVM 23.1.3 on macOS, on Windows and for Linux aarch64 ([toolchain] of mcpp.toml); the versions a fresh home installs are the [[default]] rows of modules/toolchain-model/data/builtin.toml. An entry states the versions it was measured with.
Rules:
- A new upstream problem gets a comment here and a row in this index, not an issue of its own. The comment states what was measured (versions, date), the symptom, the trigger, what mcpp does about it, and when the entry is retired.
- Adding or removing a workaround in mcpp, or measuring a new toolchain version, updates the entry's comment and its row.
- An upstream report or fix is linked in the row when it exists. Reports are filed upstream by the maintainers; "not filed" is the state until then.
- Walk this list before a default toolchain version or mcpp's own pin changes: each open entry is measured with the new version, and one that no longer reproduces is retired with its workaround.
- A defect of mcpp, or of a package of the mcpp ecosystem, is not an entry here.
Clang (frontend)
| ID | Problem | Upstream | mcpp | From |
|---|---|---|---|---|
| UP-01 | An exported operator template whose parameters are not all fixed by the first argument makes every importer crash on that operator | not filed; regression between 18 and 20; present in 23.1.6 | documented hazard (docs/20); state canary tests/e2e/150_… |
#256 |
| UP-02 | A full BMI from --precompile changes overload resolution in an importer (formatter<…, wchar_t> for a narrow string) |
not filed; no reduced case | not reached: importers get the reduced BMI | #424 |
| UP-03 | clang -c <reduced>.pcm exits 0 and writes an object without the definitions |
not filed; 8-line case; present in 23.1.6 | not reached: the object edge compiles the source | #424 |
| UP-04 | A builtin first looked up in a partition's purview is owned by the module; beside a global-module use it is "ambiguous" (macOS assert) |
not filed; cf. llvm/llvm-project#61931; present in 23.1.6 | nothing in the engine; two project workarounds | #632 |
| UP-05 | 23.1.0: the MSVC STL's std module fails with "reference to 'align_val_t' is ambiguous" |
fixed in 23.1.1 (llvm/llvm-project#218152) | closed: the default LLVM is 23.1.3 | #640 |
| UP-06 | On a Windows host __FILE__ keeps \ for a POSIX target under -ffile-reproducible: an ok image differs from the one built on Linux or macOS |
not filed | no build workaround; SPEC-014 §4.6: such images are built on Linux or macOS | #850 |
| UP-07 | clang 23: no C++20 coroutines on i686-pc-windows-msvc; the MSVC STL's C++23 std module does not precompile there |
a limit upstream states, not a defect | a note after the failure names the two options (docs/20) | docs/20 |
LLVM linkers
| ID | Problem | Upstream | mcpp | From |
|---|---|---|---|---|
| UP-08 | ld64.lld cannot read an SDK whose .tbd files list arm64e.x1 (xcode-27) |
fixed in LLVM 23.1.3 (backport) | closed: the default LLVM is 23.1.3 | #669 |
| UP-09 | lld-link /OPT:REF discards a locally defined function reached only through an __imp_ slot; the first call is an access violation |
not filed; 20.1.7 to 23.1.3 | static libraries state their static-API macro (staticlib feature in mcpp-index) |
#1002 |
MSVC STL
| ID | Problem | Upstream | mcpp | From |
|---|---|---|---|---|
| UP-10 | MSVC STL 14.51 with clang: std::find over a trivially comparable type wider than 8 bytes fails a static assertion |
microsoft/STL#6294 | nothing in the engine; two project workarounds (docs/20) | #609 |
GCC
| ID | Problem | Upstream | mcpp | From |
|---|---|---|---|---|
| UP-11 | 16.1: internal compiler error (segmentation fault) at import mcpp.cli;, by the shape of the import graph (get_originating_module_decl) |
not filed; no case outside mcpp; cause: the reading recursion overflows the 8 MiB stack | layout: a .cppm states its exports first, the rest after module :private; (AGENTS.md §4) |
#721, #848, #863, #968, #1044 |
| UP-12 | 16.1: an importer of an inline function body fails to read the module ("Bad file data") or links with undefined members of a standard template | not filed; reduced case on a branch | no inline helper that reaches mcpplibs.os (mcpp-plugins); a vector instead of a set in one function; modules/manifest and build/execute as written |
#905, #1044 |
| UP-13 | 16.1: internal compiler error when an importer compares a module's type whose operator== is a defaulted friend |
not filed; not a verified minimal case | nothing in the engine; a member operator== written out |
#910 |
| UP-15 | libstdc++ 16.1 on a C library other than glibc (musl): std::print writes its buffer again after a refused write; the second exception during unwinding is std::terminate |
not filed; reduced case in the entry | a whole result through mcpp::ui::document; mcpplibs.cmdline 0.4.1 write_out |
#1046 |
| UP-16 | 16.1: internal compiler error (apply_identity_attributes, cp/tree.cc:1665) when an importer assigns a function returning std::expected<std::string, E> to an imported std::function member |
not filed; no case outside the project | nothing in the engine; the project's member returns a move-only class (gitany vault::Keyring::get) |
Sunrisepeak/gitany#26 |
DPC++ (intel/llvm)
| ID | Problem | Upstream | mcpp | From |
|---|---|---|---|---|
| UP-14 | DPC++ 7.1.0: clang-offload-bundler gives every NVIDIA architecture's members to a request for one (five-part bundle IDs) |
not filed (intel/llvm) | the combination is documented as unsupported in mcpp-plugins | #899 |
The reports in the last column hold the full measurements and reproductions; they are closed in favour of this register.
Metadata
Metadata
Assignees
Labels
upstream-bug根因在上游(编译器/构建工具/依赖),mcpp 只能绕过或声明为缺口
Activity
speak-agent commentedon Nov 26, 2026
UP-01 — Clang: operator templates in a module interface make every importer crash on that operator name
Sema::AddArgumentDependentLookupCandidates, or with unboundedInstantiateFunctionDefinitionrecursion.operator*(const Matx<T,m,l>&, const Matx<T,l,n>&). The crash is keyed by name: one such declaration breaks every use of that operator in every importer. The body is irrelevant.tests/e2e/150_clang_module_operator_template.shis a state canary over the bundled LLVMs. Its table records 18–22 and has no row for 23: a row23) crashis due.speak-agent commentedon Nov 26, 2026
UP-02 — Clang: a full BMI from
--precompilechanges overload resolution in an importercall to implicitly-deleted default constructor of 'formatter<basic_string<char>, wchar_t>'— the string is instantiated asbasic_format_string<wchar_t, …>. The same sources compile against the reduced BMI of the same module.bmiOnlyFlags = " --precompile -Xclang -emit-reduced-module-interface",modules/toolchain-model/src/model.cppm).-c <reduced>.pcmsilently emits an object with no definitions #424, defect 1.speak-agent commentedon Nov 26, 2026
UP-03 — Clang:
clang -c <reduced>.pcmexits 0 and writes an object without the definitions-fmodules-reduced-bmitogether with--precompileis accepted and does nothing..pcm(src/build/schedule/policy.cppm).-c <reduced>.pcmsilently emits an object with no definitions #424, defect 2.speak-agent commentedon Nov 26, 2026
UP-04 — Clang: a builtin first looked up in a partition's purview is owned by the module; beside a global-module use it is "ambiguous"
__builtin_va_list, C++20 with a PCH).error: call to '__builtin_expect' is ambiguous, with two candidates that are the same builtin.<assert.h>expandsassertto__builtin_expect; glibc's and MSVC's do not name a builtin.assert.hwith#include_next, on the package's own include path for macOS), or make the first lookup happen in the global module fragment of every partition.speak-agent commentedon Nov 26, 2026
UP-05 — Clang 23.1.0: the MSVC STL's
stdmodule fails with "reference to 'align_val_t' is ambiguous" — fixed in 23.1.1align_val_tis ambiguous under MSVC in a module llvm/llvm-project#218152, introduced by [Sema] Add implicit std::align_val_t to std namespace DeclContext for module merging llvm/llvm-project#187347, fixed by [C++20] [Modules] Handling merging predefined decls from std llvm/llvm-project#219151 (onrelease/23.x, in clang 23.1.1).std.ixxstops invcruntime_new.h: the exportedstd::align_val_tis not merged with the declaration clang makes implicitly for aligned allocation.stdmodule fails withreference to 'align_val_t' is ambiguous(fixed in 23.1.1, llvm/llvm-project#218152) #640.speak-agent commentedon Nov 26, 2026
UP-06 — Clang on a Windows host keeps
\in__FILE__for a POSIX target under-ffile-reproduciblePreprocessor::processPathForFileMacroonly callsremove_dots(…, Style::posix), which does not treat\as a separator; the directory of an includer was joined with the host's separator.x86_64-openkal) built on Windows differs from the one built on Linux or macOS (which are identical) in two__FILE__strings of libc++abi's demangler (…/src\demangle/ItaniumDemangle.h), 3,921 bytes in all.mcpp pack --mergerefuses two digests for one path.\in__FILE__for a POSIX target under -ffile-reproducible: an ok image built on Windows differs from one built on Linux/macOS #850.speak-agent commentedon Nov 26, 2026
UP-07 — Clang 23: no C++20 coroutines on
i686-pc-windows-msvc(a limit upstream states)__cpp_impl_coroutinefor the 32-bit x86 Microsoft ABI and reports-Wcoroutines-unsupported-target. clang 22.1.8 predefines it.<coroutine>on the macro, so (1) the C++23stdmodule does not precompile (<generator>usescoroutine_handleunchecked), and (2) code that uses coroutines stops atstd::coroutine_traits type was not found.-dM -Eprobe. The options it names: build the package as C++20, or statetoolchain = "llvm@22.1.8"for that target. docs/20, "Known Toolchain Limitation: Coroutines on the 32-bit x86 Microsoft ABI".<generator>.speak-agent commentedon Nov 26, 2026
UP-08 — ld64.lld cannot read an SDK whose
.tbdfiles listarm64e.x1— fixed in LLVM 23.1.3xcode-27runner image, in the Command Line Tools SDK and in Xcode's.ld64.lld: error: could not load TAPI file at <SDK>/usr/lib/libSystem.tbd: malformed file … unknown architecture arm64e.x1-macos, followed by undefined symbols.speak-agent commentedon Nov 26, 2026
UP-09 — lld-link
/OPT:REFdiscards a locally defined function that is reached only through an__imp_slotlink.exekeeps the function.__declspec(dllimport)and the definition is in the link (LNK4217). With/OPT:REFand one section per function the slot holds the image base, and the first call is an access violation (exit 0xC0000005).dllimportby default then crashes at its first call. First seen withmcpp pack --compress xz.staticlibfeature thatdefaultimplies (compat.xz:LZMA_API_STATIC,compat.libarchive:LIBARCHIVE_STATIC, ascompat.curlandcompat.c-aresdid).speak-agent commentedon Nov 26, 2026
UP-10 — MSVC STL 14.51 with clang:
std::findover a trivially comparable type wider than 8 bytes fails a static assertion<xutility>: std::find no longer compiles with structs with defaulted equality comparison with Clang-CL microsoft/STL#6294.x86_64-pc-windows-msvcwith the MSVC STL 14.51 (Visual Studio 18); the STL 14.3x ofwindows-2022compiles the same source, and MSVC's own front end never takes the path.xutility: error: static assertion failed: unexpected sizeinstd::_Find_vectorized. The STL admits the type to its vectorized path through a clang-only trait without an upper size bound; the function implements 1-, 2-, 4- and 8-byte elements.operator==instead of a defaulted one, or an image whose STL predates 14.51. docs/20, "Known Toolchain Hazard:std::findOver a Wide Trivially Comparable Type".<xutility>: std::find no longer compiles with structs with defaulted equality comparison with Clang-CL microsoft/STL#6294 is the one the Windows runners ship.speak-agent commentedon Nov 26, 2026
UP-11 — GCC 16.1: internal compiler error (segmentation fault) at
import mcpp.cli;, by the shape of the import graphUpstream: GCC C++ modules; not filed (a reduced case outside mcpp does not exist yet).
Measured: GCC 16.1.0, x86_64-linux-gnu, on mcpp's own tree. LLVM builds the same trees. mcpp's own build stays on 16.1.0: 16.2 has a modules regression of its own (stated in GCC 16.1 segfaults compiling src/main.cpp when the module graph gains one module #863).
Symptom:
src/main.cpp:5:17: internal compiler error: Segmentation faultatimport mcpp.cli;. Backtrace where one was taken (GCC 16.1 internal compiler error in add_imported_namespace when mcpp.build.prepare gains an interface unit in its import chain #721, GCC 16.1 ICE in get_originating_module_decl while importing mcpp.cli (module import-graph shape); worked around #848):module_state::read_namespaces→add_imported_namespace→get_originating_module_decl. Every module unit compiles; only the importer fails.Cause (measured 2026-12-06, 2026.12.6.1: the command line for people and agents: help as an index, two kinds of package, a package's own sheet, strict TOML keys (#1043) #1044): the recursion that reads an imported module's namespaces deepens with the import graph reached through the importer's imports and overflows the 8 MiB stack; with
ulimit -s unlimitedthe same compilation ofsrc/main.cppsucceeds.Triggers measured, one entry because the symptom and the remedy are one (GCC 16.1 segfaults compiling src/main.cpp when the module graph gains one module #863 and GCC 16 modules: definitions in the interface of mcpp.pm.descriptor make an importer of mcpp.cli segfault at its import #968 recorded no backtrace, so their identity with the first two is by symptom):
mcpp.build.prepareand its imports, whatever it containsmcpp.cliimports; needs a three-level chain with global module fragments; two later occurrences in its commentsmain.cpp, or one more import of an existing modulemcpp.pm.descriptor) reached throughmcpp.climcpp.cliIn mcpp (the rule the tree follows, since 2026.12.6.1: the command line for people and agents: help as an index, two kinds of package, a package's own sheet, strict TOML keys (#1043) #1044, 2026.12.6.1): a
.cppmstates its exported interface first; non-exported declarations, every implementation and the imports only they need followmodule :private;, and an implementation unit is folded into its interface's fragment (AGENTS.md §4,.agents/skills/mcpp-contributing). A BMI then carries the interface and the imports it needs; the interface ofmcpp.cliimports onlystdandmcpplibs.cmdline. The earlier placement rule (declare in the interface, define in an implementation unit) is the special case of this one.Retire when: GCC 17, or a 16.x with the fix, is the toolchain mcpp builds itself with; the layout then stays as the code convention, without this reason.
To do: a generated chain of modules whose depth exceeds the default stack, with
ulimit -s unlimitedas the control, as a self-contained case; then GCC Bugzilla.Reports: GCC 16.1 internal compiler error in add_imported_namespace when mcpp.build.prepare gains an interface unit in its import chain #721, GCC 16.1 ICE in get_originating_module_decl while importing mcpp.cli (module import-graph shape); worked around #848, GCC 16.1 segfaults compiling src/main.cpp when the module graph gains one module #863, GCC 16 modules: definitions in the interface of mcpp.pm.descriptor make an importer of mcpp.cli segfault at its import #968, 2026.12.6.1: the command line for people and agents: help as an index, two kinds of package, a package's own sheet, strict TOML keys (#1043) #1044.
speak-agent commentedon Nov 26, 2026
UP-12 — GCC 16.1: an importer of an inline function body fails to read the module ("Bad file data") or links with undefined members
-std=c++23 -fmodules), Linux x86_64 (2026-11-07 to 2026-11-09).error: failed to read compiled module cluster N: Bad file dataandfatal error: failed to load binding '…'in an importer, or a link that leaves members of a standard template undefined (std::optional<std::vector<mcpplibs::os::process::grant>>'s payload;std::set<std::string>::set()).inlinefunction in a module interface whose body reaches a module with mcpplibs.os's process types; the second form with a function that returns astd::set<std::string>it built. The same sources build when the functions are notinline.modules/manifest's interfaces behindmodule :private;makes the partitions and implementation units that import them fail withfailed to read compiled module cluster: Bad file data(one specialization carried by several BMIs, merged on reading); insrc/build/execute, the private fragment reads an implicit destructor whose exception specification is not yet evaluated and treats the destructor as deleted.repro/905of mcpp-community/mcpp-plugins (src/tool.cppmat 117 lines); the reduction that needs no mcpp is still to do.inline(0.21.0; docs/plugin-development.md §4);rows_servedinmodules/manifest/src/platform_providers.cppmreturns a sorted vector instead of a set;modules/manifestandsrc/build/executestay as written, outside the private-fragment layout (2026.12.6.1: the command line for people and agents: help as an index, two kinds of package, a package's own sheet, strict TOML keys (#1043) #1044).speak-agent commentedon Nov 26, 2026
UP-13 — GCC 16.1: internal compiler error when an importer compares a module's type whose
operator==is a defaulted friendimport std, building mcpp-community/mtest 0.4.0 (2026-11-08). The code in the report is the shape of the failing units, not a verified minimal case; it was not measured again outside that tree.internal compiler error: Segmentation faultat the linefriend bool operator==(const T&, const T&) = default;.operator==written out (mtest 0.4.0,manifest/src/manifest.cppm).speak-agent commentedon Nov 26, 2026
UP-14 — DPC++ 7.1.0:
clang-offload-bundlergives every NVIDIA architecture's members to a request for one880399f4), CUDA 12.9.86, Linux x86_64 (2026-11-07).sycl-nvptx64-nvidia-cuda-sm_89) and the bundler matches them to every NVPTX request: unbundling a static archive for one architecture yields the members of all, and the device link reports duplicate definitions. The same bytes under six-part IDs with an explicit environment unbundle correctly.docs/rules.md).-c <reduced>.pcmsilently emits an object with no definitions #424 as a duplicate of this issue\in__FILE__for a POSIX target under -ffile-reproducible: an ok image built on Windows differs from one built on Linux/macOS #850 as a duplicate of this issuespeak-agent commentedon Dec 6, 2026
UP-15 — libstdc++ 16.1 on a C library other than glibc:
std::printwrites its buffer again after a refused write, and the second exception ends the program instd::terminatebits/print.h: the_File_sinkused when_GLIBCXX_USE_STDIO_LOCKINGholds and_GLIBCXX_USE_GLIBC_STDIO_EXTdoes not (musl). Not filed.x86_64-linux-musl, static, 2026-12-06. A glibc build uses the other_File_sinkand does not show it.std::print:terminate called after throwing an instance of 'std::system_error',what(): Broken pipe, SIGABRT. The handler forstd::system_erroris never reached. strace shows one block written twice, both writesEPIPE.__stackbuf_size<char>(256-byte) buffer._M_overflowwrites it withfwrite_unlockedand throws on a short write without resetting the buffer;~_File_sink() noexcept(false)calls_M_overflow()again while that exception unwinds, and a second exception thrown during unwinding isstd::terminate.signal(SIGPIPE, SIG_IGN); setvbuf(stdout, nullptr, _IOLBF, 0);thentry { std::print("{}", text); } catch (const std::system_error&) { return 3; }with 40 lines of 37 bytes and a standard output whose reader has closed: built forx86_64-linux-muslthe program ends by SIGABRT, built forx86_64-linux-gnuit returns 3.mcpp::ui::document, the ui's one writer: onefwrite, and a closed reader ends mcpp by SIGPIPE after the ordered finish. mcpplibs.cmdline 0.4.1 writes its help, version, completions and sheets withwrite_out: onefwrite, one exception. e2e 941 holds--help, two sheets, a JSON envelope and--protocol-versionwith a closed reader. Since mcpp 2026.12.6.2;--helpreached the defect in 2026.12.6.1, the other texts before.speak-agent commentedon Dec 6, 2026
UP-16 — GCC 16.1: internal compiler error in
apply_identity_attributeswhen a function returningstd::expected<std::string, E>is stored in an importedstd::functionmemberimport std(mcpp 2026.11.20.1, Linux x86_64, 2026-12-06), building Sunrisepeak/gitany's unit tests at 2026.12.6.1 with one change:gitany::vault::Keyring::get(astd::functionmember of a struct exported bygitany.vault) returningmcpplibs::os::result<std::string>, i.e.std::expected<std::string, mcpplibs::os::error>, where 2026.12.6.1 returnsresult<os::keyring::secret>. A 40-line case with the same shape outside that tree (one module exporting the struct, a test TU assigning a function to the member) compiles; not reduced further. GCC 16.2.0 not measured (this home's 16.2.0 pairs with binutils 2.42, which rejects its.base64).tests/unit/keyring.cpp, a non-module unit importinggitany.vault,gitany.auth,gitany.config,mcpplibs.os.keyring) ends withinternal compiler error: in apply_identity_attributes, at cp/tree.cc:1665atk.get = &fake_get;, wherefake_getreturnsos::result<std::string>.os::keyring::secret) instead ofstd::string(gitany 2026.12.6.1,src/vault.cppm), which the design preferred anyway (a secret is not copied).