Ericsson / clang

Cross Translation Unit analysis capability for Clang Static Analyzer. (Fork of official clang at http://llvm.org/git/clang)
http://clang.llvm.org/
Other
15 stars 10 forks source link

Assertion `(CRD->isAggregate() || (Ctx.getLangOpts().ObjC && VI == VE)) && "Non-aggregates are constructed with a constructor!"' failed. #700

Closed balazske closed 4 years ago

balazske commented 5 years ago

Assertion during analysis of bitcoin with clang master commit 3c10f346dcd and applied patch in D65577 and D65935.

clang-10: llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp:2392: {anonymous}::RegionBindingsRef {anonymous}::RegionStoreManager::bindStruct(RegionBindingsConstRef, const clang::ento::TypedValueRegion*, clang::ento::SVal): Assertion `(CRD->isAggregate() || (Ctx.getLangOpts().ObjC && VI == VE)) && "Non-aggregates are constructed with a constructor!"' failed.                                                                                                                                                           

 #0 0x00007f4091dc3fda llvm::sys::PrintStackTrace(llvm::raw_ostream&) (build/Release/lib/libLLVMSupport.so.10svn+0x191fda)                                                                                                                                  
 #1 0x00007f4091dc1cb4 llvm::sys::RunSignalHandlers() (build/Release/lib/libLLVMSupport.so.10svn+0x18fcb4)                                                                                                                                                  
 #2 0x00007f4091dc1df2 SignalHandler(int) (build/Release/lib/libLLVMSupport.so.10svn+0x18fdf2)                                                                                                                                                              
 #3 0x00007f408ef65f20 (/lib/x86_64-linux-gnu/libc.so.6+0x3ef20)                                                                                                                                                                                                               
 #4 0x00007f408ef65e97 raise /build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0                                                                                                                                                                     
 #5 0x00007f408ef67801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0                                                                                                                                                                                                
 #6 0x00007f408ef5739a __assert_fail_base /build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0                                                                                                                                                                                  
 #7 0x00007f408ef57412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)                                                                                                                                                                                                               
 #8 0x00007f40869f5006 (anonymous namespace)::RegionStoreManager::bindStruct((anonymous namespace)::RegionBindingsRef const&, clang::ento::TypedValueRegion const*, clang::ento::SVal) (build/Release/lib/libclangStaticAnalyzerCore.so.10svn+0x17a006)     
 #9 0x00007f40869f3e51 (anonymous namespace)::RegionStoreManager::bind((anonymous namespace)::RegionBindingsRef const&, clang::ento::Loc, clang::ento::SVal) (build/Release/lib/libclangStaticAnalyzerCore.so.10svn+0x178e51)                               
#10 0x00007f40869f436e (anonymous namespace)::RegionStoreManager::Bind(void const*, clang::ento::Loc, clang::ento::SVal) (build/Release/lib/libclangStaticAnalyzerCore.so.10svn+0x17936e)                                                                   
#11 0x00007f40869db754 clang::ento::ProgramState::bindLoc(clang::ento::Loc, clang::ento::SVal, clang::LocationContext const*, bool) const (build/Release/lib/libclangStaticAnalyzerCore.so.10svn+0x160754)                                                  
#12 0x00007f40869642fb clang::ento::ExprEngine::createTemporaryRegionIfNeeded(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::LocationContext const*, clang::Expr const*, clang::Expr const*, clang::ento::SubRegion const**) (build/Relea
se/lib/libclangStaticAnalyzerCore.so.10svn+0xe92fb)                                                                                                                                                                                                                            
#13 0x00007f408698a383 clang::ento::ExprEngine::CreateCXXTemporaryObject(clang::MaterializeTemporaryExpr const*, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) (build/Release/lib/libclangStaticAnalyzerCore.so.10svn+0x10f383)                
#14 0x00007f4086972c56 clang::ento::ExprEngine::Visit(clang::Stmt const*, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) (build/Release/lib/libclangStaticAnalyzerCore.so.10svn+0xf7c56)                                                        
#15 0x00007f4086974594 clang::ento::ExprEngine::ProcessStmt(clang::Stmt const*, clang::ento::ExplodedNode*) (build/Release/lib/libclangStaticAnalyzerCore.so.10svn+0xf9594)                                                                                
#16 0x00007f4086974782 clang::ento::ExprEngine::processCFGElement(clang::CFGElement, clang::ento::ExplodedNode*, unsigned int, clang::ento::NodeBuilderContext*) (build/Release/lib/libclangStaticAnalyzerCore.so.10svn+0xf9782)                            
#17 0x00007f4086941cbb clang::ento::CoreEngine::HandlePostStmt(clang::CFGBlock const*, unsigned int, clang::ento::ExplodedNode*) (build/Release/lib/libclangStaticAnalyzerCore.so.10svn+0xc6cbb)                                                            
#18 0x00007f4086941f27 clang::ento::CoreEngine::dispatchWorkItem(clang::ento::ExplodedNode*, clang::ProgramPoint, clang::ento::WorkListUnit const&) (build/Release/lib/libclangStaticAnalyzerCore.so.10svn+0xc6f27)                                         
balazske commented 5 years ago

https://github.com/Ericsson/clang/pull/659 fixes this problem.

martong commented 5 years ago

Ok, could you please create a Phab patch for this one as well?