[llvm-bugs] [Bug 31988] New: segfault in __kmpc_for_static_init_4 running c++ example containing omp distribute private

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 16 23:14:12 PST 2017


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

            Bug ID: 31988
           Summary: segfault in __kmpc_for_static_init_4 running c++
                    example containing omp distribute private
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Runtime Library
          Assignee: unassignedbugs at nondot.org
          Reporter: andrey.vul at gmail.com
                CC: llvm-bugs at lists.llvm.org

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)

-- 
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/20170217/25bc0ff3/attachment.html>


More information about the llvm-bugs mailing list