* [PATCH] libnuma: checking of sucessfull allocations in numademo [not found] <193444186.2767974.1313665001288.JavaMail.root@zmail04.collab.prod.int.phx2.redhat.com> @ 2011-08-18 11:01 ` Petr Holasek 2011-08-18 12:01 ` Cliff Wickman 0 siblings, 1 reply; 2+ messages in thread From: Petr Holasek @ 2011-08-18 11:01 UTC (permalink / raw) To: linux-numa; +Cc: cpw From: Petr Holasek <pholasek@redhat.com> This patch is based on BZ https://bugzilla.redhat.com/show_bug.cgi?id=707138 where too big argument for numademo caused segfault. Only simple check of returned pointer from numa_alloc* calls was added. Signed-off-by: Petr Holasek <pholasek@redhat.com> -- diff -up numactl-2.0.7/numademo.c.origin numactl-2.0.7/numademo.c --- numactl-2.0.7/numademo.c.origin 2011-08-18 06:40:56.617884667 -0400 +++ numactl-2.0.7/numademo.c 2011-08-18 06:38:15.783759565 -0400 @@ -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); ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] libnuma: checking of sucessfull allocations in numademo 2011-08-18 11:01 ` [PATCH] libnuma: checking of sucessfull allocations in numademo Petr Holasek @ 2011-08-18 12:01 ` Cliff Wickman 0 siblings, 0 replies; 2+ messages in thread From: Cliff Wickman @ 2011-08-18 12:01 UTC (permalink / raw) To: Petr Holasek; +Cc: linux-numa On Thu, Aug 18, 2011 at 07:01:33AM -0400, Petr Holasek wrote: > From: Petr Holasek <pholasek@redhat.com> > > This patch is based on BZ > https://bugzilla.redhat.com/show_bug.cgi?id=707138 > where too big argument for numademo caused segfault. > > Only simple check of returned pointer from numa_alloc* > calls was added. > > Signed-off-by: Petr Holasek <pholasek@redhat.com> > > -- > diff -up numactl-2.0.7/numademo.c.origin numactl-2.0.7/numademo.c > --- numactl-2.0.7/numademo.c.origin 2011-08-18 06:40:56.617884667 -0400 > +++ numactl-2.0.7/numademo.c 2011-08-18 06:38:15.783759565 -0400 > @@ -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); Thanks, Petr. Yours is now the first patch in 2.0.8-rc1. -Cliff -- Cliff Wickman SGI cpw@sgi.com (651) 683-3824 ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-18 12:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <193444186.2767974.1313665001288.JavaMail.root@zmail04.collab.prod.int.phx2.redhat.com>
2011-08-18 11:01 ` [PATCH] libnuma: checking of sucessfull allocations in numademo Petr Holasek
2011-08-18 12:01 ` Cliff Wickman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).