<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/66938>66938</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang 18 llvm::report_bad_alloc_error in Sema::CheckConstraintSatisfaction
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
danakj
</td>
</tr>
</table>
<pre>
This happened in the last few days, showed up on my [CI run](https://github.com/chromium/subspace/actions/runs/6252318951/job/16975334258) today.
```
/usr/bin/clang++-18 -I/home/runner/work/subspace/subspace -I/home/runner/work/subspace/subspace/third_party/fmt/include -isystem /usr/include/c++/12 -isystem /usr/include/x86_64-linux-gnu/c++/12 -isystem /usr/include/c++/12/backward -isystem /usr/lib/llvm-18/lib/clang/18/include -isystem /usr/local/include -isystem /usr/include/x86_64-linux-gnu -isystem /usr/include -O3 -DNDEBUG -std=c++20 -fno-rtti -Wno-nullability-completeness -MD -MT sus/CMakeFiles/subspace.dir/lib/lib.cc.o -MF sus/CMakeFiles/subspace.dir/lib/lib.cc.o.d -o sus/CMakeFiles/subspace.dir/lib/lib.cc.o -c /home/runner/work/subspace/subspace/sus/lib/lib.cc
LLVM ERROR: out of memory
Allocation failed
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /usr/bin/clang++-18 -I/home/runner/work/subspace/subspace -I/home/runner/work/subspace/subspace/third_party/fmt/include -isystem /usr/include/c++/12 -isystem /usr/include/x86_64-linux-gnu/c++/12 -isystem /usr/include/c++/12/backward -isystem /usr/lib/llvm-18/lib/clang/18/include -isystem /usr/local/include -isystem /usr/include/x86_64-linux-gnu -isystem /usr/include -O3 -DNDEBUG -std=c++20 -fno-rtti -Wno-nullability-completeness -MD -MT sus/CMakeFiles/subspace.dir/lib/lib.cc.o -MF sus/CMakeFiles/subspace.dir/lib/lib.cc.o.d -o sus/CMakeFiles/subspace.dir/lib/lib.cc.o -c /home/runner/work/subspace/subspace/sus/lib/lib.cc
1. /home/runner/work/subspace/subspace/sus/num/__private/unsigned_integer_methods.inc:473:33: current parser token ';'
2. /home/runner/work/subspace/subspace/sus/num/unsigned_integer.h:44:1: parsing namespace 'sus'
3. /home/runner/work/subspace/subspace/sus/num/unsigned_integer.h:51:1: parsing struct/union/class body 'sus::num::u32'
4. /home/runner/work/subspace/subspace/sus/num/__private/unsigned_integer_methods.inc:472:1: parsing function body 'sus::num::u32::from_product'
5. /home/runner/work/subspace/subspace/sus/num/__private/unsigned_integer_methods.inc:472:1: in compound statement ('{}')
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 libLLVM-18.so.1 0x00007f1fc2f[26](https://github.com/chromium/subspace/actions/runs/6252318951/job/16975334258#step:7:27)cd6 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 54
1 libLLVM-18.so.1 0x00007f1fc2f24c90 llvm::sys::RunSignalHandlers() + 80
2 libLLVM-18.so.1 0x00007f1fc2e77470
3 libc.so.6 0x00007f1fc1a42520
4 libc.so.6 0x00007f1fc1a96a7c pthread_kill + 300
5 libc.so.6 0x00007f1fc1a42476 raise + 22
6 libc.so.6 0x00007f1fc1a287f3 abort + 211
7 libLLVM-18.so.1 0x00007f1fc2e853c4 llvm::report_bad_alloc_error(char const*, bool) + 132
8 libLLVM-18.so.1 0x00007f1fc2ec21f0 llvm::SmallVectorBase<unsigned int>::size() const + 0
9 libclang-cpp.so.18 0x00007f1fcaf98a74 llvm::SmallVectorImpl<std::pair<clang::Expr const*, llvm::PointerUnion<clang::Expr*, std::pair<clang::SourceLocation, llvm::StringRef>*>>>::operator=(llvm::SmallVectorImpl<std::pair<clang::Expr const*, llvm::PointerUnion<clang::Expr*, std::pair<clang::SourceLocation, llvm::StringRef>*>>> const&) + 68
10 libclang-cpp.so.18 0x00007f1fcaf917cb clang::Sema::CheckConstraintSatisfaction(clang::NamedDecl const*, llvm::ArrayRef<clang::Expr const*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::MultiLevelTemplateArgumentList const&, clang::SourceRange, clang::ConstraintSatisfaction&) + 1995
11 libclang-cpp.so.18 0x00007f1fcb49bff7 clang::Sema::CheckConceptTemplateId(clang::CXXScopeSpec const&, clang::SourceLocation, clang::DeclarationNameInfo const&, clang::NamedDecl*, clang::ConceptDecl*, clang::TemplateArgumentListInfo const*) + 7[27](https://github.com/chromium/subspace/actions/runs/6252318951/job/16975334258#step:7:28)
12 libclang-cpp.so.18 0x00007f1fcb5a91b2
63 clang++-18 0x000055e22988d545
64 libclang-cpp.so.18 0x00007f1fcc060609
65 libLLVM-18.so.1 0x00007f1fc2e7720c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 140
66 libclang-cpp.so.18 0x00007f1fcc05ff7e clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const + 366
67 libclang-cpp.so.18 0x00007f1fcc0[28](https://github.com/chromium/subspace/actions/runs/6252318951/job/16975334258#step:7:29)c51 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const + 897
68 libclang-cpp.so.18 0x00007f1fcc028e9e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const + 142
69 libclang-cpp.so.18 0x00007f1fcc04477c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) + 332
70 clang++-18 0x000055e2[29](https://github.com/chromium/subspace/actions/runs/6252318951/job/16975334258#step:7:30)88cea4 clang_main(int, char**, llvm::ToolContext const&) + 11252
71 clang++-18 0x000055e229899aa2 main + 50
72 libc.so.6 0x00007f1fc1a29d90
73 libc.so.6 0x00007f1fc1a29e40 __libc_start_main + 128
74 clang++-18 0x000055e229889f55 _start + 37
clang++-18: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Ubuntu clang version 18.0.0 (++202[30](https://github.com/chromium/subspace/actions/runs/6252318951/job/16975334258#step:7:31)920042413+678c1f142c06-1~exp1~202309200425[33](https://github.com/chromium/subspace/actions/runs/6252318951/job/16975334258#step:7:34).1196)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang++-18: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++-18: note: diagnostic msg: /tmp/lib-6aff51.cpp
clang++-18: note: diagnostic msg: /tmp/lib-6aff51.sh
clang++-18: note: diagnostic msg:
********************
```
cc: @cor3ntin
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWk1v4za3_jXM5sCGROpzkYU_4k5eJE2QZNreuzEoirLZSKRAUpm4i_72C1KyYydxPDPt7eAFOghsWTo8fPicT1JDjREryfk5iqconp_Rzq6VPi-ppI-_nxWq3Jw_rIWBNW1bLnkJQoJdc6ipsVDxL1DSjUF4BmatvvASuhaUhGYDKJ7OLkF3EsVzhLO1ta1BZILwAuHFSth1V4yZahBesLVWjejcpekK01LGEV5QZoWSBuGF7vxXgmNMwiyPQ4QXv6sC4UWY5GlMSITjDOEcrCrpZgwomKNgMnwmwfDX_8SLzmiEF4WQbuaayhXCU4SnozCD0SXCi7VqeD-p5E7yi9KPh8i2l98qj_DCroUuly3VdoPwomoswgshWd2VHEbCbIzlDexADk8c0B6kWzL-UPA5S5ZJNKqF7J5HK9l9y9h9QUcRZY9fqC7fGVMLx35dPzWjMNv9Hthc-FvHV1UrRuuvXPfr5RwXhtENgdH85_nF9PNPMDK2RGQ-rAgHMKqkGmlrBYx-lWoku7qmhaiF3YyYatqaWy65MTC6nsPo-gFM51xudk0f-ULU3OyZcVyKPQ5EMWZsrGB0vf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