diff --git a/SOURCES/numactl-2.0.12-Fix-crashes-when-using-the-touch-option.patch b/SOURCES/numactl-2.0.12-Fix-crashes-when-using-the-touch-option.patch new file mode 100644 index 0000000..5545619 --- /dev/null +++ b/SOURCES/numactl-2.0.12-Fix-crashes-when-using-the-touch-option.patch @@ -0,0 +1,46 @@ +From a47463a72864a76b0557468daf83741632ea4d72 Mon Sep 17 00:00:00 2001 +From: Patrick Mansfield +Date: Mon, 30 Sep 2019 15:59:53 -0700 +Subject: [PATCH] Fix crashes when using the "--touch" option. + +Fix memory to be mapped read/write, so that the "touch" option can write to it. + +Signed-off-by: Patrick Mansfield +--- + shm.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/shm.c b/shm.c +index 260eeff..fb592ed 100644 +--- a/shm.c ++++ b/shm.c +@@ -119,7 +119,7 @@ void attach_sysvshm(char *name, char *opt) + shmlen = s.shm_segsz; + } + +- shmptr = shmat(shmfd, NULL, SHM_RDONLY); ++ shmptr = shmat(shmfd, NULL, 0); + if (shmptr == (void*)-1) + err("shmat"); + shmptr += shmoffset; +@@ -134,7 +134,7 @@ void attach_shared(char *name, char *opt) + { + struct stat64 st; + +- shmfd = open(name, O_RDONLY); ++ shmfd = open(name, O_RDWR); + if (shmfd < 0) { + errno = 0; + if (shmlen == 0) +@@ -160,7 +160,7 @@ void attach_shared(char *name, char *opt) + + /* RED-PEN For shmlen > address space may need to map in pieces. + Left for some poor 32bit soul. */ +- shmptr = mmap64(NULL, shmlen, PROT_READ, MAP_SHARED, shmfd, shmoffset); ++ shmptr = mmap64(NULL, shmlen, PROT_READ | PROT_WRITE, MAP_SHARED, shmfd, shmoffset); + if (shmptr == (char*)-1) + err("shm mmap"); + +-- +2.7.5 + diff --git a/SPECS/numactl.spec b/SPECS/numactl.spec index fa2e8e4..80305ec 100644 --- a/SPECS/numactl.spec +++ b/SPECS/numactl.spec @@ -1,7 +1,7 @@ Name: numactl Summary: Library for tuning for Non Uniform Memory Access machines Version: 2.0.12 -Release: 4%{?dist} +Release: 5%{?dist} # libnuma is LGPLv2 and GPLv2 # numactl binaries are GPLv2 only License: GPLv2 @@ -16,6 +16,7 @@ ExcludeArch: s390 s390x %{arm} Patch1: numactl-2.0.12-numastat-when-reading-no-exist-pid-return-EXIT_FAILU.patch Patch2: numactl-2.0.12-libnuma-introduce-an-API-to-outdate-cpu-to-node-mapp.patch Patch3: numactl-2.0.12-Update-manpage-description-of-numa_node_to_cpu_updat.patch +Patch4: numactl-2.0.12-Fix-crashes-when-using-the-touch-option.patch %description Simple NUMA policy support. It consists of a numactl program to run @@ -45,6 +46,7 @@ Provides development headers for numa library calls %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build %configure --prefix=/usr --libdir=%{_libdir} @@ -88,6 +90,9 @@ make DESTDIR=$RPM_BUILD_ROOT install %{_mandir}/man3/*.3* %changelog +* Fri Oct 18 2019 Pingfan Liu - 2.0.12-5 +- Fix crashes when using the "--touch" option + * Wed Sep 18 2019 Pingfan Liu - 2.0.12-4 - libnuma: introduce an API to outdate cpu to node mapping