Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failure in clang::ento::bugreporter::getDerefExpr #33721

Closed
llvmbot opened this issue Aug 30, 2017 · 6 comments
Closed

Assertion failure in clang::ento::bugreporter::getDerefExpr #33721

llvmbot opened this issue Aug 30, 2017 · 6 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla clang:static analyzer

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 30, 2017

Bugzilla Link 34373
Resolution FIXED
Resolved on Sep 27, 2017 02:57
Version unspecified
OS All
Reporter LLVM Bugzilla Contributor
CC @alexshap,@devincoughlin,@haoNoQ

Extended Description

$ cat getDerefExpr-crash.c
fn1() {
int a = 0;
(a + 0)[0];
}
$ clang-tidy -checks=-
,clang-analyzer-* getDerefExpr-crash.c --
assert.h assertion failed at clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:55 in const clang::Expr *clang::ento::bugreporter::getDerefExpr(const clang::Stmt *): B->isAssignmentOp()
@ 0x544749a __assert_fail
@ 0x2dcfb20 clang::ento::bugreporter::getDerefExpr()
@ 0x2dcfc7c clang::ento::bugreporter::getDerefExpr()
@ 0x2bda16a (anonymous namespace)::DereferenceChecker::reportBug()
@ 0x2bd981d (anonymous namespace)::DereferenceChecker::checkLocation()
@ 0x2bd9475 clang::ento::check::Location::_checkLocation<>()
@ 0x2e03e8d clang::ento::CheckerFn<>::operator()()
@ 0x2df988f (anonymous namespace)::CheckLocationContext::runChecker()
@ 0x2df6bfe expandGraphWithCheckers<>()
@ 0x2df6938 clang::ento::CheckerManager::runCheckersForLocation()
@ 0x2e1bdd5 clang::ento::ExprEngine::evalLocation()
@ 0x2e1bfcf clang::ento::ExprEngine::evalLoadCommon()
@ 0x2e1af12 clang::ento::ExprEngine::evalLoad()
@ 0x2e4c8f5 clang::ento::ExprEngine::VisitCast()
@ 0x2e1352e clang::ento::ExprEngine::Visit()
@ 0x2e0fe44 clang::ento::ExprEngine::ProcessStmt()
@ 0x2e0faca clang::ento::ExprEngine::processCFGElement()
@ 0x2e3dc66 clang::ento::CoreEngine::HandlePostStmt()
@ 0x2e3d566 clang::ento::CoreEngine::dispatchWorkItem()
@ 0x2e3d0a8 clang::ento::CoreEngine::ExecuteWorkList()
@ 0x2138e05 clang::ento::ExprEngine::ExecuteWorkList()
@ 0x20e1802 (anonymous namespace)::AnalysisConsumer::ActionExprEngine()
@ 0x20e15c1 (anonymous namespace)::AnalysisConsumer::RunPathSensitiveChecks()
@ 0x20e1285 (anonymous namespace)::AnalysisConsumer::HandleCode()
@ 0x20d4963 (anonymous namespace)::AnalysisConsumer::HandleDeclsCallGraph()
@ 0x20d2be7 (anonymous namespace)::AnalysisConsumer::HandleTranslationUnit()
@ 0x25136ce clang::MultiplexConsumer::HandleTranslationUnit()
@ 0x2f59506 clang::ParseAST()
@ 0x250109a clang::ASTFrontendAction::ExecuteAction()
Aborted (core dumped)

@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 30, 2017

assigned to @alexshap

@haoNoQ
Copy link
Collaborator

haoNoQ commented Aug 30, 2017

Yeah, the assertion seems incorrect.
It will be fixed by https://reviews.llvm.org/D37023 though.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 30, 2017

Yeah, the assertion seems incorrect.
It will be fixed by https://reviews.llvm.org/D37023 though.

Glad to hear that the fix had been in works for quite some time.

@haoNoQ
Copy link
Collaborator

haoNoQ commented Sep 26, 2017

*** Bug llvm/llvm-bugzilla-archive#34731 has been marked as a duplicate of this bug. ***

@haoNoQ
Copy link
Collaborator

haoNoQ commented Sep 27, 2017

Fixed in r314287. Also fancier diagnostics in this example have appeared after r314290.

@haoNoQ
Copy link
Collaborator

haoNoQ commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#34731

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:static analyzer
Projects
None yet
Development

No branches or pull requests

2 participants