-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed as not planned
Closed as not planned
Copy link
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]duplicateResolved as duplicateResolved as duplicate
Description
My workflow sometimes happens to be this:
- Compile
- Change something small in a source file
- Run
make, which often only compiles this small file and maybe some dependent files. - While waiting for the compilation to finish, change something else in the file and save it.
- Clang crashes
I have had this issue for ~3 years. It happens sporadically, probably only when I modify the file exactly during some critical routine. Clang could cache the file into memory before doing time-intensive processing steps on it if not already done so. I never had these issues with GCC, but I admit that this is a weird error case that might be hard to fix.
Backtrace:
0 0x0000777afd5cfd3f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Unix/Signals.inc:567:13
#1 0x0000777afd5ce069 llvm::sys::RunSignalHandlers() build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Signals.cpp:105:18
#2 0x0000777afd5d0570 SignalHandler build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Unix/Signals.inc:412:1
#3 0x0000777afbe45320 (/lib/x86_64-linux-gnu/libc.so.6+0x45320)
#4 0x0000777b046ecc8d memcpy /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10
#5 0x0000777b046ecc8d read<unsigned long, 1UL> build-llvm/tools/clang/stage2-bins/llvm/include/llvm/Support/Endian.h:66:3
#6 0x0000777b046ecc8d read<unsigned long> build-llvm/tools/clang/stage2-bins/llvm/include/llvm/Support/Endian.h:353:10
#7 0x0000777b046ecc8d read64 build-llvm/tools/clang/stage2-bins/llvm/include/llvm/Support/Endian.h:367:10
#8 0x0000777b046ecc8d clang::SrcMgr::LineOffsetMapping::get(llvm::MemoryBufferRef, llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul, 128ul>&) build-llvm/tools/clang/stage2-bins/clang/lib/Basic/SourceManager.cpp:1293:14
#9 0x0000777b046ecffc clang::SourceManager::getLineNumber(clang::FileID, unsigned int, bool*) const build-llvm/tools/clang/stage2-bins/clang/lib/Basic/SourceManager.cpp:1384:30
#10 0x0000777b046eca9d clang::SourceManager::getPresumedLoc(clang::SourceLocation, bool) const build-llvm/tools/clang/stage2-bins/clang/lib/Basic/SourceManager.cpp:1548:7
#11 0x0000777b046e4a51 isInvalid build-llvm/tools/clang/stage2-bins/clang/include/clang/Basic/SourceLocation.h:318:35
#12 0x0000777b046e4a51 clang::SourceLocation::print(llvm::raw_ostream&, clang::SourceManager const&) const build-llvm/tools/clang/stage2-bins/clang/lib/Basic/SourceLocation.cpp:71:14
#13 0x0000777b046e4af8 operator<< build-llvm/tools/clang/stage2-bins/llvm/include/llvm/Support/raw_ostream.h:216:25
#14 0x0000777b046e4af8 operator<< build-llvm/tools/clang/stage2-bins/llvm/include/llvm/Support/raw_ostream.h:244:18
#15 0x0000777b046e4af8 clang::SourceLocation::print(llvm::raw_ostream&, clang::SourceManager const&) const build-llvm/tools/clang/stage2-bins/clang/lib/Basic/SourceLocation.cpp:83:6
#16 0x0000777b047e2fa4 getKind build-llvm/tools/clang/stage2-bins/clang/include/clang/Lex/Token.h:93:43
#17 0x0000777b047e2fa4 isAnnotation build-llvm/tools/clang/stage2-bins/clang/include/clang/Lex/Token.h:121:30
#18 0x0000777b047e2fa4 print build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseAST.cpp:72:11
#19 0x0000777afd552f34 PrintStack build-llvm/tools/clang/stage2-bins/llvm/lib/Support/PrettyStackTrace.cpp:94:3
#20 0x0000777afd552f34 PrintCurStackTrace build-llvm/tools/clang/stage2-bins/llvm/lib/Support/PrettyStackTrace.cpp:109:3
#21 0x0000777afd5ce03b llvm::sys::RunSignalHandlers() build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Signals.cpp:105:18
#22 0x0000777afd508d17 HandleCrash build-llvm/tools/clang/stage2-bins/llvm/lib/Support/CrashRecoveryContext.cpp:73:5
#23 0x0000777afd508d17 CrashRecoverySignalHandler build-llvm/tools/clang/stage2-bins/llvm/lib/Support/CrashRecoveryContext.cpp:390:51
#24 0x0000777afbe45320 (/lib/x86_64-linux-gnu/libc.so.6+0x45320)
#25 0x0000777b046ecc8d memcpy /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10
#26 0x0000777b046ecc8d read<unsigned long, 1UL> build-llvm/tools/clang/stage2-bins/llvm/include/llvm/Support/Endian.h:66:3
#27 0x0000777b046ecc8d read<unsigned long> build-llvm/tools/clang/stage2-bins/llvm/include/llvm/Support/Endian.h:353:10
#28 0x0000777b046ecc8d read64 build-llvm/tools/clang/stage2-bins/llvm/include/llvm/Support/Endian.h:367:10
#29 0x0000777b046ecc8d clang::SrcMgr::LineOffsetMapping::get(llvm::MemoryBufferRef, llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul, 128ul>&) build-llvm/tools/clang/stage2-bins/clang/lib/Basic/SourceManager.cpp:1293:14
#30 0x0000777b046ecffc clang::SourceManager::getLineNumber(clang::FileID, unsigned int, bool*) const build-llvm/tools/clang/stage2-bins/clang/lib/Basic/SourceManager.cpp:1384:30
#31 0x0000777b046eca9d clang::SourceManager::getPresumedLoc(clang::SourceLocation, bool) const build-llvm/tools/clang/stage2-bins/clang/lib/Basic/SourceManager.cpp:1548:7
#32 0x0000777b047bc9af clang::Preprocessor::ExpandBuiltinMacro(clang::Token&) build-llvm/tools/clang/stage2-bins/clang/lib/Lex/PPMacroExpansion.cpp:0:34
#33 0x0000777b047bba72 clang::Preprocessor::HandleMacroExpandedIdentifier(clang::Token&, clang::MacroDefinition const&) build-llvm/tools/clang/stage2-bins/clang/lib/Lex/PPMacroExpansion.cpp:0:5
#34 0x0000777b047dbb56 clang::Preprocessor::HandleIdentifier(clang::Token&) build-llvm/tools/clang/stage2-bins/clang/lib/Lex/Preprocessor.cpp:0:18
#35 0x0000777b047dbfbb clang::Preprocessor::Lex(clang::Token&) build-llvm/tools/clang/stage2-bins/clang/lib/Lex/Preprocessor.cpp:0:38
#36 0x0000777b047e8cad ConsumeAnyToken build-llvm/tools/clang/stage2-bins/clang/include/clang/Basic/TokenKinds.h:0:35
#37 0x0000777b047e9228 is build-llvm/tools/clang/stage2-bins/clang/include/clang/Lex/Token.h:98:44
#38 0x0000777b047e9228 clang::Parser::ConsumeAndStoreUntil(clang::tok::TokenKind, clang::tok::TokenKind, llvm::SmallVector<clang::Token, 4u>&, bool, bool) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseCXXInlineMethods.cpp:826:13
#39 0x0000777b047e9154 clang::Parser::ConsumeAndStoreUntil(clang::tok::TokenKind, clang::tok::TokenKind, llvm::SmallVector<clang::Token, 4u>&, bool, bool) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseCXXInlineMethods.cpp:0:0
#40 0x0000777b047e9154 clang::Parser::ConsumeAndStoreUntil(clang::tok::TokenKind, clang::tok::TokenKind, llvm::SmallVector<clang::Token, 4u>&, bool, bool) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseCXXInlineMethods.cpp:0:0
#41 0x0000777b047e9154 clang::Parser::ConsumeAndStoreUntil(clang::tok::TokenKind, clang::tok::TokenKind, llvm::SmallVector<clang::Token, 4u>&, bool, bool) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseCXXInlineMethods.cpp:0:0
#42 0x0000777b047e3613 clang::Parser::ParseCXXInlineMethodDef(clang::AccessSpecifier, clang::ParsedAttributesView const&, clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::VirtSpecifiers const&, clang::SourceLocation) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseCXXInlineMethods.cpp:171:12
#43 0x0000777b0481ede3 clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject*) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseDeclCXX.cpp:2956:23
#44 0x0000777b0489566e clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseTemplate.cpp:0:24
#45 0x0000777b04894cb9 clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseTemplate.cpp:0:0
#46 0x0000777b0481cff1 clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject*) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseDeclCXX.cpp:2734:22
#47 0x0000777b0481fefc clang::Parser::ParseCXXClassMemberDeclarationWithPragmas(clang::AccessSpecifier&, clang::ParsedAttributes&, clang::TypeSpecifierType, clang::Decl*) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseDeclCXX.cpp:0:0
#48 0x0000777b0481a3e2 empty build-llvm/tools/clang/stage2-bins/llvm/include/llvm/ADT/SmallVector.h:94:46
#49 0x0000777b0481a3e2 MaybeDestroyTemplateIds build-llvm/tools/clang/stage2-bins/clang/include/clang/Parse/Parser.h:297:22
#50 0x0000777b0481a3e2 clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::ParsedAttributes&, unsigned int, clang::Decl*) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseDeclCXX.cpp:3597:7
#51 0x0000777b04817b67 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::ParsedAttributes&) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseDeclCXX.cpp:0:7
#52 0x0000777b047fa20b empty build-llvm/tools/clang/stage2-bins/llvm/include/llvm/ADT/SmallVector.h:94:46
#53 0x0000777b047fa20b empty build-llvm/tools/clang/stage2-bins/clang/include/clang/Sema/ParsedAttr.h:932:40
#54 0x0000777b047fa20b clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*, clang::ImplicitTypenameContext) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseDecl.cpp:4225:23
#55 0x0000777b048a748d clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/Parser.cpp:1124:10
#56 0x0000777b048a71c8 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/Parser.cpp:1226:12
#57 0x0000777b048a6464 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/Parser.cpp:0:14
#58 0x0000777b048a470f clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/Parser.cpp:743:10
#59 0x0000777b047e2d3e clang::ParseAST(clang::Sema&, bool, bool) build-llvm/tools/clang/stage2-bins/clang/lib/Parse/ParseAST.cpp:161:5
#60 0x0000777b06448dcc clang::FrontendAction::Execute() build-llvm/tools/clang/stage2-bins/clang/lib/Frontend/FrontendAction.cpp:1062:10
#61 0x0000777b063c88b4 getPtr build-llvm/tools/clang/stage2-bins/llvm/include/llvm/Support/Error.h:275:12
#62 0x0000777b063c88b4 operator bool build-llvm/tools/clang/stage2-bins/llvm/include/llvm/Support/Error.h:235:16
#63 0x0000777b063c88b4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) build-llvm/tools/clang/stage2-bins/clang/lib/Frontend/CompilerInstance.cpp:1046:23
#64 0x0000777b064c28d3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) build-llvm/tools/clang/stage2-bins/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:264:25
#65 0x000059a3a7750c3d cc1_main(llvm::ArrayRef<char const*>, char const*, void*) build-llvm/tools/clang/stage2-bins/clang/tools/driver/cc1_main.cpp:251:15
#66 0x000059a3a774dd00 ExecuteCC1Tool build-llvm/tools/clang/stage2-bins/clang/tools/driver/driver.cpp:360:12
#67 0x0000777b060a2e0b operator() build-llvm/tools/clang/stage2-bins/clang/lib/Driver/Job.cpp:428:30
#68 0x0000777b060a2e0b callback_fn<(lambda at clang/lib/Driver/Job.cpp:428:22)> build-llvm/tools/clang/stage2-bins/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
#69 0x0000777afd508a67 operator() build-llvm/tools/clang/stage2-bins/llvm/include/llvm/ADT/STLFunctionalExtras.h:0:12
#70 0x0000777afd508a67 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/CrashRecoveryContext.cpp:426:3
#71 0x0000777b060a244c clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const build-llvm/tools/clang/stage2-bins/clang/lib/Driver/Job.cpp:428:7
#72 0x0000777b0606d783 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const build-llvm/tools/clang/stage2-bins/clang/lib/Driver/Compilation.cpp:199:15
#73 0x0000777b0606d9cf clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const build-llvm/tools/clang/stage2-bins/clang/lib/Driver/Compilation.cpp:253:13
#74 0x0000777b060880f0 empty build-llvm/tools/clang/stage2-bins/llvm/include/llvm/ADT/SmallVector.h:94:46
#75 0x0000777b060880f0 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) build-llvm/tools/clang/stage2-bins/clang/lib/Driver/Driver.cpp:1856:23
#76 0x000059a3a774d4bf clang_main(int, char**) build-llvm/tools/clang/stage2-bins/clang/tools/driver/driver.cpp:562:21
#77 0x0000777afbe2a1ca __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#78 0x0000777afbe2a28b call_init ./csu/../csu/libc-start.c:128:20
#79 0x0000777afbe2a28b __libc_start_main ./csu/../csu/libc-start.c:347:5
#80 0x000059a3a774a2f5 _start (/usr/bin/clang++-16+0x102f5)
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]duplicateResolved as duplicateResolved as duplicate