<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58254>58254</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang segfault
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rnikander
</td>
</tr>
</table>
<pre>
I'm using clangd on a C++ project and it was crashing. Below I invoked clang++ directly from the command line to get the error report. If this isn't enough info to be useful, I'm sorry, but I don't want to attach my source code as the message at the bottom suggests.
```text
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: /Users/rob/Dev/clang+llvm-15.0.1-x86_64-apple-darwin/bin/clang++ --driver-mode=g++ -DDEBUG -I/Users/rob/Dev/metal-cpp-beta -I/Users/rob/Dev/json_nlohmann/include/include -I/Users/rob/Workspace/Memogu/DocEditor -I/usr/local/opt/icu4c/include -I/Users/rob/Workspace/Memogu/Common -I/Users/rob/Workspace/Memogu/EncodiaDataStructures -I/Users/rob/Workspace/Memogu/MyUILib -I/Users/rob/Workspace/Memogu/AppleInterop -isystem /Users/rob/Workspace/Memogu/build-debug/vcpkg_installed/x64-osx/include -isystem /Users/rob/Workspace/Memogu/build-debug/vcpkg_installed/x64-osx/include/stduuid -Wall -Wimplicit-fallthrough -Werror=return-type -Wno-unused-variable -Wno-unused-function -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -std=gnu++2b -o DocEditor/CMakeFiles/DocEditor.dir/DocEditor/BlockElt.cc.o -c -resource-dir=/Users/rob/Dev/clang+llvm-15.0.1-x86_64-apple-darwin/lib/clang/15.0.1 -- /Users/rob/Workspace/Memogu/DocEditor/DocEditor/BlockElt.cc
1. /Users/rob/Workspace/Memogu/DocEditor/DocEditor/BlockElt.cc:677:1: current parser token 'double'
2. /Users/rob/Workspace/Memogu/DocEditor/DocEditor/BlockElt.cc:494:65: parsing function body 'BlockElt::layoutCoreTextFlow'
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 clang-15 0x0000000103480f7e llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 46
1 clang-15 0x000000010347fe18 llvm::sys::RunSignalHandlers() + 248
2 clang-15 0x00000001034804f2 llvm::sys::CleanupOnSignal(unsigned long) + 210
3 clang-15 0x00000001033a5a7f CrashRecoverySignalHandler(int) + 191
4 libsystem_platform.dylib 0x00007ff802cf9c1d _sigtramp + 29
5 libsystem_platform.dylib 0xfffffffffffff000 _sigtramp + 18446603370533770240
6 clang-15 0x0000000105d5bb73 EvaluateInPlace(clang::APValue&, (anonymous namespace)::EvalInfo&, (anonymous namespace)::LValue const&, clang::Expr const*, bool) + 195
7 clang-15 0x0000000105d5b82b clang::Expr::EvaluateAsConstantExpr(clang::Expr::EvalResult&, clang::ASTContext const&, clang::Expr::ConstantExprKind) const + 731
8 clang-15 0x000000010555fb89 clang::Sema::PopExpressionEvaluationContext() + 1145
9 clang-15 0x00000001053f9ff8 clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 6680
10 clang-15 0x00000001051ca9dd clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) + 269
11 clang-15 0x00000001051e711e clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) + 3822
12 clang-15 0x0000000105126e51 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 5297
13 clang-15 0x00000001051e5ecc clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) + 828
14 clang-15 0x00000001051e5985 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) + 437
15 clang-15 0x00000001051e45b7 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsingDeclSpec*) + 2007
16 clang-15 0x00000001051e23fc clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) + 1004
17 clang-15 0x000000010510986e clang::ParseAST(clang::Sema&, bool, bool) + 670
18 clang-15 0x0000000103eb5b3a clang::FrontendAction::Execute() + 90
19 clang-15 0x0000000103e28736 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 838
20 clang-15 0x0000000103f368eb clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 683
21 clang-15 0x0000000101328237 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 2087
22 clang-15 0x0000000101326348 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) + 280
23 clang-15 0x0000000103c58a97 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const::$_1>(long) + 23
24 clang-15 0x00000001033a57c3 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 227
25 clang-15 0x0000000103c58623 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const + 387
26 clang-15 0x0000000103c1eaad clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const + 1085
27 clang-15 0x0000000103c1ed20 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&, bool) const + 144
28 clang-15 0x0000000103c3adaf clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&) + 863
29 clang-15 0x00000001013259e9 clang_main(int, char**) + 10585
30 dyld 0x00007ff80299e310 start + 2432
clang-15: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 15.0.1 (https://github.com/tru/llvm-release-build 33b6cbead48e63164b3e7c5ac9d34505c0391552)
Target: x86_64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /Users/rob/Dev/clang+llvm-15.0.1-x86_64-apple-darwin/bin
clang-15: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-15: note: diagnostic msg: /var/folders/zm/mzv_wcgn0gn4xcj3z6vl4_cm0000gn/T/BlockElt-9135e8.cpp
clang-15: note: diagnostic msg: /var/folders/zm/mzv_wcgn0gn4xcj3z6vl4_cm0000gn/T/BlockElt-9135e8.sh
clang-15: note: diagnostic msg: Crash backtrace is located in
clang-15: note: diagnostic msg: /Users/rob/Library/Logs/DiagnosticReports/clang-15_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang-15: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
clang-15: note: diagnostic msg:
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztWltz6jgS_jXJi8qU79gPeSBA5mSXbFKBmTOzL5Qsy6CJbXllmYTz67cl2WBIyPjMnK152RRFbKml_vqi7pZEwtP9zf2VOy5QU7Nyg0iOy02KeIkwml65t_BBleC_UyIRLlPEJHrFNSIC11ugH6FbmvNXdI9YueMvNDUTtANTJmBcvkeZ4AWSW4oILwo1Tc5KiiRHGyp1OxWCCyRoxYUcofsMGlmNWF0CNIloyZvNFlhkXA1KKIClWZNfuVNkwNdciL16TRoJYFJuBr7iUqoRWEpMtqjYA2EjiMKRUgRyKN4FrWu8gVcDJeFSAtq62WxoLevRlT27siftd2ibj6Rv0jQ9LeaT5RzIkwJ0gwHAppVDMd5KWdVX3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