Open Quuxplusone opened 4 years ago
Attached arch2_gdoubleindexmap.h
(5922 bytes, text/plain): Source code triggering check
I executed clang-tidy on the header file you provided and it did not cause crash even with fixes enabled. Actually, it found the errors and fixed them correctly. I think I need more information to investigate this bug. Could you first build your Clang in debug mode so at leaast I see the line number where it crashes? And I really need a code where I can reproduce the crash.
Sorry for the late reply. Here is the backtrace from a debug build:
---
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007f4770a9098b in __GI_abort () at abort.c:100
#2 0x00007f4770a8042a in __assert_fail_base (fmt=0x7f4770c07a38 "%s%s%s:%u:
%s%sAssertion `%s' failed.\n%n",
assertion=assertion@entry=0x55daf65cec70 "isa<X>(Val) && \"cast<Ty>() argument of incompatible type!\"",
file=file@entry=0x55daf65cec10 "/home/matthewf/cathexis/llvm/20200923/src/llvm-project/llvm/include/llvm/Support/Casting.h", line=line@entry=269,
function=function@entry=0x55daf65d19c0 <llvm::cast_retty<clang::BinaryOperator, clang::Expr const*>::ret_type llvm::cast<clang::BinaryOperator, clang::Expr const>(clang::Expr const*)::__PRETTY_FUNCTION__> "typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = clang::BinaryOperator; Y = const clang::Expr; typename llvm::cast_retty<X, Y*>::ret_type = const clang::BinaryOperator*]") at assert.c:92
#3 0x00007f4770a804a2 in __GI___assert_fail (assertion=0x55daf65cec70
"isa<X>(Val) && \"cast<Ty>() argument of incompatible type!\"",
file=0x55daf65cec10 "/home/matthewf/cathexis/llvm/20200923/src/llvm-project/llvm/include/llvm/Support/Casting.h", line=269,
function=0x55daf65d19c0 <llvm::cast_retty<clang::BinaryOperator, clang::Expr const*>::ret_type llvm::cast<clang::BinaryOperator, clang::Expr const>(clang::Expr const*)::__PRETTY_FUNCTION__> "typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = clang::BinaryOperator; Y = const clang::Expr; typename llvm::cast_retty<X, Y*>::ret_type = const clang::BinaryOperator*]") at assert.c:101
#4 0x000055daf229fc3b in llvm::cast<clang::BinaryOperator, clang::Expr const>
(Val=0x7f476e1615b0) at /home/matthewf/cathexis/llvm/20200923/src/llvm-
project/llvm/include/llvm/Support/Casting.h:269
#5 0x000055daf22cd294 in
clang::tidy::bugprone::RedundantBranchConditionCheck::check
(this=0x55dafd362d30, Result=...)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp:132
#6 0x000055daf31176a4 in clang::tidy::ClangTidyCheck::run
(this=0x55dafd362d30, Result=...) at
/home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp:65
#7 0x000055daf53a8103 in clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor::MatchVisitor::visitMatch (this=0x7fff77a86d10,
BoundNodesView=...)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:842
#8 0x000055daf5492419 in
clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches
(this=0x7fff77a86d30, ResultVisitor=0x7fff77a86d10)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/lib/ASTMatchers/ASTMatchersInternal.cpp:101
#9 0x000055daf53a726e in clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor::matchWithFilter (this=0x7fff77a87630, DynNode=...)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:653
#10 0x000055daf53a7463 in clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor::matchDispatch (this=0x7fff77a87630,
Node=0x7f476e1628e8)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:676
#11 0x000055daf53ae15f in clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor::match<clang::Stmt> (this=0x7fff77a87630, Node=...)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:578
#12 0x000055daf53a89f1 in clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor::TraverseStmt (this=0x7fff77a87630,
StmtNode=0x7f476e1628e8, Queue=0x7fff77a86f90)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1015
#13 0x000055daf544f29f in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseLabelStmt (this=0x7fff77a87630,
S=0x7f476e162918, Queue=0x7fff77a86f90)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:2226
#14 0x000055daf53e67cf in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::dataTraverseNode (this=0x7fff77a87630,
S=0x7f476e162918, Queue=0x7fff77a86f90)
at /home/matthewf/cathexis/llvm/20200923/build_debug/tools/clang/include/clang/AST/StmtNodes.inc:1395
#15 0x000055daf53b04df in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseStmt (this=0x7fff77a87630,
S=0x7f476e173640, Queue=0x0)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:599
#16 0x000055daf53a8a08 in clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor::TraverseStmt (this=0x7fff77a87630,
StmtNode=0x7f476e173640, Queue=0x0)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1016
#17 0x000055daf542737b in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseFunctionHelper (this=0x7fff77a87630,
D=0x7f476f0a8288)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:2056
#18 0x000055daf53d8b03 in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseCXXMethodDecl (this=0x7fff77a87630,
D=0x7f476f0a8288)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:2075
#19 0x000055daf53afbd4 in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseDecl (this=0x7fff77a87630,
D=0x7f476f0a8288)
at /home/matthewf/cathexis/llvm/20200923/build_debug/tools/clang/include/clang/AST/DeclNodes.inc:411
#20 0x000055daf53a89ba in clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor::TraverseDecl (this=0x7fff77a87630,
DeclNode=0x7f476f0a8288)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1008
#21 0x000055daf54216c4 in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseDeclContextHelper (this=0x7fff77a87630,
DC=0x7f476f914b40)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1383
#22 0x000055daf53d646d in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseClassTemplateSpecializationDecl
(this=0x7fff77a87630, D=0x7f476f914b00)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1898
#23 0x000055daf53af83e in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseDecl (this=0x7fff77a87630,
D=0x7f476f914b00)
at /home/matthewf/cathexis/llvm/20200923/build_debug/tools/clang/include/clang/AST/DeclNodes.inc:267
#24 0x000055daf53a89ba in clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor::TraverseDecl (this=0x7fff77a87630,
DeclNode=0x7f476f914b00)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1008
#25 0x000055daf5425aa9 in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseTemplateInstantiations
(this=0x7fff77a87630, D=0x55dafdef9d00)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1667
#26 0x000055daf53d50d1 in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseClassTemplateDecl (this=0x7fff77a87630,
D=0x55dafdef9d00)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1759
#27 0x000055daf53af6a6 in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseDecl (this=0x7fff77a87630,
D=0x55dafdef9d00)
at /home/matthewf/cathexis/llvm/20200923/build_debug/tools/clang/include/clang/AST/DeclNodes.inc:207
#28 0x000055daf53a89ba in clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor::TraverseDecl (this=0x7fff77a87630,
DeclNode=0x55dafdef9d00)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1008
#29 0x000055daf54216c4 in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseDeclContextHelper (this=0x7fff77a87630,
DC=0x55dafd384980)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1383
#30 0x000055daf53dc3d0 in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseTranslationUnitDecl (this=0x7fff77a87630,
D=0x55dafd384958)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/include/clang/AST/RecursiveASTVisitor.h:1484
#31 0x000055daf53b0135 in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseDecl (this=0x7fff77a87630,
D=0x55dafd384958)
at /home/matthewf/cathexis/llvm/20200923/build_debug/tools/clang/include/clang/AST/DeclNodes.inc:595
#32 0x000055daf53a89ba in clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor::TraverseDecl (this=0x7fff77a87630,
DeclNode=0x55dafd384958)
at /home/matthewf/cathexis/llvm/20200923/src/llvm-project/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1008
#33 0x000055daf53b219b in
clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous
namespace)::MatchASTVisitor>::TraverseAST (this=0x7fff77a87630, AST=...)
Please let me know if there is anything more I can do - print some variable values etc.
Is this the same bug that https://llvm.org/PR48008 fixed?
Can you try running the failing code again against a trunk build(after
https://github.com/llvm/llvm-project/commit/4364539b3a4c5e73561e5ff29e6952a75e89dc43)
arch2_gdoubleindexmap.h
(5922 bytes, text/plain)