[clang] [clang][deps] Keep module cache in memory (PR #192347)

Peter Smith via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 28 08:50:41 PDT 2026


smithp35 wrote:

One of our internal builds has started failing its tests after this commit. Unfortunately it is proving difficult to reproduce in a form that we can work out what is going wrong.

It fails an assertion, on a couple of clang tests (details below), but only one one of our CI machines. All attempts to reproduce (using the same docker container) have so far failed. The main difference in environment is that CI machine has more threads (96 vs 64).

I don't see this failing on any other buildbot, there's one semi-related mention of a race condition in https://github.com/llvm/llvm-project/pull/194475#issuecomment-4333333223 but that's for a different test to what we're seeing problems in.

Would you have any advice for us to try and narrow down what the problem is so we can try and make a consistent reproducer? We originally thought this might be multiple tests writing to the same file, but it doesn't look like this is the case.

The CMake command for the toolchain is:
```
cmake -G Ninja '-DLLVM_ENABLE_PROJECTS=clang;clang-tools-extra;lld' '-DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi;compiler-rt;libunwind' -DLLVM_BUILTIN_TARGETS=aarch64-none-linux-gnu -DLLVM_RUNTIME_TARGETS=aarch64-none-linux-gnu -DLLVM_DEFAULT_TARGET_TRIPLE=aarch64-none-linux-gnu -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=On -DLLVM_TARGETS_TO_BUILD=AArch64 -DLLVM_ENABLE_ASSERTIONS=On -DRUNTIMES_aarch64-none-linux-gnu_LIBCXX_USE_COMPILER_RT=Off -DCMAKE_BUILD_TYPE=Release ../llvm-project/llvm
```
Which is building a cross compiler running on x86_64 targeting aarch64-linux-gnu. The build is in an Ubuntu 24.04 docker container using the distros GCC 13.3.0 as the compiler.

The test failures specific to building https://github.com/llvm/llvm-project/commit/32eb90bfdf9f28a4cf11d4897e48942977fada78 are:
```
Clang :: ClangScanDeps/modules-dep-args.c
Clang :: Driver/modules-driver-import-std.cpp
```
these trip the same assertion failure in clang-scan-deps:
```
clang-scan-deps: /workspace/workspace/atfe/llvm-cross-compiler/build-llvm-cross-compiler/sme-linux-cross-compiler/llvm-project/llvm/lib/Support/MemoryBuffer.cpp:51: void llvm::MemoryBuffer::init(const char*, const char*, bool): Assertion `(!RequiresNullTerminator || BufEnd[0] == 0) && "Buffer is not null terminated!"' failed.
[2026-04-28T01:25:31.791Z] # | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
```

I've attached an extract of the log including the backtrace (sadly from a release build) as it is a bit too large to quote here. 
[ci-fail.zip](https://github.com/user-attachments/files/27172422/ci-fail.zip)


https://github.com/llvm/llvm-project/pull/192347


More information about the cfe-commits mailing list