[llvm-bugs] [Bug 36565] New: Assertion `Arg != ArgRange.end() && "Running over edge of argument list!"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 1 18:07:00 PST 2018


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

            Bug ID: 36565
           Summary: Assertion `Arg != ArgRange.end() && "Running over edge
                    of argument list!"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: shlei930 at gmail.com
                CC: llvm-bugs at lists.llvm.org

$ clang-trunk -v
clang version 7.0.0 (trunk 326430)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin

$ clang-trunk abc.c
abc.c:1:26: warning: implicitly declaring library function 'va_start' with type
'void (struct __va_list_tag *, ...)'
      [-Wimplicit-function-declaration]
int MSVCRT_fprintf_s() { va_start(); }
                         ^
abc.c:1:26: note: include the header <stdarg.h> or explicitly provide a
declaration for 'va_start'
abc.c:1:38: warning: control reaches end of non-void function [-Wreturn-type]
int MSVCRT_fprintf_s() { va_start(); }
                                     ^
clang-7.0:
/home/suhua/compilers/trunk/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h:3958:
void
clang::CodeGen::CodeGenFunction::EmitCallArgs(clang::CodeGen::CallArgList&,
const T*, llvm::iterator_range<clang::Stmt::ConstExprIterator>,
clang::CodeGen::CodeGenFunction::AbstractCallee, unsigned int,
clang::CodeGen::CodeGenFunction::EvaluationOrder) [with T =
clang::FunctionProtoType]: Assertion `Arg != ArgRange.end() && "Running over
edge of argument list!"' failed.
#0 0x00000000023261fa llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x23261fa)
#1 0x000000000232426e llvm::sys::RunSignalHandlers()
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x232426e)
#2 0x00000000023243d2 SignalHandler(int)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x23243d2)
#3 0x00007f5f3496a390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007f5f336d5428 gsignal
/build/glibc-Cl5G7W/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007f5f336d702a abort /build/glibc-Cl5G7W/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007f5f336cdbd7 __assert_fail_base
/build/glibc-Cl5G7W/glibc-2.23/assert/assert.c:92:0
#7 0x00007f5f336cdc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x00000000025d39f9 void
clang::CodeGen::CodeGenFunction::EmitCallArgs<clang::FunctionProtoType>(clang::CodeGen::CallArgList&,
clang::FunctionProtoType const*,
llvm::iterator_range<clang::Stmt::ConstExprIterator>,
clang::CodeGen::CodeGenFunction::AbstractCallee, unsigned int,
clang::CodeGen::CodeGenFunction::EvaluationOrder)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x25d39f9)
#9 0x00000000026cdccd
clang::CodeGen::CodeGenFunction::EmitCall(clang::QualType,
clang::CodeGen::CGCallee const&, clang::CallExpr const*,
clang::CodeGen::ReturnValueSlot, llvm::Value*)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x26cdccd)
#10 0x0000000002626d63 emitLibraryCall(clang::CodeGen::CodeGenFunction&,
clang::FunctionDecl const*, clang::CallExpr const*, llvm::Constant*)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2626d63)
#11 0x000000000265eb3f
clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(clang::FunctionDecl const*,
unsigned int, clang::CallExpr const*, clang::CodeGen::ReturnValueSlot)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x265eb3f)
#12 0x00000000026d889f
clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*,
clang::CodeGen::ReturnValueSlot)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x26d889f)
#13 0x00000000009d1514 (anonymous
namespace)::ScalarExprEmitter::VisitCallExpr(clang::CallExpr const*)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x9d1514)
#14 0x00000000026fd798 (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x26fd798)
#15 0x00000000026fdfd3
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x26fdfd3)
#16 0x00000000026bcf47 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr
const*, clang::CodeGen::AggValueSlot, bool)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x26bcf47)
#17 0x00000000026cfcab
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x26cfcab)
#18 0x000000000250a1ef clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*, llvm::ArrayRef<clang::Attr const*>)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x250a1ef)
#19 0x000000000250b313
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x250b313)
#20 0x000000000254407a
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x254407a)
#21 0x00000000025514d1
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x25514d1)
#22 0x0000000002577c83
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2577c83)
#23 0x000000000258c4e1
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x258c4e1)
#24 0x000000000258d610
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x258d610)
#25 0x000000000258db5b
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) [clone
.part.6559] (/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x258db5b)
#26 0x0000000002d1ae23 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2d1ae23)
#27 0x0000000002d14f9d
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2d14f9d)
#28 0x00000000032117e6 clang::ParseAST(clang::Sema&, bool, bool)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x32117e6)
#29 0x0000000002d18f4f clang::CodeGenAction::ExecuteAction()
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2d18f4f)
#30 0x00000000028ad786 clang::FrontendAction::Execute()
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x28ad786)
#31 0x0000000002882d8e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2882d8e)
#32 0x0000000002940bde
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0x2940bde)
#33 0x0000000000c946f8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0xc946f8)
#34 0x0000000000c187e1 main
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0xc187e1)
#35 0x00007f5f336c0830 __libc_start_main
/build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:325:0
#36 0x0000000000c8f3a9 _start
(/home/suhua/compilers/trunk/root-clang/bin/clang-7.0+0xc8f3a9)
Stack dump:
0.      Program arguments: /home/suhua/compilers/trunk/root-clang/bin/clang-7.0
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name abc.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
/home/suhua/compilers/trunk/root-clang/lib/clang/7.0.0 -c-isystem . -c-isystem
/usr/local/include/csmith-2.3.0/ -c-isystem
/home/suhua/media_disk/home/klee/include/klee -internal-isystem
/usr/local/include -internal-isystem
/home/suhua/compilers/trunk/root-clang/lib/clang/7.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/suhua/Documents/VPT/reduce/bug10 -ferror-limit 19
-fmessage-length 122 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/abc-0a4e74.o -x c abc.c
1.      <eof> parser at end of file
2.      abc.c:1:5: LLVM IR generation of declaration 'MSVCRT_fprintf_s'
3.      abc.c:1:5: Generating code for declaration 'MSVCRT_fprintf_s'
clang-7.0: error: unable to execute command: Aborted
clang-7.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0 (trunk 326430)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-7.0: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-7.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-7.0: note: diagnostic msg: /tmp/abc-f0e082.c
clang-7.0: note: diagnostic msg: /tmp/abc-f0e082.sh
clang-7.0: note: diagnostic msg:

********************

$ cat abc.c
int MSVCRT_fprintf_s() { va_start(); }

-- 
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/20180302/39bc6c9f/attachment.html>


More information about the llvm-bugs mailing list