[llvm-bugs] [Bug 28739] New: crash on x86_64-linux-gnu (Assertion `getMinSignedBits() <= 64 && "Too many bits for int64_t"' )

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 27 06:35:33 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28739

            Bug ID: 28739
           Summary: crash on x86_64-linux-gnu (Assertion
                    `getMinSignedBits() <= 64 && "Too many bits for
                    int64_t"' )
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: chengniansun at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

$ clang-trunk -v
clang version 4.0.0 (trunk 276859)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.1.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.1.1
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.1.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$
$ clang-trunk small.c
clang-4.0: /tmp/llvm-builder/llvm-source-trunk/include/llvm/ADT/APInt.h:1331:
int64_t llvm::APInt::getSExtValue() const: Assertion `getMinSignedBits() <= 64
&& "Too many bits for int64_t"' failed.
#0 0x0000000001b3b165 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1b3b165)
#1 0x0000000001b38e8e llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-4.0+0x1b38e8e)
#2 0x0000000001b38ff2 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-4.0+0x1b38ff2)
#3 0x00007faee0d57ed0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10ed0)
#4 0x00007faedf8ed1c8 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x331c8)
#5 0x00007faedf8ee64a abort (/lib/x86_64-linux-gnu/libc.so.6+0x3464a)
#6 0x00007faedf8e6107 (/lib/x86_64-linux-gnu/libc.so.6+0x2c107)
#7 0x00007faedf8e61b2 (/lib/x86_64-linux-gnu/libc.so.6+0x2c1b2)
#8 0x0000000002fd4d0b getExtValue(llvm::APSInt const&)
(/usr/local/clang-trunk/bin/clang-4.0+0x2fd4d0b)
#9 0x00000000008c35b7 (anonymous
namespace)::PointerExprEvaluator::VisitBinaryOperator(clang::BinaryOperator
const*) (/usr/local/clang-trunk/bin/clang-4.0+0x8c35b7)
#10 0x0000000002fe8b35 clang::StmtVisitorBase<clang::make_const_ptr, (anonymous
namespace)::PointerExprEvaluator, bool>::Visit(clang::Stmt const*)
(/usr/local/clang-trunk/bin/clang-4.0+0x2fe8b35)
#11 0x0000000002fe9de0 EvaluatePointer(clang::Expr const*, (anonymous
namespace)::LValue&, (anonymous namespace)::EvalInfo&)
(/usr/local/clang-trunk/bin/clang-4.0+0x2fe9de0)
#12 0x0000000002feb4c5 Evaluate(clang::APValue&, (anonymous
namespace)::EvalInfo&, clang::Expr const*)
(/usr/local/clang-trunk/bin/clang-4.0+0x2feb4c5)
#13 0x0000000002fec5be EvaluateAsRValue((anonymous namespace)::EvalInfo&,
clang::Expr const*, clang::APValue&)
(/usr/local/clang-trunk/bin/clang-4.0+0x2fec5be)
#14 0x0000000002fec912 clang::Expr::EvaluateForOverflow(clang::ASTContext
const&) const (/usr/local/clang-trunk/bin/clang-4.0+0x2fec912)
#15 0x00000000027b2446 clang::Sema::CheckForIntOverflow(clang::Expr*)
(/usr/local/clang-trunk/bin/clang-4.0+0x27b2446)
#16 0x0000000002973856 clang::Sema::ActOnFinishFullExpr(clang::Expr*,
clang::SourceLocation, bool, bool, bool)
(/usr/local/clang-trunk/bin/clang-4.0+0x2973856)
#17 0x0000000002a8d610
clang::Sema::ActOnExprStmt(clang::ActionResult<clang::Expr*, true>)
(/usr/local/clang-trunk/bin/clang-4.0+0x2a8d610)
#18 0x000000000261ea3d clang::Parser::ParseExprStatement()
(/usr/local/clang-trunk/bin/clang-4.0+0x261ea3d)
#19 0x000000000261c3bf
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
(/usr/local/clang-trunk/bin/clang-4.0+0x261c3bf)
#20 0x000000000261c51e
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*)
(/usr/local/clang-trunk/bin/clang-4.0+0x261c51e)
#21 0x0000000002620cd7 clang::Parser::ParseCompoundStatementBody(bool)
(/usr/local/clang-trunk/bin/clang-4.0+0x2620cd7)
#22 0x0000000002622fd9 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) (/usr/local/clang-trunk/bin/clang-4.0+0x2622fd9)
#23 0x00000000025a8098
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/usr/local/clang-trunk/bin/clang-4.0+0x25a8098)
#24 0x00000000025c5916 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/usr/local/clang-trunk/bin/clang-4.0+0x25c5916)
#25 0x00000000025a4152
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/usr/local/clang-trunk/bin/clang-4.0+0x25a4152)
#26 0x00000000025a4811
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) [clone .part.158] [clone
.constprop.181] (/usr/local/clang-trunk/bin/clang-4.0+0x25a4811)
#27 0x00000000025a485f
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/usr/local/clang-trunk/bin/clang-4.0+0x25a485f)
#28 0x00000000025a9bff
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/usr/local/clang-trunk/bin/clang-4.0+0x25a9bff)
#29 0x00000000025aa539
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/usr/local/clang-trunk/bin/clang-4.0+0x25aa539)
#30 0x000000000259fd40 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-4.0+0x259fd40)
#31 0x000000000228d9a7 clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-4.0+0x228d9a7)
#32 0x0000000001fb3536 clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-4.0+0x1fb3536)
#33 0x0000000001f87636
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1f87636)
#34 0x0000000002037967
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-4.0+0x2037967)
#35 0x000000000093c0d8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-4.0+0x93c0d8)
#36 0x00000000008da7b0 main (/usr/local/clang-trunk/bin/clang-4.0+0x8da7b0)
#37 0x00007faedf8da730 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x20730)
#38 0x0000000000938959 _start (/usr/local/clang-trunk/bin/clang-4.0+0x938959)
Stack dump:
0.    Program arguments: /usr/local/clang-trunk/bin/clang-4.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
small.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-resource-dir /usr/local/clang-trunk/bin/../lib/clang/4.0.0 -c-isystem .
-c-isystem /usr/local/include/csmith -internal-isystem /usr/local/include
-internal-isystem /usr/local/clang-trunk/bin/../lib/clang/4.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir
/home/cnsun/workspace/meta-compiler/error-fuzzer/temp-runs/IdentifierSubstituionFuzzingEngine/crash/20160628-clang-trunk--O3-c-Weverything-std=c11-build-031934
-ferror-limit 19 -fmessage-length 272 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/small-3e3c39.o -x c
small.c
1.    small.c:3:1: current parser token '}'
2.    small.c:1:12: parsing function body 'fn1'
3.    small.c:1:12: in compound statement ('{}')
clang-4.0: error: unable to execute command: Aborted
clang-4.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.0 (trunk 276859)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-4.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-4.0: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-4.0: note: diagnostic msg: /tmp/small-0f1572.c
clang-4.0: note: diagnostic msg: /tmp/small-0f1572.sh
clang-4.0: note: diagnostic msg:

********************
$
$ cat small.c
void fn1() {
  (__int128)(sizeof(__int128) * -2) + fn1;
}

-- 
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/20160727/9cbfac38/attachment-0001.html>


More information about the llvm-bugs mailing list