<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic segmentation fault in libiomp5 in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segmentation-fault-in-libiomp5/m-p/1687270#M37112</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;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&amp;lt;double&amp;gt;::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-&amp;gt;data(),lda);break;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have not been able to build a small reproducer. The bug has been reported &lt;A href="https://community.intel.com/t5/Intel-Fortran-Compiler/Segmentation-Fault-in-OpenMP-DAG-Scheduling-using-ifort-ifx/m-p/1479531" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&amp;nbsp;, and it appears as if it requires a certain amount of previous OMP-related function calls to show up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current understanding is that this is oneapi-libiomp5 related because&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;it does not occur in single-threaded applications,&lt;/LI&gt;&lt;LI&gt;the gdb trace goes back to __kmpc calls,&lt;/LI&gt;&lt;LI&gt;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),&lt;/LI&gt;&lt;LI&gt;the crash occurs with all compilers (icpx, clang++, g++)&lt;/LI&gt;&lt;LI&gt;the crash goes away if, invariably of the compiler,&lt;OL&gt;&lt;LI&gt;libiomp5 of oneapi release 2022.2.1 is linked, or&lt;/LI&gt;&lt;LI&gt;libgomp is linked, or&lt;/LI&gt;&lt;LI&gt;libomp from the&amp;nbsp;&lt;A href="https://github.com/llvm/llvm-project/tree/main/openmp" target="_self"&gt;llvm project&lt;/A&gt;&amp;nbsp; is compiled from source and linked.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OS: Linux&lt;/P&gt;&lt;P&gt;Kernel: 6.14.4&lt;/P&gt;&lt;P&gt;gcc: 15.1&lt;/P&gt;&lt;P&gt;clang: 19.1.7&lt;/P&gt;&lt;P&gt;Oneapi: 2025.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advise?&lt;/P&gt;</description>
    <pubDate>Sun, 04 May 2025 02:32:50 GMT</pubDate>
    <dc:creator>may_ka</dc:creator>
    <dc:date>2025-05-04T02:32:50Z</dc:date>
    <item>
      <title>segmentation fault in libiomp5</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segmentation-fault-in-libiomp5/m-p/1687270#M37112</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;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&amp;lt;double&amp;gt;::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-&amp;gt;data(),lda);break;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have not been able to build a small reproducer. The bug has been reported &lt;A href="https://community.intel.com/t5/Intel-Fortran-Compiler/Segmentation-Fault-in-OpenMP-DAG-Scheduling-using-ifort-ifx/m-p/1479531" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&amp;nbsp;, and it appears as if it requires a certain amount of previous OMP-related function calls to show up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current understanding is that this is oneapi-libiomp5 related because&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;it does not occur in single-threaded applications,&lt;/LI&gt;&lt;LI&gt;the gdb trace goes back to __kmpc calls,&lt;/LI&gt;&lt;LI&gt;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),&lt;/LI&gt;&lt;LI&gt;the crash occurs with all compilers (icpx, clang++, g++)&lt;/LI&gt;&lt;LI&gt;the crash goes away if, invariably of the compiler,&lt;OL&gt;&lt;LI&gt;libiomp5 of oneapi release 2022.2.1 is linked, or&lt;/LI&gt;&lt;LI&gt;libgomp is linked, or&lt;/LI&gt;&lt;LI&gt;libomp from the&amp;nbsp;&lt;A href="https://github.com/llvm/llvm-project/tree/main/openmp" target="_self"&gt;llvm project&lt;/A&gt;&amp;nbsp; is compiled from source and linked.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OS: Linux&lt;/P&gt;&lt;P&gt;Kernel: 6.14.4&lt;/P&gt;&lt;P&gt;gcc: 15.1&lt;/P&gt;&lt;P&gt;clang: 19.1.7&lt;/P&gt;&lt;P&gt;Oneapi: 2025.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advise?&lt;/P&gt;</description>
      <pubDate>Sun, 04 May 2025 02:32:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segmentation-fault-in-libiomp5/m-p/1687270#M37112</guid>
      <dc:creator>may_ka</dc:creator>
      <dc:date>2025-05-04T02:32:50Z</dc:date>
    </item>
  </channel>
</rss>

