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 in PaddingChecker::visitRecord #39318

Open
hokein opened this issue Dec 12, 2018 · 2 comments
Open

Assertion failure in in PaddingChecker::visitRecord #39318

hokein opened this issue Dec 12, 2018 · 2 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla clang:static analyzer crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@hokein
Copy link
Collaborator

hokein commented Dec 12, 2018

Bugzilla Link 39971
Version trunk
OS Linux
CC @devincoughlin,@haoNoQ

Extended Description

$ cat test-PaddingChecker__visitRecord.cc
namespace a {
template struct atomic { b c; };
}
typedef long d;
struct e {
alignas(64) a::atomic f;
d g;
alignas(64) a::atomic h;
char i[64 - sizeof(d)];
};

$ ./clang-tidy -checks="clang-analyzer*" test-PaddingChecker__visitRecord.cc -- -std=c++11
F1212 11:16:58.700911 40300 logging.cc:82] assert.h assertion failed at third_party/llvm/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp:108 in void (anonymous namespace)::PaddingChecker::visitRecord(const clang::RecordDecl *, uint64_t) const: !DiffPad.isNegative() && "DiffPad should not be negative"
*** Check failure stack trace: ***
@ 0x5630d023a4f9 (anonymous namespace)::PaddingChecker::visitRecord()
@ 0x5630d022a00d clang::RecursiveASTVisitor<>::TraverseCXXRecordDecl()
@ 0x5630d0225c8b clang::RecursiveASTVisitor<>::TraverseDecl()
@ 0x5630d022c1d9 clang::RecursiveASTVisitor<>::TraverseTranslationUnitDecl()
@ 0x5630d0225f4c clang::RecursiveASTVisitor<>::TraverseDecl()
@ 0x5630d02243f7 clang::ento::check::ASTDecl<>::_checkDecl<>()
@ 0x5630d04812bf clang::ento::CheckerManager::runCheckersOnASTDecl()
@ 0x5630d019f6d9 (anonymous namespace)::AnalysisConsumer::HandleTranslationUnit()
@ 0x5630d071320c clang::MultiplexConsumer::HandleTranslationUnit()
@ 0x5630d08ce414 clang::ParseAST()
@ 0x5630d070cd63 clang::FrontendAction::Execute()
@ 0x5630d05c17e1 clang::CompilerInstance::ExecuteAction()
@ 0x5630d051a7d1 clang::tooling::FrontendActionFactory::runInvocation()
@ 0x5630cfe1cc27 clang::tidy::runClangTidy()::ActionFactory::runInvocation()
@ 0x5630d051a53a clang::tooling::ToolInvocation::runInvocation()
@ 0x5630d0519f26 clang::tooling::ToolInvocation::run()
@ 0x5630d051c625 clang::tooling::ClangTool::run()
@ 0x5630cfe1896f clang::tidy::runClangTidy()

@hokein
Copy link
Collaborator Author

hokein commented Dec 12, 2018

assigned to @haoNoQ

@llvmbot
Copy link
Member

llvmbot commented Apr 17, 2019

This is still reproducible.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@Endilll Endilll added the crash Prefer [crash-on-valid] or [crash-on-invalid] label Sep 11, 2023
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 crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
Development

No branches or pull requests

3 participants