[numactl] Resolves: bz823125, bz823127

Petr Holasek pholasek at fedoraproject.org
Sat May 19 11:19:54 UTC 2012


commit fae4fed9bab50b2d29a0aed9932eda42c728b250
Author: Petr Holasek <holasekp at gmail.com>
Date:   Sat May 19 13:19:36 2012 +0200

    Resolves: bz823125, bz823127

 numactl-2.0.7-numademo-alloc.patch       |   15 +++++++++++++++
 numactl-2.0.7-numademo-msize-check.patch |   18 ++++++++++++++++++
 numactl.spec                             |    9 ++++++++-
 3 files changed, 41 insertions(+), 1 deletions(-)
---
diff --git a/numactl-2.0.7-numademo-alloc.patch b/numactl-2.0.7-numademo-alloc.patch
new file mode 100644
index 0000000..6445054
--- /dev/null
+++ b/numactl-2.0.7-numademo-alloc.patch
@@ -0,0 +1,15 @@
+diff -up numactl-2.0.7/numademo.c.orig numactl-2.0.7/numademo.c
+--- numactl-2.0.7/numademo.c.orig	2012-02-15 11:47:10.617212257 +0100
++++ numactl-2.0.7/numademo.c	2012-02-15 11:47:38.570214219 +0100
+@@ -156,6 +156,11 @@ void memtest(char *name, unsigned char *
+ 	int i;
+ 	char title[128], result[128];
+ 
++	if (!mem) {
++		fprintf(stderr,"Failed to allocate %lu bytes of memory. Test \"%s\" exits.\n", msize, name);
++		return;
++	}
++
+ #ifdef HAVE_STREAM_LIB
+ 	if (thistest == STREAM) {
+ 		do_stream(name, mem);
diff --git a/numactl-2.0.7-numademo-msize-check.patch b/numactl-2.0.7-numademo-msize-check.patch
new file mode 100644
index 0000000..952aed1
--- /dev/null
+++ b/numactl-2.0.7-numademo-msize-check.patch
@@ -0,0 +1,18 @@
+diff -up numactl-2.0.7/numademo.c.orig numactl-2.0.7/numademo.c
+--- numactl-2.0.7/numademo.c.orig	2012-02-15 12:35:33.450409388 +0100
++++ numactl-2.0.7/numademo.c	2012-02-15 12:37:20.094416633 +0100
+@@ -522,7 +522,13 @@ int main(int ac, char **av)
+ #ifdef HAVE_STREAM_LIB
+ 		test(STREAM);
+ #endif
+-		test(PTRCHASE);
++		if (msize >= sizeof(union node)) {
++			test(PTRCHASE);
++		} else {
++			fprintf(stderr, "You must set msize at least %lu bytes for ptrchase test.\n",
++				sizeof(union node));
++			exit(1);
++		}
+ 	} else {
+ 		int k;
+ 		for (k = 2; k < ac; k++) {
diff --git a/numactl.spec b/numactl.spec
index 0516c0c..c4b1142 100644
--- a/numactl.spec
+++ b/numactl.spec
@@ -1,7 +1,7 @@
 Name:		numactl
 Summary:	Library for tuning for Non Uniform Memory Access machines
 Version:	2.0.7
-Release:	5%{dist} 
+Release:	6%{dist} 
 License:	LGPLv2/GPLv2
 Group:		System Environment/Base
 URL:		ftp://oss.sgi.com/www/projects/libnuma/download
@@ -10,6 +10,8 @@ Buildroot:	%{_tmppath}/%{name}-buildroot
 
 Patch1: numactl-2.0.3-rc3-no-nodes-warning.patch
 Patch2: numactl-2.0.7-manpages.patch
+Patch3: numactl-2.0.7-numademo-alloc.patch
+Patch4: numactl-2.0.7-numademo-msize-check.patch
 
 ExcludeArch: s390 s390x %{arm}
 
@@ -49,6 +51,8 @@ do not reference it or depend on it in any way.
 %setup -q -n %{name}-%{version}
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 %build
 make CFLAGS="$RPM_OPT_FLAGS -I."
@@ -95,6 +99,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man3/*.3*
 
 %changelog
+* Sat May 19 2012 Petr Holasek <pholasek at redhat.com> - 2.0.7-6
+- numademo segfault fix (bz823125, bz823127)
+
 * Sun Apr 15 2012 Petr Holasek <pholasek at redhat.com> - 2.0.7-5
 - Library splitted out of numactl package to numactl-libs
 


More information about the scm-commits mailing list