[llvm-bugs] [Bug 31010] New: crash on x86_64-linux-gnu (gcc accepts the program. Assertion `V.isLValue()' failed.)

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 14 02:28:36 PST 2016


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

            Bug ID: 31010
           Summary: crash on x86_64-linux-gnu (gcc accepts the program.
                    Assertion `V.isLValue()' failed.)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            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

gcc accepts the test program, whereas clang crashes with an assertion failure.

$ clang-trunk -v
clang version 4.0.0 (trunk 286765)
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.2
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.2
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ 
$ clang-trunk small.c -w
clang-4.0:
/tmp/llvm-builder/llvm-source-trunk/tools/clang/lib/AST/ExprConstant.cpp:1089:
void {anonymous}::LValue::setFrom(clang::ASTContext&, const clang::APValue&):
Assertion `V.isLValue()' failed.
#0 0x0000000001e47245 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1e47245)
#1 0x0000000001e4534e llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-4.0+0x1e4534e)
#2 0x0000000001e454b0 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-4.0+0x1e454b0)
#3 0x00007ff936b848d0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0xf8d0)
#4 0x00007ff93578c067 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35067)
#5 0x00007ff93578d448 abort (/lib/x86_64-linux-gnu/libc.so.6+0x36448)
#6 0x00007ff935785266 (/lib/x86_64-linux-gnu/libc.so.6+0x2e266)
#7 0x00007ff935785312 (/lib/x86_64-linux-gnu/libc.so.6+0x2e312)
#8 0x000000000342aafc (anonymous
namespace)::LValue::setFrom(clang::ASTContext&, clang::APValue const&)
(/usr/local/clang-trunk/bin/clang-4.0+0x342aafc)
#9 0x000000000346fd59 (anonymous
namespace)::PointerExprEvaluator::VisitCastExpr(clang::CastExpr const*)
(/usr/local/clang-trunk/bin/clang-4.0+0x346fd59)
#10 0x0000000003440a88 clang::StmtVisitorBase<clang::make_const_ptr, (anonymous
namespace)::PointerExprEvaluator, bool>::Visit(clang::Stmt const*)
(/usr/local/clang-trunk/bin/clang-4.0+0x3440a88)
#11 0x00000000034418ae EvaluatePointer(clang::Expr const*, (anonymous
namespace)::LValue&, (anonymous namespace)::EvalInfo&)
(/usr/local/clang-trunk/bin/clang-4.0+0x34418ae)
#12 0x000000000345f1c6 (anonymous
namespace)::IntExprEvaluator::VisitBinaryOperator(clang::BinaryOperator const*)
(/usr/local/clang-trunk/bin/clang-4.0+0x345f1c6)
#13 0x000000000343cb9d clang::StmtVisitorBase<clang::make_const_ptr, (anonymous
namespace)::IntExprEvaluator, bool>::Visit(clang::Stmt const*)
(/usr/local/clang-trunk/bin/clang-4.0+0x343cb9d)
#14 0x00000000034436e0 Evaluate(clang::APValue&, (anonymous
namespace)::EvalInfo&, clang::Expr const*)
(/usr/local/clang-trunk/bin/clang-4.0+0x34436e0)
#15 0x0000000003446b0e EvaluateAsRValue((anonymous namespace)::EvalInfo&,
clang::Expr const*, clang::APValue&)
(/usr/local/clang-trunk/bin/clang-4.0+0x3446b0e)
#16 0x0000000003447ea7 clang::Expr::EvaluateForOverflow(clang::ASTContext
const&) const (/usr/local/clang-trunk/bin/clang-4.0+0x3447ea7)
#17 0x0000000002b91896 clang::Sema::CheckForIntOverflow(clang::Expr*)
(/usr/local/clang-trunk/bin/clang-4.0+0x2b91896)
#18 0x0000000002bba0ae clang::Sema::CheckCompletedExpr(clang::Expr*,
clang::SourceLocation, bool) (/usr/local/clang-trunk/bin/clang-4.0+0x2bba0ae)
#19 0x0000000002d73af5 clang::Sema::ActOnFinishFullExpr(clang::Expr*,
clang::SourceLocation, bool, bool, bool)
(/usr/local/clang-trunk/bin/clang-4.0+0x2d73af5)
#20 0x0000000002d0f261 clang::Sema::ActOnCondition(clang::Scope*,
clang::SourceLocation, clang::Expr*, clang::Sema::ConditionKind)
(/usr/local/clang-trunk/bin/clang-4.0+0x2d0f261)
#21 0x00000000029f8fc2
clang::Parser::ParseParenExprOrCondition(clang::ActionResult<clang::Stmt*,
true>*, clang::Sema::ConditionResult&, clang::SourceLocation,
clang::Sema::ConditionKind) (/usr/local/clang-trunk/bin/clang-4.0+0x29f8fc2)
#22 0x00000000029fd04b clang::Parser::ParseIfStatement(clang::SourceLocation*)
(/usr/local/clang-trunk/bin/clang-4.0+0x29fd04b)
#23 0x00000000029fa7db
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
(/usr/local/clang-trunk/bin/clang-4.0+0x29fa7db)
#24 0x00000000029facce
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*)
(/usr/local/clang-trunk/bin/clang-4.0+0x29facce)
#25 0x00000000029fe697 clang::Parser::ParseCompoundStatementBody(bool)
(/usr/local/clang-trunk/bin/clang-4.0+0x29fe697)
#26 0x0000000002a00b89 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) (/usr/local/clang-trunk/bin/clang-4.0+0x2a00b89)
#27 0x0000000002982c25
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/usr/local/clang-trunk/bin/clang-4.0+0x2982c25)
#28 0x00000000029a1d4c clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/usr/local/clang-trunk/bin/clang-4.0+0x29a1d4c)
#29 0x000000000297d729
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/usr/local/clang-trunk/bin/clang-4.0+0x297d729)
#30 0x000000000297ddd1
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) [clone .part.225]
(/usr/local/clang-trunk/bin/clang-4.0+0x297ddd1)
#31 0x000000000297de0f
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/usr/local/clang-trunk/bin/clang-4.0+0x297de0f)
#32 0x0000000002980218
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/usr/local/clang-trunk/bin/clang-4.0+0x2980218)
#33 0x00000000029836f2
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/usr/local/clang-trunk/bin/clang-4.0+0x29836f2)
#34 0x000000000298392c
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/usr/local/clang-trunk/bin/clang-4.0+0x298392c)
#35 0x000000000297b09b clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-4.0+0x297b09b)
#36 0x00000000025aa25b clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-4.0+0x25aa25b)
#37 0x00000000022c35ee clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-4.0+0x22c35ee)
#38 0x000000000229953e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-4.0+0x229953e)
#39 0x000000000234cfb2
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-4.0+0x234cfb2)
#40 0x0000000000be3c68 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-4.0+0xbe3c68)
#41 0x0000000000b86466 main (/usr/local/clang-trunk/bin/clang-4.0+0xb86466)
#42 0x00007ff935778b45 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b45)
#43 0x0000000000bdfebe _start (/usr/local/clang-trunk/bin/clang-4.0+0xbdfebe)
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 -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 -w -fdebug-compilation-dir
/home/cnsun/workspace/meta-compiler/error-fuzzer/exp-runs/crash/RandomTokenManipulationFuzzingEngine/20161028-clang-trunk--Weverything-O3-c-std=c11-build-050451/reduction
-ferror-limit 19 -fmessage-length 261 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/small-88cf10.o -x c
small.c 
1.      small.c:2:20: current parser token ')'
2.      small.c:1:11: parsing function body 'x'
3.      small.c:1:11: 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 286765)
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-120235.c
clang-4.0: note: diagnostic msg: /tmp/small-120235.sh
clang-4.0: note: diagnostic msg: 

********************
$ 
$ gcc-trunk -w -c small.c
$ 
$ cat small.c
void x () {
  if (&&e - &&b < x)
    x ();
b:
  goto *&&b;
e:
  ;
}
$

-- 
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/20161114/9c012837/attachment.html>


More information about the llvm-bugs mailing list