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

Segmentation fault in (anonymous namespace)::CFGBuilder::VisitDeclStmt #504

Closed balazske closed 5 years ago

balazske commented 5 years ago

During analysis of protobuf the following crash happens (on ctu-clang7):

Starting program: /home/ebalkri/clang/clang7/build_d/bin/clang-8 -cc1 -triple x86_64--linux-gnu -analyze -disable-free -main-file-name objectivec_primitive_field.cc -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-eagerly-assume -analyzer-output plist -w -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -nobuiltininc -resource-dir /home/ebalkri/clang/clang7/build_d/lib/clang/7.0.0 -isystem /home/ebalkri/clang/clang7/build_d/lib/clang/7.0.0/include -isystem /usr/include/c++/4.8 -isystem /usr/include/x86_64-linux-gnu/c++/4.8 -isystem /usr/include/c++/4.8/backward -isystem /usr/local/include -isystem /usr/include/x86_64-linux-gnu -isystem /usr/include -D HAVE_CONFIG_H -I /home/ebalkri/clang/testproject/protobuf-3.5.1/src -I /home/ebalkri/clang/testproject/protobuf-3.5.1 -D HAVE_PTHREAD=1 -D HAVE_ZLIB=1 -D PIC -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward -internal-isystem /usr/local/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-sign-compare -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /home/ebalkri/clang/testproject/protobuf-3.5.1/src -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-loops -vectorize-slp -analyzer-opt-analyze-headers -analyzer-output=plist-multi-file -analyzer-disable-checker alpha.clone.CloneChecker -analyzer-disable-checker alpha.core.BoolAssignment -analyzer-disable-checker alpha.core.CallAndMessageUnInitRefArg -analyzer-disable-checker alpha.core.CastSize -analyzer-disable-checker alpha.core.CastToStruct -analyzer-disable-checker alpha.core.Conversion -analyzer-disable-checker alpha.core.DynamicTypeChecker -analyzer-disable-checker alpha.core.FixedAddr -analyzer-disable-checker alpha.core.IdenticalExpr -analyzer-disable-checker alpha.core.PointerArithm -analyzer-disable-checker alpha.core.PointerSub -analyzer-disable-checker alpha.core.SizeofPtr -analyzer-disable-checker alpha.core.StackAddressAsyncEscape -analyzer-disable-checker alpha.core.TestAfterDivZero -analyzer-disable-checker alpha.cplusplus.DeleteWithNonVirtualDtor -analyzer-disable-checker alpha.cplusplus.IteratorRange -analyzer-disable-checker alpha.cplusplus.MisusedMovedObject -analyzer-disable-checker alpha.cplusplus.UninitializedObject -analyzer-disable-checker alpha.deadcode.UnreachableCode -analyzer-disable-checker alpha.osx.cocoa.DirectIvarAssignment -analyzer-disable-checker alpha.osx.cocoa.DirectIvarAssignmentForAnnotatedFunctions -analyzer-disable-checker alpha.osx.cocoa.InstanceVariableInvalidation -analyzer-disable-checker alpha.osx.cocoa.MissingInvalidationMethod -analyzer-disable-checker alpha.osx.cocoa.localizability.PluralMisuseChecker -analyzer-disable-checker alpha.security.ArrayBound -analyzer-disable-checker alpha.security.ArrayBoundV2 -analyzer-disable-checker alpha.security.MallocOverflow -analyzer-disable-checker alpha.security.MmapWriteExec -analyzer-disable-checker alpha.security.ReturnPtrRange -analyzer-disable-checker alpha.security.taint.TaintPropagation -analyzer-disable-checker alpha.unix.BlockInCriticalSection -analyzer-disable-checker alpha.unix.Chroot -analyzer-disable-checker alpha.unix.PthreadLock -analyzer-disable-checker alpha.unix.SimpleStream -analyzer-disable-checker alpha.unix.Stream -analyzer-disable-checker alpha.unix.cstring.BufferOverlap -analyzer-disable-checker alpha.unix.cstring.NotNullTerminated -analyzer-disable-checker alpha.unix.cstring.OutOfBounds -analyzer-disable-checker apiModeling.TrustNonnull -analyzer-checker=apiModeling.google.GTest -analyzer-checker=core.CallAndMessage -analyzer-checker=core.DivideZero -analyzer-checker=core.DynamicTypePropagation -analyzer-checker=core.NonNullParamChecker -analyzer-checker=core.NonnilStringConstants -analyzer-checker=core.NullDereference -analyzer-checker=core.StackAddressEscape -analyzer-checker=core.UndefinedBinaryOperatorResult -analyzer-checker=core.VLASize -analyzer-checker=core.builtin.BuiltinFunctions -analyzer-checker=core.builtin.NoReturnFunctions -analyzer-checker=core.uninitialized.ArraySubscript -analyzer-checker=core.uninitialized.Assign -analyzer-checker=core.uninitialized.Branch -analyzer-checker=core.uninitialized.CapturedBlockVariable -analyzer-checker=core.uninitialized.UndefReturn -analyzer-disable-checker cplusplus.InnerPointer -analyzer-checker=cplusplus.NewDelete -analyzer-checker=cplusplus.NewDeleteLeaks -analyzer-checker=cplusplus.SelfAssignment -analyzer-checker=deadcode.DeadStores -analyzer-disable-checker debug.AnalysisOrder -analyzer-disable-checker debug.ConfigDumper -analyzer-disable-checker debug.DumpCFG -analyzer-disable-checker debug.DumpCallGraph -analyzer-disable-checker debug.DumpCalls -analyzer-disable-checker debug.DumpDominators -analyzer-disable-checker debug.DumpLiveVars -analyzer-disable-checker debug.DumpTraversal -analyzer-disable-checker debug.ExprInspection -analyzer-disable-checker debug.Stats -analyzer-disable-checker debug.TaintTest -analyzer-disable-checker debug.ViewCFG -analyzer-disable-checker debug.ViewCallGraph -analyzer-disable-checker debug.ViewExplodedGraph -analyzer-disable-checker llvm.Conventions -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-disable-checker nullability.NullableDereferenced -analyzer-disable-checker nullability.NullablePassedToNonnull -analyzer-disable-checker nullability.NullableReturnedFromNonnull -analyzer-disable-checker optin.cplusplus.VirtualCall -analyzer-disable-checker optin.mpi.MPI-Checker -analyzer-disable-checker optin.osx.cocoa.localizability.EmptyLocalizationContextChecker -analyzer-disable-checker optin.osx.cocoa.localizability.NonLocalizedStringChecker -analyzer-disable-checker optin.performance.GCDAntipattern -analyzer-disable-checker optin.performance.Padding -analyzer-checker=optin.portability.UnixAPI -analyzer-disable-checker osx.API -analyzer-disable-checker osx.NumberObjectConversion -analyzer-disable-checker osx.ObjCProperty -analyzer-disable-checker osx.SecKeychainAPI -analyzer-disable-checker osx.cocoa.AtSync -analyzer-disable-checker osx.cocoa.AutoreleaseWrite -analyzer-disable-checker osx.cocoa.ClassRelease -analyzer-disable-checker osx.cocoa.Dealloc -analyzer-disable-checker osx.cocoa.IncompatibleMethodTypes -analyzer-disable-checker osx.cocoa.Loops -analyzer-disable-checker osx.cocoa.MissingSuperCall -analyzer-disable-checker osx.cocoa.NSAutoreleasePool -analyzer-disable-checker osx.cocoa.NSError -analyzer-disable-checker osx.cocoa.NilArg -analyzer-disable-checker osx.cocoa.NonNilReturnValue -analyzer-disable-checker osx.cocoa.ObjCGenerics -analyzer-disable-checker osx.cocoa.RetainCount -analyzer-disable-checker osx.cocoa.RunLoopAutoreleaseLeak -analyzer-disable-checker osx.cocoa.SelfInit -analyzer-disable-checker osx.cocoa.SuperDealloc -analyzer-disable-checker osx.cocoa.UnusedIvars -analyzer-disable-checker osx.cocoa.VariadicMethodTypes -analyzer-disable-checker osx.coreFoundation.CFError -analyzer-disable-checker osx.coreFoundation.CFNumber -analyzer-disable-checker osx.coreFoundation.CFRetainRelease -analyzer-disable-checker osx.coreFoundation.containers.OutOfBounds -analyzer-disable-checker osx.coreFoundation.containers.PointerSizedValues -analyzer-checker=security.FloatLoopCounter -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-disable-checker security.insecureAPI.bcmp -analyzer-disable-checker security.insecureAPI.bcopy -analyzer-disable-checker security.insecureAPI.bzero -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.rand -analyzer-disable-checker security.insecureAPI.strcpy -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=unix.API -analyzer-checker=unix.Malloc -analyzer-checker=unix.MallocSizeof -analyzer-checker=unix.MismatchedDeallocator -analyzer-checker=unix.StdCLibraryFunctions -analyzer-checker=unix.Vfork -analyzer-checker=unix.cstring.BadSizeArg -analyzer-checker=unix.cstring.NullArg -analyzer-checker=valist.CopyToSelf -analyzer-checker=valist.Uninitialized -analyzer-checker=valist.Unterminated -analyzer-config notes-as-events=true -analyzer-config xtu-dir=/home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64 -analyzer-config experimental-enable-naive-ctu-analysis=true -analyzer-config ctu-dir=/home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64 -analyzer-display-ctu-progress -o /home/ebalkri/clang/codechecker-out/protobuf/reports/objectivec_primitive_field.cc_5585b18729d0091ee8f7fbe86eb71adf.plist -x c++ /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc -faddrsig
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/unknown_field_set.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/unknown_field_set.cc:35:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/unknown_field_set.h:42:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/common.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/common.cc:33:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/message_lite.h:43:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/common.h:38:
In file included from /usr/include/c++/4.8/algorithm:62:
In file included from /usr/include/c++/4.8/bits/stl_algo.h:65:
In file included from /usr/include/c++/4.8/random:41:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/once.cc
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/arena.cc
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/compiler/objectivec/objectivec_field.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/compiler/objectivec/objectivec_field.cc:31:
In file included from /usr/include/c++/4.8/iostream:39:
In file included from /usr/include/c++/4.8/ostream:38:
In file included from /usr/include/c++/4.8/ios:42:
In file included from /usr/include/c++/4.8/bits/ios_base.h:41:
In file included from /usr/include/c++/4.8/bits/locale_classes.h:40:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc:37:
In file included from /usr/include/c++/4.8/fstream:38:
In file included from /usr/include/c++/4.8/istream:38:
In file included from /usr/include/c++/4.8/ios:42:
In file included from /usr/include/c++/4.8/bits/ios_base.h:41:
In file included from /usr/include/c++/4.8/bits/locale_classes.h:40:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/descriptor.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/descriptor.cc:35:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/hash.h:39:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/common.h:38:
In file included from /usr/include/c++/4.8/algorithm:62:
In file included from /usr/include/c++/4.8/bits/stl_algo.h:65:
In file included from /usr/include/c++/4.8/random:41:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
warning: missing FriendDecl in imported DeclContext </home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/repeated_field.h:2290:19>
warning: missing FriendDecl in imported DeclContext </home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/repeated_field.h:2373:19>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FriendDecl in imported DeclContext </home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/descriptor.cc:3126:10>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/strutil.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/strutil.cc:33:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/strutil.h:38:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/common.h:38:
In file included from /usr/include/c++/4.8/algorithm:62:
In file included from /usr/include/c++/4.8/bits/stl_algo.h:65:
In file included from /usr/include/c++/4.8/random:41:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/io/printer.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/io/printer.cc:35:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/io/printer.h:40:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/stringpiece.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/stringpiece.cc:30:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/stringpiece.h:149:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/wire_format_lite.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/wire_format_lite.cc:35:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/wire_format_lite_inl.h:39:
In file included from /usr/include/c++/4.8/algorithm:62:
In file included from /usr/include/c++/4.8/bits/stl_algo.h:65:
In file included from /usr/include/c++/4.8/random:41:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/structurally_valid.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/structurally_valid.cc:4:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/common.h:38:
In file included from /usr/include/c++/4.8/algorithm:62:
In file included from /usr/include/c++/4.8/bits/stl_algo.h:65:
In file included from /usr/include/c++/4.8/random:41:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/stringprintf.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/stringprintf.cc:33:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/stringprintf.h:44:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/descriptor.pb.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/descriptor.pb.cc:4:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/descriptor.pb.h:7:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/repeated_field.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/repeated_field.cc:35:
In file included from /usr/include/c++/4.8/algorithm:62:
In file included from /usr/include/c++/4.8/bits/stl_algo.h:65:
In file included from /usr/include/c++/4.8/random:41:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/generated_message_util.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/generated_message_util.cc:35:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/generated_message_util.h:43:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/extension_set.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/extension_set.cc:35:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/hash.h:39:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/stubs/common.h:38:
In file included from /usr/include/c++/4.8/algorithm:62:
In file included from /usr/include/c++/4.8/bits/stl_algo.h:65:
In file included from /usr/include/c++/4.8/random:41:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
ANALYZE (CTU loaded AST for source file): /home/ebalkri/clang/codechecker-out/protobuf/reports/ctu-dir/x86_64/ast/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/generated_message_reflection.cc
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/generated_message_reflection.cc:35:
In file included from /usr/include/c++/4.8/algorithm:62:
In file included from /usr/include/c++/4.8/bits/stl_algo.h:65:
In file included from /usr/include/c++/4.8/random:41:
In file included from /usr/include/c++/4.8/string:52:
/usr/include/c++/4.8/bits/basic_string.h:178:26: error: external variable '_S_empty_rep_storage' declared with incompatible types in different translation units ('std::basic_string::size_type []' vs. 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]')
        static size_type _S_empty_rep_storage[];
                         ^
/usr/include/c++/4.8/bits/basic_string.tcc:66:50: note: declared here with type 'typename basic_string<_CharT, _Traits, _Alloc>::size_type [(sizeof(std::basic_string::_Rep_base) + sizeof(_CharT) + sizeof(std::basic_string::size_type) - 1) / sizeof(std::basic_string::size_type)]'
    basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_empty_rep_storage[
                                                 ^
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:253:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:280:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:305:9>
warning: missing FunctionTemplateDecl in imported DeclContext </usr/include/c++/4.8/bits/alloc_traits.h:331:9>
warning: missing FriendDecl in imported DeclContext </home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/map_field.h:749:15>
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/generated_message_reflection.cc:40:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/descriptor.pb.h:28:
In file included from /home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/message.h:122:
/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/descriptor.h:453:19: error: field 'extension_ranges_' declared with incompatible types in different translation units ('google::protobuf::Descriptor::ExtensionRange *' vs. 'google::protobuf::Descriptor::ExtensionRange *')
  ExtensionRange* extension_ranges_;
                  ^
/home/ebalkri/clang/testproject/protobuf-3.5.1/src/google/protobuf/descriptor.h:453:19: note: declared here with type 'google::protobuf::Descriptor::ExtensionRange *'
  ExtensionRange* extension_ranges_;
                  ^

Program received signal SIGSEGV, Segmentation fault.
0x00007fffe962a0d3 in llvm::simplify_type<clang::Decl* const>::getSimplifiedValue (Val=@0x0: <error reading variable>) at /home/ebalkri/clang/clang7/llvm/include/llvm/Support/Casting.h:49
49          return simplify_type<From>::getSimplifiedValue(const_cast<From&>(Val));
(gdb) bt
#0  0x00007fffe962a0d3 in llvm::simplify_type<clang::Decl* const>::getSimplifiedValue (Val=@0x0: <error reading variable>) at /home/ebalkri/clang/clang7/llvm/include/llvm/Support/Casting.h:49
#1  0x00007fffe9661f2a in llvm::isa_impl_wrap<clang::LabelDecl, clang::Decl* const, clang::Decl const*>::doit (Val=@0x0: <error reading variable>) at /home/ebalkri/clang/clang7/llvm/include/llvm/Support/Casting.h:125
#2  0x00007fffe965c473 in llvm::isa<clang::LabelDecl, clang::Decl*> (Val=@0x0: <error reading variable>) at /home/ebalkri/clang/clang7/llvm/include/llvm/Support/Casting.h:144
#3  0x00007fffe963e85d in (anonymous namespace)::CFGBuilder::VisitDeclStmt (this=0x7fffffff76c0, DS=0x21a8a880) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:2617
#4  0x00007fffe963cca9 in (anonymous namespace)::CFGBuilder::Visit (this=0x7fffffff76c0, S=0x21a8a880, asc=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:2082
#5  0x00007fffe9637bf5 in (anonymous namespace)::CFGBuilder::addStmt (this=0x7fffffff76c0, S=0x21a8a880) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:716
#6  0x00007fffe963e4b9 in (anonymous namespace)::CFGBuilder::VisitCompoundStmt (this=0x7fffffff76c0, C=0x21a8ad28) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:2537
#7  0x00007fffe963ca8c in (anonymous namespace)::CFGBuilder::Visit (this=0x7fffffff76c0, S=0x21a8ad28, asc=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:2027
#8  0x00007fffe9637bf5 in (anonymous namespace)::CFGBuilder::addStmt (this=0x7fffffff76c0, S=0x21a8ad28) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:716
#9  0x00007fffe9640583 in (anonymous namespace)::CFGBuilder::VisitForStmt (this=0x7fffffff76c0, F=0x21a8ad58) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:3172
#10 0x00007fffe963cd12 in (anonymous namespace)::CFGBuilder::Visit (this=0x7fffffff76c0, S=0x21a8ad58, asc=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:2091
#11 0x00007fffe9637bf5 in (anonymous namespace)::CFGBuilder::addStmt (this=0x7fffffff76c0, S=0x21a8ad58) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:716
#12 0x00007fffe963e4b9 in (anonymous namespace)::CFGBuilder::VisitCompoundStmt (this=0x7fffffff76c0, C=0x21a8ad98) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:2537
#13 0x00007fffe963ca8c in (anonymous namespace)::CFGBuilder::Visit (this=0x7fffffff76c0, S=0x21a8ad98, asc=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:2027
#14 0x00007fffe9637bf5 in (anonymous namespace)::CFGBuilder::addStmt (this=0x7fffffff76c0, S=0x21a8ad98) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:716
#15 0x00007fffe9642929 in (anonymous namespace)::CFGBuilder::VisitSwitchStmt (this=0x7fffffff76c0, Terminator=0x21a862a0) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:3865
#16 0x00007fffe963d086 in (anonymous namespace)::CFGBuilder::Visit (this=0x7fffffff76c0, S=0x21a862a0, asc=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:2171
#17 0x00007fffe9637bf5 in (anonymous namespace)::CFGBuilder::addStmt (this=0x7fffffff76c0, S=0x21a862a0) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:716
#18 0x00007fffe963e4b9 in (anonymous namespace)::CFGBuilder::VisitCompoundStmt (this=0x7fffffff76c0, C=0x21a8aee8) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:2537
#19 0x00007fffe963ca8c in (anonymous namespace)::CFGBuilder::Visit (this=0x7fffffff76c0, S=0x21a8aee8, asc=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:2027
#20 0x00007fffe9637bf5 in (anonymous namespace)::CFGBuilder::addStmt (this=0x7fffffff76c0, S=0x21a8aee8) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:716
#21 0x00007fffe963f1fe in (anonymous namespace)::CFGBuilder::VisitIfStmt (this=0x7fffffff76c0, I=0x21a909b0) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:2812
#22 0x00007fffe963cd58 in (anonymous namespace)::CFGBuilder::Visit (this=0x7fffffff76c0, S=0x21a909b0, asc=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:2097
#23 0x00007fffe9637bf5 in (anonymous namespace)::CFGBuilder::addStmt (this=0x7fffffff76c0, S=0x21a909b0) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:716
#24 0x00007fffe963e4b9 in (anonymous namespace)::CFGBuilder::VisitCompoundStmt (this=0x7fffffff76c0, C=0x21a909e8) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:2537
#25 0x00007fffe963ca8c in (anonymous namespace)::CFGBuilder::Visit (this=0x7fffffff76c0, S=0x21a909e8, asc=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:2027
#26 0x00007fffe9637bf5 in (anonymous namespace)::CFGBuilder::addStmt (this=0x7fffffff76c0, S=0x21a909e8) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:716
#27 0x00007fffe963a53f in (anonymous namespace)::CFGBuilder::buildCFG (this=0x7fffffff76c0, D=0x21a84648, Statement=0x21a909e8) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:1414
#28 0x00007fffe964516c in clang::CFG::buildCFG (D=0x21a84648, Statement=0x21a909e8, C=0x6e3cc0, BO=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/CFG.cpp:4637
#29 0x00007fffe96199f6 in clang::AnalysisDeclContext::getCFG (this=0x2456cea0) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp:218
#30 0x00007fffe18b9ea8 in mayInlineDecl (AMgr=..., CalleeADC=0x2456cea0) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:827
#31 0x00007fffe18ba06e in clang::ento::ExprEngine::shouldInlineCall (this=0x7fffffff8ad0, Call=..., D=0x21a84648, Pred=0x2457e4a8, CallOpts=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:875
#32 0x00007fffe18ba523 in clang::ento::ExprEngine::defaultEvalCall (this=0x7fffffff8ad0, Bldr=..., Pred=0x2457e4a8, CallTemplate=..., CallOpts=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:963
#33 0x00007fffe1848f90 in clang::ento::CheckerManager::runCheckersForEvalCall (this=0x6f2b40, Dst=..., Src=..., Call=..., Eng=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp:679
#34 0x00007fffe18b8c67 in clang::ento::ExprEngine::evalCall (this=0x7fffffff8ad0, Dst=..., Pred=0x2457e2d8, Call=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:527
#35 0x00007fffe18b8af4 in clang::ento::ExprEngine::VisitCallExpr (this=0x7fffffff8ad0, CE=0x21a90b78, Pred=0x2457e2d8, dst=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:498
#36 0x00007fffe188574f in clang::ento::ExprEngine::Visit (this=0x7fffffff8ad0, S=0x21a90b78, Pred=0x2457e2d8, DstTop=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:1528
#37 0x00007fffe188157f in clang::ento::ExprEngine::ProcessStmt (this=0x7fffffff8ad0, currStmt=0x21a90b78, Pred=0x2457d618) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:732
#38 0x00007fffe1880720 in clang::ento::ExprEngine::processCFGElement (this=0x7fffffff8ad0, E=..., Pred=0x2457d618, StmtIdx=17, Ctx=0x7fffffff86e0) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:570
#39 0x00007fffe1868e89 in clang::ento::CoreEngine::HandlePostStmt (this=0x7fffffff8af0, B=0x2434dc10, StmtIdx=17, Pred=0x2457d618) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:433
#40 0x00007fffe1867cc0 in clang::ento::CoreEngine::dispatchWorkItem (this=0x7fffffff8af0, Pred=0x2457d618, Loc=..., WU=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:191
#41 0x00007fffe18677e0 in clang::ento::CoreEngine::ExecuteWorkList (this=0x7fffffff8af0, L=0x21eb76b0, Steps=222618, InitState=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:147
#42 0x00007fffe37b3d12 in clang::ento::ExprEngine::ExecuteWorkList (this=0x7fffffff8ad0, L=0x21eb76b0, Steps=225000) at /home/ebalkri/clang/clang7/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h:168
#43 0x00007fffe3758bef in (anonymous namespace)::AnalysisConsumer::ActionExprEngine (this=0x6f22f0, D=0x2f8a5b0, ObjCGCEnabled=false, IMode=clang::ento::ExprEngine::Inline_Regular, VisitedCallees=0x7fffffff90e0)
    at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:756
#44 0x00007fffe3758d0e in (anonymous namespace)::AnalysisConsumer::RunPathSensitiveChecks (this=0x6f22f0, D=0x2f8a5b0, IMode=clang::ento::ExprEngine::Inline_Regular, Visited=0x7fffffff90e0)
    at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:776
#45 0x00007fffe37589c6 in (anonymous namespace)::AnalysisConsumer::HandleCode (this=0x6f22f0, D=0x2f8a5b0, Mode=2, IMode=clang::ento::ExprEngine::Inline_Regular, VisitedCallees=0x7fffffff90e0)
    at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:722
#46 0x00007fffe3757774 in (anonymous namespace)::AnalysisConsumer::HandleDeclsCallGraph (this=0x6f22f0, LocalTUDeclsSize=5241) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:514
#47 0x00007fffe3757bae in (anonymous namespace)::AnalysisConsumer::runAnalysisOnTranslationUnit (this=0x6f22f0, C=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:560
#48 0x00007fffe3757dcb in (anonymous namespace)::AnalysisConsumer::HandleTranslationUnit (this=0x6f22f0, C=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:591
#49 0x00007fffe6e1d2a9 in clang::ParseAST (S=..., PrintStats=false, SkipFunctionBodies=false) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Parse/ParseAST.cpp:170
#50 0x00007fffee477c60 in clang::ASTFrontendAction::ExecuteAction (this=0x6d56f0) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:1012
#51 0x00007fffee47769f in clang::FrontendAction::Execute (this=0x6d56f0) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:910
#52 0x00007fffee3f6baf in clang::CompilerInstance::ExecuteAction (this=0x6c9b00, Act=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:961
#53 0x00007fffedee257f in clang::ExecuteCompilerInvocation (Clang=0x6c9b00) at /home/ebalkri/clang/clang7/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:257
#54 0x0000000000453dff in cc1_main (Argv=..., Argv0=0x7fffffffbdd2 "/home/ebalkri/clang/clang7/build_d/bin/clang-8", MainAddr=0x4476ce <GetExecutablePath(char const*, bool)>) at /home/ebalkri/clang/clang7/llvm/tools/clang/tools/driver/cc1_main.cpp:218
#55 0x0000000000449a4d in ExecuteCC1Tool (argv=..., Tool=...) at /home/ebalkri/clang/clang7/llvm/tools/clang/tools/driver/driver.cpp:310
#56 0x000000000044a78d in main (argc_=341, argv_=0x7fffffffafb8) at /home/ebalkri/clang/clang7/llvm/tools/clang/tools/driver/driver.cpp:382
balazske commented 5 years ago

The problem is caused by an empty DeclGroup in DeclStmt. This happens because the check for failed import of the DeclGroup in VisitDeclStmt is not correct when a single Decl is failing to import: The new DeclGroup will be created with a single nullptr and will behave as an empty group.

martong commented 5 years ago

This is related: https://github.com/Ericsson/clang/issues/487 where we also had an empty DeclGroup. The DeclGroup was empty becasue class templates redecl chain was incorrect.

balazske commented 5 years ago

The correction of the wrong check makes this crash go away but a next one ToDecl->hasBody() follows. The root cause is anyway not the bad check but the failed import. And the error reports do not look correct, for example (this comes before the crash):

clang/testproject/protobuf-3.5.1/src/google/protobuf/descriptor.h:453:19: error: field 'extension_ranges_' declared with incompatible types in different translation units ('google::protobuf::Descriptor::ExtensionRange *' vs. 'google::protobuf::Descriptor::ExtensionRange *')
  ExtensionRange* extension_ranges_;
                  ^
clang/testproject/protobuf-3.5.1/src/google/protobuf/descriptor.h:453:19: note: declared here with type 'google::protobuf::Descriptor::ExtensionRange *'
  ExtensionRange* extension_ranges_;

I will try this after #505 is finished.

martong commented 5 years ago

Fixed.