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 `It->is(tok::l_paren) && "This token should be '('!"' failed. #653

Closed balazske closed 5 years ago

balazske commented 5 years ago

Assertion during LLVM analysis:

clang-7: ../../git/llvm/tools/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:1037: const clang::Token* getMatchingRParen(clang::MacroInfo::tokens_iterator, clang::MacroInfo::tokens_iterator): Assertion `It->is(tok::l_paren) && "This token should be '('!"' failed.

Program arguments: /mnt/ssd/egbomrt/WORK/llvm/build/release_assert/bin/clang-7 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -main-file-name LLParser.cpp -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 -ffunction-sections -fdata-sections -nobuiltininc -resource-dir /mnt/ssd/egbomrt/WORK/llvm/build/release_assert/lib/clang/7.1.0 -isystem /mnt/ssd/egbomrt/WORK/llvm/build/release_assert/lib/clang/7.1.0/include -D GTEST_HAS_RTTI=0 -D _DEBUG -D _GNU_SOURCE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -I /mnt/ssd/egbomrt/WORK/CodeCheckerProjects/llvm/build/release_assert/lib/AsmParser -I /mnt/ssd/egbomrt/WORK/CodeCheckerProjects/llvm/git/llvm/lib/AsmParser -I /usr/include/libxml2 -I /mnt/ssd/egbomrt/WORK/CodeCheckerProjects/llvm/build/release_assert/include -I /mnt/ssd/egbomrt/WORK/CodeCheckerProjects/llvm/git/llvm/include -U NDEBUG -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/backward -internal-isystem /usr/local/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Wno-unused-parameter -Wno-missing-field-initializers -Wno-long-long -Wno-maybe-uninitialized -Wno-comment -pedantic -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /mnt/ssd/egbomrt/WORK/CodeCheckerProjects/llvm/build/release_assert -ferror-limit 19 -fmessage-length 0 -fvisibility-inlines-hidden -fno-rtti -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -analyzer-opt-analyze-headers -analyzer-output=plist-multi-file -analyzer-config expand-macros=true -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-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 aggressive-binary-operation-simplification=true -analyzer-config experimental-enable-naive-ctu-analysis=true -analyzer-config ctu-dir=/mnt/ssd/egbomrt/WORK/CodeCheckerProjects/llvm/build/release_assert/reports/ctu-dir/x86_64 -analyzer-display-ctu-progress -analyzer-ctu-import-threshold=8 -o /mnt/ssd/egbomrt/WORK/CodeCheckerProjects/llvm/build/release_assert/reports/LLParser.cpp_762cdca3f91f9f52b37639be37d9ab79.plist -x c++ /mnt/ssd/egbomrt/WORK/CodeCheckerProjects/llvm/git/llvm/lib/AsmParser/LLParser.cpp -faddrsig 
balazske commented 5 years ago

It looks like that the problem does not occur after fix #652. It might be related: The source location is not invalid but points to wrong place (in different AST context).