[llvm-bugs] [Bug 27778] New: Clang crashes parsing CUDA code.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 16 10:57:44 PDT 2016


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

            Bug ID: 27778
           Summary: Clang crashes parsing CUDA code.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: CUDA
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tra at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

> clang++   -I/usr/local/cuda/include -IB40C -IB40C/KernelCommn -I/usr/local/include  -c kForcesUpdate.cu
> clang-3.9: /home/scott/tools/llvm/tools/clang/lib/Sema/SemaDecl.cpp:11525: clang::Decl* clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool): Assertion `MaybeODRUseExprs.empty() && "Leftover expressions for odr-use checking"' failed.
> #0 0x0000000002f69e48 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/scott/tools/llvm/lib/Support/Unix/Signals.inc:322:0
> #1 0x0000000002f6a1c5 PrintStackTraceSignalHandler(void*) /home/scott/tools/llvm/lib/Support/Unix/Signals.inc:380:0
> #2 0x0000000002f68923 llvm::sys::RunSignalHandlers() /home/scott/tools/llvm/lib/Support/Signals.cpp:44:0
> #3 0x0000000002f69947 SignalHandler(int) /home/scott/tools/llvm/lib/Support/Unix/Signals.inc:210:0
> #4 0x00007fe50699c9f0 __restore_rt (/lib64/libpthread.so.0+0x109f0)
> #5 0x00007fe505b4ea98 __GI_raise (/lib64/libc.so.6+0x34a98)
> #6 0x00007fe505b5069a __GI_abort (/lib64/libc.so.6+0x3669a)
> #7 0x00007fe505b47227 __assert_fail_base (/lib64/libc.so.6+0x2d227)
> #8 0x00007fe505b472d2 (/lib64/libc.so.6+0x2d2d2)
> #9 0x00000000046e5f9e clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) /home/scott/tools/llvm/tools/clang/lib/Sema/SemaDecl.cpp:11528:0
> #10 0x00000000046e489f clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*) /home/scott/tools/llvm/tools/clang/lib/Sema/SemaDecl.cpp:11265:0
> #11 0x0000000004387bb9 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) /home/scott/tools/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1945:0
> #12 0x00000000042ee2ba clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) /home/scott/tools/llvm/tools/clang/lib/Parse/Parser.cpp:1160:0
> #13 0x0000000004308d53 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*) /home/scott/tools/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1784:0
> #14 0x00000000042ed4fa clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) /home/scott/tools/llvm/tools/clang/lib/Parse/Parser.cpp:941:0
> #15 0x00000000042ed5b2 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) /home/scott/tools/llvm/tools/clang/lib/Parse/Parser.cpp:956:0
> #16 0x00000000042ecc93 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) /home/scott/tools/llvm/tools/clang/lib/Parse/Parser.cpp:808:0
> #17 0x00000000042ec065 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) /home/scott/tools/llvm/tools/clang/lib/Parse/Parser.cpp:595:0
> #18 0x00000000042e851b clang::ParseAST(clang::Sema&, bool, bool) /home/scott/tools/llvm/tools/clang/lib/Parse/ParseAST.cpp:155:0
> #19 0x00000000036406fb clang::ASTFrontendAction::ExecuteAction() /home/scott/tools/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:557:0
> #20 0x0000000003a21308 clang::CodeGenAction::ExecuteAction() /home/scott/tools/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:844:0
> #21 0x0000000003640191 clang::FrontendAction::Execute() /home/scott/tools/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:461:0
> #22 0x00000000035f3c7d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/scott/tools/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:874:0
> #23 0x000000000373e414 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/scott/tools/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:241:0
> #24 0x000000000170bc78 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/scott/tools/llvm/tools/clang/tools/driver/cc1_main.cpp:116:0
> #25 0x0000000001701f57 ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) /home/scott/tools/llvm/tools/clang/tools/driver/driver.cpp:301:0
> #26 0x00000000017029a3 main /home/scott/tools/llvm/tools/clang/tools/driver/driver.cpp:381:0
> #27 0x00007fe505b3a580 __libc_start_main (/lib64/libc.so.6+0x20580)
> #28 0x00000000016ff8c9 _start (/usr/local/bin/clang-3.9+0x16ff8c9)
> Stack dump:
> 0.    Program arguments: /usr/local/bin/clang-3.9 -cc1 -triple nvptx64-nvidia-cuda -aux-triple x86_64-unknown-linux-gnu -S -disable-free -main-file-name kForcesUpdate.cu -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -no-integrated-as -fcuda-is-device -mlink-cuda-bitcode /usr/local/cuda/nvvm/libdevice/libdevice.compute_20.10.bc -target-feature +ptx42 -target-cpu sm_20 -dwarf-column-info -debugger-tuning=gdb -coverage-file /home/scott/pg/pmemd/src/kForcesUpdate.cu -resource-dir /usr/local/bin/../lib/clang/3.9.0 -I /usr/local/cuda/include -I B40C -I B40C/KernelCommn -I /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-redhat-linux/5.3.1/../../../../include/c++/5.3.1 -internal-isystem /usr/lib/gcc/x86_64-redhat-linux/5.3.1/../../../../include/c++/5.3.1/x86_64-redhat-linux -internal-isystem /usr/lib/gcc/x86_64-redhat-linux/5.3.1/../../../../include/c++/5.3.1/backward -internal-isystem /usr/local/include -internal-isystem /usr/local/bin/../lib/clang/3.9.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /usr/lib/gcc/x86_64-redhat-linux/5.3.1/../../../../include/c++/5.3.1 -internal-isystem /usr/lib/gcc/x86_64-redhat-linux/5.3.1/../../../../include/c++/5.3.1/x86_64-redhat-linux -internal-isystem /usr/lib/gcc/x86_64-redhat-linux/5.3.1/../../../../include/c++/5.3.1/backward -internal-isystem /usr/local/cuda/include -include __clang_cuda_runtime_wrapper.h -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir /home/scott/pg/pmemd/src -ferror-limit 19 -fmessage-length 218 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/kForcesUpdate-764288.s -x cuda kForcesUpdate.cu
> 1.    kForcesUpdate.cu:360:1 <Spelling=/usr/local/cuda/include/host_defines.h:86:9>: current parser token '__attribute__'
> 2.    kForcesUpdate.cu:320:1: parsing function body 'kCalculateMaxGradient_kernel'
> clang-3.9: error: unable to execute command: Aborted (core dumped)
> clang-3.9: error: clang frontend command failed due to signal (use -v to see invocation)
> clang version 3.9.0 (trunk 267727) (llvm/trunk 267726)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
> InstalledDir: /usr/local/bin

-- 
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/20160516/62994e24/attachment.html>


More information about the llvm-bugs mailing list