From a5bfa867a0624625cc1224ca3c37855c00f9e146 Mon Sep 17 00:00:00 2001 From: Susi Lehtola Date: Jul 22 2018 15:05:31 +0000 Subject: Fix crash with multiple instances. --- diff --git a/1695.patch b/1695.patch new file mode 100644 index 0000000..cf1573f --- /dev/null +++ b/1695.patch @@ -0,0 +1,24 @@ +From 43ac839c168c652e52320267b0504e6933cb9f60 Mon Sep 17 00:00:00 2001 +From: Martin Kroeker +Date: Sun, 22 Jul 2018 09:19:19 +0200 +Subject: [PATCH] Unset memory table entry, not just the temporary pointer to + it on shutdown + +to fix crash with multiple instances of OpenBLAS, #1692 +--- + driver/others/memory.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/driver/others/memory.c b/driver/others/memory.c +index 98bcfb216..3bf6ba019 100644 +--- a/driver/others/memory.c ++++ b/driver/others/memory.c +@@ -1279,7 +1279,7 @@ void blas_shutdown(void){ + struct alloc_t *alloc_info = local_memory_table[thread][pos]; + if (alloc_info) { + alloc_info->release_func(alloc_info); +- alloc_info = (void *)0; ++ local_memory_table[thread][pos] = (void *)0; + } + } + } diff --git a/openblas.spec b/openblas.spec index 0d3c174..31dd6af 100644 --- a/openblas.spec +++ b/openblas.spec @@ -29,6 +29,8 @@ Patch1: openblas-0.2.5-libname.patch Patch2: openblas-0.2.15-constructor.patch # Supply the proper flags to the test makefile Patch3: openblas-0.2.19-tests.patch +# Fix crash with multiple instances +Patch4: https://github.com/xianyi/OpenBLAS/pull/1695.patch BuildRequires: gcc BuildRequires: gcc-gfortran @@ -250,6 +252,7 @@ cd OpenBLAS-%{version} %patch2 -p1 -b .constructor %endif %patch3 -p1 -b .tests +%patch4 -p1 -b .multiinst # Fix source permissions find -name \*.f -exec chmod 644 {} \; @@ -685,6 +688,9 @@ rm -rf %{buildroot}%{_libdir}/pkgconfig %endif %changelog +* Sun Jul 22 2018 Susi Lehtola - 0.3.1-3 +- Fix crash with multiple instances (BZ #1605231). + * Fri Jul 13 2018 Fedora Release Engineering - 0.3.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild