<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - segfault in __kmpc_for_static_init_4 running c++ example containing omp distribute private"
href="https://bugs.llvm.org/show_bug.cgi?id=31988">31988</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>segfault in __kmpc_for_static_init_4 running c++ example containing omp distribute private
</td>
</tr>
<tr>
<th>Product</th>
<td>OpenMP
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Runtime Library
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>andrey.vul@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The following testcase is derived from a privatization testcase for OpenMP
distribute directive private clause.
Tested on Gentoo using the clang-9999 / llvm-9999 package with a svn pull date
of Feb 15.
SOURCE: cat t.cc
int main() {
constexpr int x_outer = 1;
int x = x_outer;
#pragma omp distribute private(x)
for (int i = 0; i < 1; ++i)
;
}
INVOCATION:
$ clang++ -std=c++11 -fopenmp -g -v t.cc
clang version 5.0.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
"/usr/bin/clang-5.0" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all
-disable-free -main-file-name t.cc -mrelocation-model static -mthread-model
posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -v -dwarf-column-info
-debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -resource-dir
/usr/bin/../lib/clang/5.0.0 -internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6 -internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/5.0.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 192 -fopenmp
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/t-197e1c.o -x c++ t.cc
clang -cc1 version 5.0.0 based upon LLVM 5.0.0svn default target
x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/x86_64-pc-linux-gnu
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/backward
/usr/bin/../lib/clang/5.0.0/include
/usr/include
End of search list.
"/usr/bin/x86_64-pc-linux-gnu-ld" --eh-frame-hdr -m elf_x86_64 -dynamic-linker
/lib64/ld-linux-x86-64.so.2 -o a.out
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../lib64/crt1.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/crtbegin.o
-L/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0
-L/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../lib64 -L/usr/bin/../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/lib
-L/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../.. -L/usr/bin/../lib -L/lib
-L/usr/lib /tmp/t-197e1c.o -lstdc++ -lm -lomp -lgcc_s -lgcc -lpthread -lc
-lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/crtend.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../lib64/crtn.o
$ gdb a.out
GNU gdb (Gentoo 7.12.1 vanilla) 7.12.1
[...]
This GDB was configured as "x86_64-pc-linux-gnu".
[...]
Reading symbols from a.out...done.
(gdb) run
Starting program: /tmp/a.out
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff747ae5e in __kmpc_for_static_init_4 () from /usr/lib64/libomp.so
(gdb) bt
#0 0x00007ffff747ae5e in __kmpc_for_static_init_4 () from /usr/lib64/libomp.so
#1 0x00000000004007ab in main () at t.cc:4
(gdb)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>