Closed ZhangZhuoSJTU closed 3 years ago
Confirmed, crashes here:
==10207== Invalid read of size 8
==10207== at 0x882A2FE: UnknownInlinedFun (PointerIntPair.h:61)
==10207== by 0x882A2FE: UnknownInlinedFun (PointerUnion.h:188)
==10207== by 0x882A2FE: hasExtInfo (Decl.h:686)
==10207== by 0x882A2FE: getTypeSourceInfo (Decl.h:701)
==10207== by 0x882A2FE: hasDeducedReturnType (SemaStmt.cpp:3261)
==10207== by 0x882A2FE: clang::Sema::ActOnCapScopeReturnStmt(clang::SourceLocation, clang::Expr*) (SemaStmt.cpp:3276)
==10207== by 0x882CF37: clang::Sema::BuildReturnStmt(clang::SourceLocation, clang::Expr*) (SemaStmt.cpp:3616)
==10207== by 0x882CD4A: clang::Sema::ActOnReturnStmt(clang::SourceLocation, clang::Expr*, clang::Scope*) (SemaStmt.cpp:3593)
==10207== by 0x7A17656: clang::Parser::ParseReturnStatement() (ParseStmt.cpp:2180)
==10207== by 0x7A1098E: clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) (ParseStmt.cpp:282)
==10207== by 0x7A0FEC2: clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (ParseStmt.cpp:106)
==10207== by 0x7A197F2: clang::Parser::ParseCompoundStatementBody(bool) (ParseStmt.cpp:1089)
==10207== by 0x79BCBAE: UnknownInlinedFun (ParseStmt.cpp:903)
==10207== by 0x79BCBAE: UnknownInlinedFun (ParseStmt.cpp:868)
==10207== by 0x79BCBAE: clang::Parser::ParseParenExpression(clang::Parser::ParenParseOption&, bool, bool, clang::OpaquePtr<clang::QualType>&, clang::SourceLocation&) (ParseExpr.cpp:2871)
==10207== by 0x79B79CC: clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (ParseExpr.cpp:957)
==10207== by 0x79B099F: ParseCastExpression (ParseExpr.cpp:681)
==10207== by 0x79B099F: clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (ParseExpr.cpp:173)
==10207== by 0x79B1446: clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) (ParseExpr.cpp:544)
==10207== by 0x79B0A59: clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (ParseExpr.cpp:176)
==10207== Address 0x38 is not stack'd, malloc'd or (recently) free'd
Looks like it's another crash in clang.
$ clang -c test.cc
test.cc:2:79: error: use of undeclared identifier 'x'
[] (short __attribute__ ((noinline(throw __builtin_extend_pointer0 ? (x != 2 && ((x & (0 + 0 - x ? 0 : ({
^
test.cc:2:91: error: use of undeclared identifier 'x'
[] (short __attribute__ ((noinline(throw __builtin_extend_pointer0 ? (x != 2 && ((x & (0 + 0 - x ? 0 : ({
^
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /backup/work/compilers/compiler-install/llvm-12.0.0-dev/bin/clang -c test.cc
1. test.cc:3:33: current parser token ';'
2. test.cc:1:12: parsing function body 'main'
3. test.cc:1:12: in compound statement ('{}')
4. test.cc:2:9: lambda expression parsing
5. test.cc:2:113: in compound statement ('{}')
#0 0x0000000002f7987a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /backup/work/compilers/compiler-source/llvm-project/llvm/lib/Support/Unix/Signals.inc:563:11
#1 0x0000000002f79a4b PrintStackTraceSignalHandler(void*) /backup/work/compilers/compiler-source/llvm-project/llvm/lib/Support/Unix/Signals.inc:630:1
#2 0x0000000002f7803b llvm::sys::RunSignalHandlers() /backup/work/compilers/compiler-source/llvm-project/llvm/lib/Support/Signals.cpp:70:5
#3 0x0000000002f7916e llvm::sys::CleanupOnSignal(unsigned long) /backup/work/compilers/compiler-source/llvm-project/llvm/lib/Support/Unix/Signals.inc:362:1
#4 0x0000000002eb3618 (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) /backup/work/compilers/compiler-source/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:75:20
#5 0x0000000002eb38f3 CrashRecoverySignalHandler(int) /backup/work/compilers/compiler-source/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:389:1
#6 0x00007f507c538890 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#7 0x000000000335b2c0 llvm::PointerIntPair<void*, 1u, int, llvm::pointer_union_detail::PointerUnionUIntTraits<clang::TypeSourceInfo*, clang::DeclaratorDecl::ExtInfo*>, llvm::PointerIntPairInfo<void*, 1u$
llvm::pointer_union_detail::PointerUnionUIntTraits<clang::TypeSourceInfo*, clang::DeclaratorDecl::ExtInfo*> > >::getInt() const /backup/work/compilers/compiler-source/llvm-project/llvm/include/llvm/ADT/P
ointerIntPair.h:61:57
#8 0x000000000335b28f bool llvm::PointerUnion<clang::TypeSourceInfo*, clang::DeclaratorDecl::ExtInfo*>::is<clang::DeclaratorDecl::ExtInfo*>() const /backup/work/compilers/compiler-source/llvm-project/llv
m/include/llvm/ADT/PointerUnion.h:181:31
#9 0x000000000335b19e clang::DeclaratorDecl::hasExtInfo() const /backup/work/compilers/compiler-source/llvm-project/clang/include/clang/AST/Decl.h:701:29
#10 0x000000000335a98c clang::DeclaratorDecl::getTypeSourceInfo() const /backup/work/compilers/compiler-source/llvm-project/clang/include/clang/AST/Decl.h:716:12
#11 0x00000000073f82b8 hasDeducedReturnType(clang::FunctionDecl*) /backup/work/compilers/compiler-source/llvm-project/clang/lib/Sema/SemaStmt.cpp:3298:32
#12 0x00000000073f76f7 clang::Sema::ActOnCapScopeReturnStmt(clang::SourceLocation, clang::Expr*) /backup/work/compilers/compiler-source/llvm-project/clang/lib/Sema/SemaStmt.cpp:3313:20
#13 0x00000000073f98a8 clang::Sema::BuildReturnStmt(clang::SourceLocation, clang::Expr*) /backup/work/compilers/compiler-source/llvm-project/clang/lib/Sema/SemaStmt.cpp:3653:12
...
Similar to #226 and #227. I am closing this issue as well. Thanks.
test.cc:
PASS_BUG_INFO.TXT: