[llvm-bugs] [Bug 49422] New: e clang::ento::BasicValueFactory::getAPSIntType(clang::QualType) const: Assertion `T->isIntegralOrEnumerationType() || Loc::isLocType(T)' failed.
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Mar 3 19:04:22 PST 2021
https://bugs.llvm.org/show_bug.cgi?id=49422
Bug ID: 49422
Summary: e
clang::ento::BasicValueFactory::getAPSIntType(clang::Q
ualType) const: Assertion
`T->isIntegralOrEnumerationType() ||
Loc::isLocType(T)' failed.
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Static Analyzer
Assignee: dcoughlin at apple.com
Reporter: rmansfield at gmail.com
CC: dcoughlin at apple.com, llvm-bugs at lists.llvm.org
Building with -DLLVM_ENABLE_ASSERTIONS=On
$ cat ~/t.i
struct a {
int b;
};
typedef struct {
long c;
_Atomic(struct a) d[]
} e;
f;
e g;
h() {
struct a i = __c11_atomic_load(&g.d[f], 5);
_Atomic j = i.b;
0 < j;
}
$ ./bin/clang --analyze ~/t.i
clang:
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h:142:
clang::ento::APSIntType
clang::ento::BasicValueFactory::getAPSIntType(clang::QualType) const: Assertion
`T->isIntegralOrEnumerationType() || Loc::isLocType(T)' failed.
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: ./bin/clang --analyze /home/ryan_mansfield/t.i
1. <eof> parser at end of file
2. While analyzing stack:
#0 Calling h
3. /home/ryan_mansfield/t.i:13:3: Error evaluating statement
4. /home/ryan_mansfield/t.i:13:3: Error evaluating statement
#0 0x000000000362b48a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
/home/ryan_mansfield/llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:11
#1 0x000000000362b6bb PrintStackTraceSignalHandler(void*)
/home/ryan_mansfield/llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:1
#2 0x0000000003628830 llvm::sys::RunSignalHandlers()
/home/ryan_mansfield/llvm/llvm-project/llvm/lib/Support/Signals.cpp:71:5
#3 0x0000000003629c7e llvm::sys::CleanupOnSignal(unsigned long)
/home/ryan_mansfield/llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:362:1
#4 0x0000000003515978 (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/ryan_mansfield/llvm/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:75:20
#5 0x0000000003515c53 CrashRecoverySignalHandler(int)
/home/ryan_mansfield/llvm/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:389:1
#6 0x00007ffff79ae980 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
#7 0x00007ffff6505fb7 raise
/build/glibc-S7xCS9/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#8 0x00007ffff6507921 abort /build/glibc-S7xCS9/glibc-2.27/stdlib/abort.c:81:0
#9 0x00007ffff64f748a __assert_fail_base
/build/glibc-S7xCS9/glibc-2.27/assert/assert.c:89:0
#10 0x00007ffff64f7502 (/lib/x86_64-linux-gnu/libc.so.6+0x30502)
#11 0x000000000695ce9e
clang::ento::BasicValueFactory::getAPSIntType(clang::QualType) const
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h:0:5
#12 0x00000000074a9560 clang::ento::BasicValueFactory::Convert(clang::QualType,
llvm::APSInt const&)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h:159:29
#13 0x0000000007516406 (anonymous
namespace)::SimpleSValBuilder::MakeSymIntVal(clang::ento::SymExpr const*,
clang::BinaryOperatorKind, llvm::APSInt const&, clang::QualType)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:304:22
#14 0x0000000007513667 (anonymous
namespace)::SimpleSValBuilder::evalBinOpNN(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState
const>, clang::BinaryOperatorKind, clang::ento::NonLoc, clang::ento::NonLoc,
clang::QualType)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:767:16
#15 0x000000000752c641
clang::ento::SValBuilder::evalBinOp(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState
const>, clang::BinaryOperatorKind, clang::ento::SVal, clang::ento::SVal,
clang::QualType)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:442:10
#16 0x0000000007430936
clang::ento::ExprEngine::evalBinOp(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState
const>, clang::BinaryOperatorKind, clang::ento::SVal, clang::ento::SVal,
clang::QualType)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h:631:24
#17 0x000000000744ba5b
clang::ento::ExprEngine::VisitBinaryOperator(clang::BinaryOperator const*,
clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp:100:21
#18 0x000000000741d72f clang::ento::ExprEngine::Visit(clang::Stmt const*,
clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:1574:64
#19 0x000000000741a57c clang::ento::ExprEngine::ProcessStmt(clang::Stmt const*,
clang::ento::ExplodedNode*)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:792:9
#20 0x000000000741a283
clang::ento::ExprEngine::processCFGElement(clang::CFGElement,
clang::ento::ExplodedNode*, unsigned int, clang::ento::NodeBuilderContext*)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:637:7
#21 0x00000000073e5db2 clang::ento::CoreEngine::HandlePostStmt(clang::CFGBlock
const*, unsigned int, clang::ento::ExplodedNode*)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:468:1
#22 0x00000000073e54cf
clang::ento::CoreEngine::dispatchWorkItem(clang::ento::ExplodedNode*,
clang::ProgramPoint, clang::ento::WorkListUnit const&)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:194:1
#23 0x00000000073e5073
clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*,
unsigned int, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:128:3
#24 0x00000000068c7cb7
clang::ento::ExprEngine::ExecuteWorkList(clang::LocationContext const*,
unsigned int)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h:192:5
#25 0x00000000068baf63 (anonymous
namespace)::AnalysisConsumer::RunPathSensitiveChecks(clang::Decl*,
clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*,
llvm::DenseMapInfo<clang::Decl const*> >*)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:709:7
#26 0x00000000068baa5a (anonymous
namespace)::AnalysisConsumer::HandleCode(clang::Decl*, unsigned int,
clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*,
llvm::DenseMapInfo<clang::Decl const*> >*)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:683:15
#27 0x0000000006842576 (anonymous
namespace)::AnalysisConsumer::HandleDeclsCallGraph(unsigned int)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:475:31
#28 0x0000000006841206 (anonymous
namespace)::AnalysisConsumer::runAnalysisOnTranslationUnit(clang::ASTContext&)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:0:5
#29 0x00000000068407cf (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:0:5
#30 0x00000000075f5011 clang::ParseAST(clang::Sema&, bool, bool)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/Parse/ParseAST.cpp:178:12
#31 0x000000000467cc82 clang::ASTFrontendAction::ExecuteAction()
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:1058:1
#32 0x000000000467bf38 clang::FrontendAction::Execute()
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:953:7
#33 0x0000000004536af6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:955:23
#34 0x0000000004890087
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:278:8
#35 0x0000000000cceb2a cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/tools/driver/cc1_main.cpp:246:13
#36 0x0000000000cbec19 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/tools/driver/driver.cpp:335:5
#37 0x000000000438c6b8
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >*, bool*) const::$_1::operator()() const
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/Driver/Job.cpp:404:34
#38 0x000000000438c685 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >*, bool*) const::$_1>(long)
/home/ryan_mansfield/llvm/llvm-project/llvm/include/llvm/ADT/STLExtras.h:185:5
#39 0x0000000003507099 llvm::function_ref<void ()>::operator()() const
/home/ryan_mansfield/llvm/llvm-project/llvm/include/llvm/ADT/STLExtras.h:209:5
#40 0x0000000003515764
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
/home/ryan_mansfield/llvm/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:425:3
#41 0x000000000438c17d
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >*, bool*) const
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/Driver/Job.cpp:404:7
#42 0x000000000431ec7b
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/Driver/Compilation.cpp:195:7
#43 0x000000000431ef59
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&)
const
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/Driver/Compilation.cpp:248:13
#44 0x0000000004347e9e
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&)
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/lib/Driver/Driver.cpp:1539:7
#45 0x0000000000cbe31f main
/home/ryan_mansfield/llvm/llvm-project/llvm/tools/clang/tools/driver/driver.cpp:507:9
#46 0x00007ffff64e8bf7 __libc_start_main
/build/glibc-S7xCS9/glibc-2.27/csu/../csu/libc-start.c:344:0
#47 0x0000000000cbcc0a _start (./bin/clang+0xcbcc0a)
clang-13: error: clang frontend command failed with exit code 134 (use -v to
see invocation)
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
9d8a3e75b442ad7f5cdcb3c8d5b968d8189f46d2)
Target: x86_64-unknown-linux-gnu
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210304/d9f609d0/attachment.html>
More information about the llvm-bugs
mailing list