[PATCH] D153536: [Clang] Implement P2169 A nice placeholder with no name
Vitaly Buka via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 8 13:21:05 PDT 2023
vitalybuka added a comment.
Not a test update
The second line of the test triggers:
RUN: not --crash clangd -lit-test -sync=0 < %s 2> %t.async.err
==============================================================
Signalled while building preamble
Filename: =================================================================
==2319884==ERROR: AddressSanitizer: stack-use-after-return on address 0x7f310f6eb210 at pc 0x55a3ecaab9f5 bp 0x7f3115c49920 sp 0x7f3115c49918
READ of size 1 at 0x7f310f6eb210 thread T3
#0 0x55a3ecaab9f4 in __is_long /b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/include/c++/v1/string:1734:33
#1 0x55a3ecaab9f4 in __get_pointer /b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/include/c++/v1/string:1869:17
#2 0x55a3ecaab9f4 in data /b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/include/c++/v1/string:1559:73
#3 0x55a3ecaab9f4 in operator<< /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/Support/raw_ostream.h:249:22
#4 0x55a3ecaab9f4 in clang::clangd::(anonymous namespace)::crashDumpCompileCommand(llvm::raw_ostream&, clang::tooling::CompileCommand const&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1012:24
#5 0x55a3ecaab285 in clang::clangd::(anonymous namespace)::crashDumpParseInputs(llvm::raw_ostream&, clang::clangd::ParseInputs const&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1038:3
#6 0x55a3ecec1c9d in operator() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:382:12
#7 0x55a3ecec1c9d in clang::clangd::ThreadCrashReporter::runCrashHandlers() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/support/ThreadCrashReporter.cpp:30:5
#8 0x55a3ebacfd78 in operator() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/tool/ClangdMain.cpp:717:9
#9 0x55a3ebacfd78 in clang::clangd::clangdMain(int, char**)::$_0::__invoke(void*) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/tool/ClangdMain.cpp:716:7
#10 0x55a3e87c27ba in llvm::sys::RunSignalHandlers() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Support/Signals.cpp:103:5
#11 0x55a3e87cbd01 in SignalHandler(int) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:403:3
#12 0x7f3115a3bcef (/lib/x86_64-linux-gnu/libc.so.6+0x3bcef) (BuildId: d1704d25fbbb72fa95d517b883131828c0883fe9)
#13 0x7f3115a9226a in pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9226a) (BuildId: d1704d25fbbb72fa95d517b883131828c0883fe9)
#14 0x7f3115a3bc45 in raise (/lib/x86_64-linux-gnu/libc.so.6+0x3bc45) (BuildId: d1704d25fbbb72fa95d517b883131828c0883fe9)
#15 0x7f3115a227fb in abort (/lib/x86_64-linux-gnu/libc.so.6+0x227fb) (BuildId: d1704d25fbbb72fa95d517b883131828c0883fe9)
#16 0x55a3e869c429 in llvm::report_fatal_error(llvm::Twine const&, bool) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Support/ErrorHandling.cpp:123:5
#17 0x55a3e869c014 in llvm::report_fatal_error(char const*, bool) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Support/ErrorHandling.cpp:83:3
#18 0x55a3e9a2bb12 in (anonymous namespace)::PragmaDebugHandler::HandlePragma(clang::Preprocessor&, clang::PragmaIntroducer, clang::Token&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang/lib/Lex/Pragma.cpp:1102:9
#19 0x55a3e9a0f270 in clang::Preprocessor::HandlePragmaDirective(clang::PragmaIntroducer) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang/lib/Lex/Pragma.cpp:178:19
#20 0x55a3e98e92a1 in clang::Preprocessor::HandleDirective(clang::Token&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang/lib/Lex/PPDirectives.cpp:1265:14
#21 0x55a3e98a427a in clang::Lexer::LexTokenInternal(clang::Token&, bool) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang/lib/Lex/Lexer.cpp:4362:7
#22 0x55a3e989754c in clang::Lexer::Lex(clang::Token&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang/lib/Lex/Lexer.cpp:3578:24
#23 0x55a3e9a5fb72 in clang::Preprocessor::Lex(clang::Token&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang/lib/Lex/Preprocessor.cpp:886:33
#24 0x55a3eee8d7ef in ConsumeToken /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang/include/clang/Parse/Parser.h:504:8
#25 0x55a3eee8d7ef in clang::Parser::Initialize() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang/lib/Parse/Parser.cpp:568:3
#26 0x55a3eee7732f in clang::ParseAST(clang::Sema&, bool, bool) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang/lib/Parse/ParseAST.cpp:156:7
#27 0x55a3ec4ddff4 in clang::FrontendAction::Execute() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1063:8
#28 0x55a3ec2320b6 in clang::PrecompiledPreamble::Build(clang::CompilerInvocation const&, llvm::MemoryBuffer const*, clang::PreambleBounds, clang::DiagnosticsEngine&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::__1::shared_ptr<clang::PCHContainerOperations>, bool, llvm::StringRef, clang::PreambleCallbacks&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang/lib/Frontend/PrecompiledPreamble.cpp:535:30
#29 0x55a3ec9094b9 in clang::clangd::buildPreamble(llvm::StringRef, clang::CompilerInvocation, clang::clangd::ParseInputs const&, bool, std::__1::function<void (clang::clangd::CapturedASTCtx, std::__1::shared_ptr<clang::include_cleaner::PragmaIncludes const>)>, clang::clangd::PreambleBuildStats*) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/Preamble.cpp:663:24
#30 0x55a3ecaaf64c in clang::clangd::(anonymous namespace)::PreambleThread::build(clang::clangd::(anonymous namespace)::PreambleThread::Request) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1080:17
#31 0x55a3ecaad02b in run /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:505:9
#32 0x55a3ecaad02b in operator() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:819:55
#33 0x55a3ecaad02b in void llvm::detail::UniqueFunctionBase<void>::CallImpl<clang::clangd::(anonymous namespace)::ASTWorker::create(llvm::StringRef, clang::clangd::GlobalCompilationDatabase const&, clang::clangd::TUScheduler::ASTCache&, clang::clangd::TUScheduler::HeaderIncluderCache&, clang::clangd::AsyncTaskRunner*, clang::clangd::Semaphore&, clang::clangd::TUScheduler::Options const&, clang::clangd::ParsingCallbacks&)::$_1>(void*) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:220:12
#34 0x55a3ecec3715 in operator() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:382:12
#35 0x55a3ecec3715 in operator() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:101:5
#36 0x55a3ecec3715 in operator()<(lambda at /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15) &> /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/Support/thread.h:43:11
#37 0x55a3ecec3715 in __invoke<(lambda at /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/Support/thread.h:42:9), (lambda at /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15) &> /b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/include/c++/v1/__type_traits/invoke.h:340:25
#38 0x55a3ecec3715 in __apply_tuple_impl<(lambda at /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/Support/thread.h:42:9), std::__1::tuple<(lambda at /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> &, 0UL> /b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/include/c++/v1/tuple:1825:1
#39 0x55a3ecec3715 in apply<(lambda at /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/Support/thread.h:42:9), std::__1::tuple<(lambda at /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> &> /b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/include/c++/v1/tuple:1834:1
#40 0x55a3ecec3715 in GenericThreadProxy<std::__1::tuple<(lambda at /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> > /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/Support/thread.h:41:5
#41 0x55a3ecec3715 in void* llvm::thread::ThreadProxy<std::__1::tuple<clang::clangd::AsyncTaskRunner::runAsync(llvm::Twine const&, llvm::unique_function<void ()>)::$_1>>(void*) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/Support/thread.h:55:5
#42 0x55a3e8393668 in asan_thread_start(void*) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:234:28
#43 0x7f3115a90401 (/lib/x86_64-linux-gnu/libc.so.6+0x90401) (BuildId: d1704d25fbbb72fa95d517b883131828c0883fe9)
#44 0x7f3115b1f58f (/lib/x86_64-linux-gnu/libc.so.6+0x11f58f) (BuildId: d1704d25fbbb72fa95d517b883131828c0883fe9)
Address 0x7f310f6eb210 is located in stack of thread T3 at offset 528 in frame
#0 0x55a3efe9b3ff in llvm::itanium_demangle::AbstractManglingParser<llvm::itanium_demangle::ManglingParser<(anonymous namespace)::DefaultAllocator>, (anonymous namespace)::DefaultAllocator>::parseType() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/Demangle/ItaniumDemangle.h:3772
This frame has 20 object(s):
[32, 40) 'ClassType.i' (line 3668)
[64, 72) 'MemberType.i' (line 3671)
[96, 104) 'Dimension.i' (line 3640)
[128, 144) 'ref.tmp.i' (line 3643)
[160, 168) 'Ty.i' (line 3657)
[192, 200) 'Result' (line 3773)
[224, 240) 'Res' (line 3886)
[256, 264) 'DimensionNumber' (line 3916)
[288, 304) 'ref.tmp' (line 3916)
[320, 328) 'Size' (line 3931)
[352, 368) 'ref.tmp179' (line 3931)
[384, 392) 'Child' (line 3978)
[416, 424) 'TA' (line 4032)
[448, 456) 'Ptr' (line 4042)
[480, 488) 'Ref' (line 4051)
[512, 520) 'Ref309' (line 4060) <== Memory access at offset 528 overflows this variable
[544, 552) 'P' (line 4069)
[576, 584) 'P333' (line 4078)
[608, 609) 'IsSubst' (line 4087)
[624, 632) 'TA364' (line 4105)
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
(longjmp and C++ exceptions *are* supported)
Thread T3 created by T0 here:
#0 0x55a3e837bdaf in pthread_create /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:245:3
#1 0x55a3e87ce1c4 in llvm::llvm_execute_on_thread_impl(void* (*)(void*), void*, std::__1::optional<unsigned int>) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Support/Unix/Threading.inc:85:17
#2 0x55a3ecec2e1d in thread<(lambda at /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/Support/thread.h:131:12
#3 0x55a3ecec2e1d in clang::clangd::AsyncTaskRunner::runAsync(llvm::Twine const&, llvm::unique_function<void ()>) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:107:16
#4 0x55a3eca955c5 in create /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:818:12
#5 0x55a3eca955c5 in clang::clangd::TUScheduler::update(llvm::StringRef, clang::clangd::ParseInputs, clang::clangd::WantDiagnostics) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1671:30
#6 0x55a3ec160093 in clang::clangd::ClangdServer::addDocument(llvm::StringRef, llvm::StringRef, llvm::StringRef, clang::clangd::WantDiagnostics, bool) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/ClangdServer.cpp:303:33
#7 0x55a3ec0447d6 in clang::clangd::ClangdLSPServer::onDocumentDidOpen(clang::clangd::DidOpenTextDocumentParams const&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/ClangdLSPServer.cpp:701:11
#8 0x55a3ec111568 in void clang::clangd::LSPBinder::notification<clang::clangd::DidOpenTextDocumentParams, clang::clangd::ClangdLSPServer>(llvm::StringLiteral, clang::clangd::ClangdLSPServer*, void (clang::clangd::ClangdLSPServer::*)(clang::clangd::DidOpenTextDocumentParams const&))::'lambda'(llvm::json::Value)::operator()(llvm::json::Value) const /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/LSPBinder.h:153:5
#9 0x55a3ec1112fc in void llvm::detail::UniqueFunctionBase<void, llvm::json::Value>::CallImpl<void clang::clangd::LSPBinder::notification<clang::clangd::DidOpenTextDocumentParams, clang::clangd::ClangdLSPServer>(llvm::StringLiteral, clang::clangd::ClangdLSPServer*, void (clang::clangd::ClangdLSPServer::*)(clang::clangd::DidOpenTextDocumentParams const&))::'lambda'(llvm::json::Value)>(void*, llvm::json::Value&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:220:12
#10 0x55a3ec08f34b in operator() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:382:12
#11 0x55a3ec08f34b in clang::clangd::ClangdLSPServer::MessageHandler::onNotify(llvm::StringRef, llvm::json::Value) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/ClangdLSPServer.cpp:200:7
#12 0x55a3ec852a14 in handleMessage /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/JSONTransport.cpp:196:18
#13 0x55a3ec852a14 in clang::clangd::(anonymous namespace)::JSONTransport::loop(clang::clangd::Transport::MessageHandler&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/JSONTransport.cpp:120:16
#14 0x55a3ec079073 in clang::clangd::ClangdLSPServer::run() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/ClangdLSPServer.cpp:1693:25
#15 0x55a3ebabacd7 in clang::clangd::clangdMain(int, char**) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/clang-tools-extra/clangd/tool/ClangdMain.cpp:1006:28
#16 0x7f3115a2350f (/lib/x86_64-linux-gnu/libc.so.6+0x2350f) (BuildId: d1704d25fbbb72fa95d517b883131828c0883fe9)
SUMMARY: AddressSanitizer: stack-use-after-return /b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/include/c++/v1/string:1734:33 in __is_long
Shadow bytes around the buggy address:
0x7f310f6eaf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x7f310f6eb000: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
0x7f310f6eb080: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
0x7f310f6eb100: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
0x7f310f6eb180: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
=>0x7f310f6eb200: f5 f5[f5]f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
0x7f310f6eb280: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
0x7f310f6eb300: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
0x7f310f6eb380: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
0x7f310f6eb400: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
0x7f310f6eb480: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==2319884==ABORTING
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153536/new/
https://reviews.llvm.org/D153536
More information about the cfe-commits
mailing list