All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf tools: fix buffer allocation
@ 2009-09-24 13:05 Eric Dumazet
  2009-09-24 13:12 ` Ingo Molnar
  2009-09-24 13:16 ` [tip:perf/urgent] perf tools: Fix buffer allocation tip-bot for Eric Dumazet
  0 siblings, 2 replies; 10+ messages in thread
From: Eric Dumazet @ 2009-09-24 13:05 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux kernel, linux-perf-users

Hi Ingo

Here is a patch for perf.

BTW, use of openat() is a nuisance, since many machines have old glibc
(RHEL 4 Update 5 -> glibc-2.3.4-2.36 on my dev machine for example)

Thanks


[PATCH] perf tools: fix buffer allocation

"perf top" cores dump on my dev machine, if run from a directory where
vmlinux is present.

*** glibc detected *** malloc(): memory corruption: 0x085670d0 ***

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 tools/perf/util/module.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/module.c b/tools/perf/util/module.c
index 8f81622..0d8c85d 100644
--- a/tools/perf/util/module.c
+++ b/tools/perf/util/module.c
@@ -423,7 +423,7 @@ static int mod_dso__load_module_paths(struct mod_dso *self)
 	len += strlen(uts.release);
 	len += strlen("/modules.dep");
 
-	dpath = calloc(1, len);
+	dpath = calloc(1, len + 1);
 	if (dpath == NULL)
 		return err;
 

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-09-26 15:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-24 13:05 [PATCH] perf tools: fix buffer allocation Eric Dumazet
2009-09-24 13:12 ` Ingo Molnar
2009-09-24 13:13   ` Eric Dumazet
2009-09-24 13:39   ` [PATCH] perf tools: Dont use openat() Eric Dumazet
2009-09-24 19:20     ` Ingo Molnar
2009-09-24 19:25     ` [tip:perf/urgent] " tip-bot for Eric Dumazet
2009-09-24 21:07     ` [PATCH] " Ulrich Drepper
2009-09-24 21:50       ` Eric Dumazet
2009-09-26 15:01         ` Ingo Molnar
2009-09-24 13:16 ` [tip:perf/urgent] perf tools: Fix buffer allocation tip-bot for Eric Dumazet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.