[all-commits] [llvm/llvm-project] 7072b1: [clang][deps] Call getMemBuffer with RequiresNullT...
Peter Smith via All-commits
all-commits at lists.llvm.org
Thu Apr 30 09:56:02 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7072b1335103b6dbc4a577956f8a9f0fd4b43b4b
https://github.com/llvm/llvm-project/commit/7072b1335103b6dbc4a577956f8a9f0fd4b43b4b
Author: Peter Smith <peter.smith at arm.com>
Date: 2026-04-30 (Thu, 30 Apr 2026)
Changed paths:
M clang/lib/DependencyScanning/InProcessModuleCache.cpp
Log Message:
-----------
[clang][deps] Call getMemBuffer with RequiresNullTerminator false (#195072)
The getMemBuffer() has a default parameter RequiresNullTerminator which
is set to true.
In ModuleCache the MemoryBuffer::getOpenFile is called with /*
RequiresNullTerminator=*/false. This means that initial contents of the
MemoryBuffer may not have a trailing 0x0 at the end of the file.
When assertions are enabled and RequiresNullTerminator is true the
MemoryBuffer will trigger a "Buffer is not null terminated!" assertion
failure if BufEnd[0] != 0.
We have at one build with assertions enabled that is triggering this
MemoryBuffer assertion failure in the check-clang tests:
* ClangScanDeps/modules-dep-args.c
* Driver/modules-driver-import-std.cpp
The failure is specific to one particular machine, we have not been able
to reproduce locally. It is possible that the failure is filesystem type
or path length dependent.
Changing the RequiresNullTerminator in getMemBuffer to false to match
the value of RequiresNullTerminator in getOpenFile fixes the problem and
all tests pass.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list