[LLVMbugs] [Bug 13409] New: llvm::APInt::operator==(const llvm::APInt &) const: Assertion `BitWidth == RHS.BitWidth && "Comparison requires equal bit widths"' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 19 13:05:00 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13409

             Bug #: 13409
           Summary: llvm::APInt::operator==(const llvm::APInt &) const:
                    Assertion `BitWidth == RHS.BitWidth && "Comparison
                    requires equal bit widths"' failed.
           Product: clang
           Version: 3.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: jepler at dsndata.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8927
  --> http://llvm.org/bugs/attachment.cgi?id=8927
Input file that crashes c++-analyzer

When processed with 'scan-build c++-analyzer -m32 -c minimized1.ii', the
attached file encounters an assertion error in clang++.

llvm/include/llvm/ADT/APInt.h:858: bool llvm::APInt::operator==(const
llvm::APInt&) const: Assertion `BitWidth == RHS.BitWidth && "Comparison
requires equal bit widths"' failed.
0  clang++         0x00000000023e811f
1  clang++         0x00000000023e8f27
2  libpthread.so.0 0x00007ffdca12f7d0
3  libc.so.6       0x00007ffdc9453095 gsignal + 53
4  libc.so.6       0x00007ffdc9454af0 abort + 272
5  libc.so.6       0x00007ffdc944c2df __assert_fail + 239
6  clang++         0x000000000104c0b0
clang::ento::BasicValueFactory::evalAPSInt(clang::BinaryOperatorKind,
llvm::APSInt const&, llvm::APSInt const&) + 3136
7  clang++         0x00000000010f1667
clang::ento::nonloc::ConcreteInt::evalBinOp(clang::ento::SValBuilder&,
clang::BinaryOperatorKind, clang::ento::nonloc::ConcreteInt const&) const + 23
8  clang++         0x00000000010f8bc5
9  clang++         0x00000000010efb88
clang::ento::SValBuilder::evalBinOp(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState
const>, clang::BinaryOperatorKind, clang::ento::SVal, clang::ento::SVal,
clang::QualType) + 808
10 clang++         0x00000000010a162d
clang::ento::ExprEngine::VisitBinaryOperator(clang::BinaryOperator const*,
clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) + 1389
11 clang++         0x00000000010972ce
clang::ento::ExprEngine::Visit(clang::Stmt const*, clang::ento::ExplodedNode*,
clang::ento::ExplodedNodeSet&) + 10894
12 clang++         0x0000000001098364
clang::ento::ExprEngine::ProcessStmt(clang::CFGStmt,
clang::ento::ExplodedNode*) + 1220
13 clang++         0x0000000001099372
clang::ento::ExprEngine::processCFGElement(clang::CFGElement,
clang::ento::ExplodedNode*, unsigned int, clang::ento::NodeBuilderContext*) +
194
14 clang++         0x000000000107f760
clang::ento::CoreEngine::HandlePostStmt(clang::CFGBlock const*, unsigned int,
clang::ento::ExplodedNode*) + 144
15 clang++         0x000000000107f9cb
clang::ento::CoreEngine::dispatchWorkItem(clang::ento::ExplodedNode*,
clang::ProgramPoint, clang::ento::WorkListUnit const&) + 123
16 clang++         0x000000000107fcfe
clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*,
unsigned int, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>) + 206
17 clang++         0x0000000000f2da9a
18 clang++         0x0000000000f2e56a
19 clang++         0x0000000000f43096
20 clang++         0x0000000000f436c6
21 clang++         0x0000000000a1aed4 clang::ParseAST(clang::Sema&, bool, bool)
+ 484
22 clang++         0x00000000006a146f
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 351
23 clang++         0x000000000067f167
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1591
24 clang++         0x000000000067491d cc1_main(char const**, char const**, char
const*, void*) + 1053
25 clang++         0x000000000067dc15 main + 4229
26 libc.so.6       0x00007ffdc943f1c4 __libc_start_main + 244
27 clang++         0x0000000000672519
Stack dump:
0.    Program arguments: tools/clang/bin//clang++ -cc1 -triple
i386-unknown-linux-gnu -analyze -disable-free -main-file-name minimized1.ii
-analyzer-store=region -analyzer-opt-analyze-nested-blocks
-analyzer-eagerly-assume -analyzer-ipa=inlining -analyzer-checker=core
-analyzer-checker=unix -analyzer-checker=deadcode
-analyzer-checker=security.insecureAPI.UncheckedReturn
-analyzer-checker=security.insecureAPI.getpw
-analyzer-checker=security.insecureAPI.gets
-analyzer-checker=security.insecureAPI.mktemp
-analyzer-checker=security.insecureAPI.mkstemp
-analyzer-checker=security.insecureAPI.vfork -analyzer-output plist -w
-mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases
-target-cpu pentium4 -target-linker-version 2.18.0.20080103
-momit-leaf-frame-pointer -resource-dir /src/jepler/clang/bin/../lib/clang/3.1
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.2/../../../../include/c++/4.2 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.2/../../../../include/c++/4.2/x86_64-linux-gnu/32
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.2/../../../../include/c++/4.2/backward
-internal-isystem /usr/local/include -internal-isystem
/src/jepler/clang/bin/../lib/clang/3.1/include -internal-externc-isystem
/usr/include/i486-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdeprecated-macro
-fdebug-compilation-dir /src/jepler/sds2 -ferror-limit 19 -fmessage-length 0
-mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak
-fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-analyzer-output=html -o /tmp/scan-build-2012-07-19-34 -x c++ minimized1.ii 
1.    <eof> parser at end of file
2.    minimized1.cc:12:25: Error evaluating statement
3.    minimized1.cc:12:25: Error evaluating statement

$ clang++ --version
clang version 3.1 (branches/release_31)
Target: x86_64-unknown-linux-gnu
Thread model: posix

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list