[llvm-bugs] [Bug 43355] New: Crash for target declare in non-offload mode

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 18 14:23:41 PDT 2019


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

            Bug ID: 43355
           Summary: Crash for target declare in non-offload mode
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jdoerfert at anl.gov
                CC: llvm-bugs at lists.llvm.org

The example below crashes for me locally (see further down) and produces odd
offloading description code here: https://godbolt.org/z/EHccgU

```
#pragma omp declare target
#include <cmath>
#pragma omp end declare target
```

```
lang-10: /data/src/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp:3967:
llvm::Function*
clang::CodeGen::CGOpenMPRuntime::createOffloadingBinaryDescriptorRegistration():
Assertion `!Devices.empty() && "No OpenMP offloading devices??"' failed.
Stack dump:
0.      Program arguments: /data/build/llvm-project-release/bin/clang-10 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name crash2.cpp -mrelocation-model static -mthread-model posix
-mframe-pointer=all -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -resource-dir
/data/build/llvm-project-release/lib/clang/10.0.0 -internal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0
-internal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib64/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/backward
-internal-isystem /usr/local/include -internal-isystem
/data/build/llvm-project-release/lib/clang/10.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir /data/build/llvm-project-release
-ferror-limit 19 -fmessage-length 0 -fopenmp -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-faddrsig -o /tmp/johannes/crash2-8bced6.o -x c++ crash2.cpp 
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
 #0 0x0000561803a2b3ea llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/data/build/llvm-project-release/bin/clang-10+0x2cab3ea)
 #1 0x0000561803a29144 llvm::sys::RunSignalHandlers()
(/data/build/llvm-project-release/bin/clang-10+0x2ca9144)
 #2 0x0000561803a292c5 SignalHandler(int)
(/data/build/llvm-project-release/bin/clang-10+0x2ca92c5)
 #3 0x00007f3c1e28ad00 __restore_rt (/usr/lib/libpthread.so.0+0x13d00)
 #4 0x00007f3c1db0e755 raise (/usr/lib/libc.so.6+0x3a755)
 #5 0x00007f3c1daf9851 abort (/usr/lib/libc.so.6+0x25851)
 #6 0x00007f3c1daf9727 _nl_load_domain.cold (/usr/lib/libc.so.6+0x25727)
 #7 0x00007f3c1db07026 (/usr/lib/libc.so.6+0x33026)
 #8 0x000056180405bf76
clang::CodeGen::CGOpenMPRuntime::createOffloadingBinaryDescriptorRegistration()
(.part.0) (/data/build/llvm-project-release/bin/clang-10+0x32dbf76)
 #9 0x0000561803da109b clang::CodeGen::CodeGenModule::Release()
(/data/build/llvm-project-release/bin/clang-10+0x302109b)
#10 0x000056180487b27a (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
(/data/build/llvm-project-release/bin/clang-10+0x3afb27a)
#11 0x0000561804879e0c
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/data/build/llvm-project-release/bin/clang-10+0x3af9e0c)
#12 0x000056180553e951 clang::ParseAST(clang::Sema&, bool, bool)
(/data/build/llvm-project-release/bin/clang-10+0x47be951)
#13 0x00005618048774c0 clang::CodeGenAction::ExecuteAction()
(/data/build/llvm-project-release/bin/clang-10+0x3af74c0)
#14 0x0000561804218059 clang::FrontendAction::Execute()
(/data/build/llvm-project-release/bin/clang-10+0x3498059)
#15 0x00005618041d627e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/data/build/llvm-project-release/bin/clang-10+0x345627e)
#16 0x00005618042e9004
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/data/build/llvm-project-release/bin/clang-10+0x3569004)
#17 0x0000561801af0b04 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/data/build/llvm-project-release/bin/clang-10+0xd70b04)
#18 0x0000561801a74db1 main
(/data/build/llvm-project-release/bin/clang-10+0xcf4db1)
#19 0x00007f3c1dafaee3 __libc_start_main (/usr/lib/libc.so.6+0x26ee3)
#20 0x0000561801aecdae _start
(/data/build/llvm-project-release/bin/clang-10+0xd6cdae)
clang-10: error: unable to execute command: Aborted (core dumped)
clang-10: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 10.0.0 (git at github.com:llvm/llvm-project.git
505127ddbfec7b77759dbb1c6255a9b44bda64bb)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /data/build/llvm-project-release/./bin
clang-10: 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-10: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-10: note: diagnostic msg: /tmp/johannes/crash2-38ec8f.cpp
clang-10: note: diagnostic msg: /tmp/johannes/crash2-38ec8f.sh
clang-10: note: diagnostic msg: 
```

-- 
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/20190918/33eb5a84/attachment.html>


More information about the llvm-bugs mailing list