Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

segmentation fault in libiomp5

may_ka
Beginner
110 Views

Hi,

 

In a large application (+100,000 lines of code) with nested OMP parallelization I ran into a segmentation fault, which when the application was run in GDB had this trace:

 

Thread 1 "exe" received signal SIGSEGV, Segmentation fault.
0x0000000006373774 in __kmp_dephash_find(kmp_info*, kmp_dephash**, long) ()
(gdb) up
#1  0x0000000006371238 in __kmp_check_deps(int, kmp_depnode*, kmp_task*, kmp_dephash**, bool, int, kmp_depend_info*, int, kmp_depend_info*) ()
(gdb) up
#2  0x0000000006370e65 in __kmpc_omp_task_with_deps ()
(gdb) up
#3  0x000000000125a0b9 in mkl_lapack_dtrtri.extracted ()
(gdb) up
#4  0x0000000006392003 in __kmp_invoke_microtask ()
(gdb) up
#5  0x0000000006346fe9 in __kmp_invoke_task_func ()
(gdb) up
#6  0x0000000006341137 in __kmp_fork_call ()
(gdb) up
#7  0x0000000006315569 in __kmpc_fork_call ()
(gdb) up
#8  0x0000000001259838 in mkl_lapack_dtrtri ()
(gdb) up
#9  0x00000000013b806a in mkl_lapack_dpotri ()
(gdb) up
#10 0x00000000012405e3 in LAPACKE_dpotri_work ()
(gdb) up
#11 0x000000000070a7b1 in arrary<double>::chol2inv (this=0x7fffffffbbd0, uplo=matmul_uplo::upper, setsym=false, which=matmul_fun::mkl) at /tmp/src/tmp.cpp:190
190               stat=intel_mkl::LAPACKE_dpotri(LAPACK_COL_MAJOR,u,n,this->data(),lda);break;

 

I have not been able to build a small reproducer. The bug has been reported here , and it appears as if it requires a certain amount of previous OMP-related function calls to show up.

 

My current understanding is that this is oneapi-libiomp5 related because

  1. it does not occur in single-threaded applications,
  2. the gdb trace goes back to __kmpc calls,
  3. every libiomp5 after release oneapi 2022.2.1 seem affected (i.e. the last oneapi-libiomp5 release which does not crash is 2022.2.1),
  4. the crash occurs with all compilers (icpx, clang++, g++)
  5. the crash goes away if, invariably of the compiler,
    1. libiomp5 of oneapi release 2022.2.1 is linked, or
    2. libgomp is linked, or
    3. libomp from the llvm project  is compiled from source and linked.

 

Note that when switching from libiomp5 to libomp5 there is no change in compiler flags, and the only change in the link line is from -liomp5 to -lomp5.

 

OS: Linux

Kernel: 6.14.4

gcc: 15.1

clang: 19.1.7

Oneapi: 2025.1

 

Any advise?

0 Kudos
0 Replies
Reply