public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: fix buffer overflow error caused by specifying all tracepoints with -e option
@ 2011-01-06 10:08 Han Pingtian
  2011-01-06 10:08 ` Han Pingtian
  0 siblings, 1 reply; 5+ messages in thread
From: Han Pingtian @ 2011-01-06 10:08 UTC (permalink / raw)
  To: linux-kernel


Hi,


I found specifying all tracepoints within one "-e" option to perf top,
separating each other with commas, will trigger a buffer overflow.

The command line is:

./perf to  -e `perf list |grep Tracepoint|awk -F'[' '{gsub(/[[:space:]]+/,"",$1);array[FNR]=$1}END{outputs=array[1];for (i=2;i<=FNR;i++){ outputs=outputs "," array[i];};print outputs}'`

The error messages are:

*** buffer overflow detected ***: ./perf terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x382cefb2c7]
/lib64/libc.so.6[0x382cef91c0]
/lib64/libc.so.6[0x382cef82f4]
./perf[0x424f9e]
./perf[0x425966]
./perf[0x42422b]
./perf[0x424468]
./perf[0x424a30]
./perf[0x41539a]
./perf[0x4056d4]
./perf[0x406126]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x382ce1ec5d]
./perf[0x405409]
======= Memory map: ========
00400000-0051c000 r-xp 00000000 fd:06 4573758                            /home/hpt/temp/linux/perf/linux-2.6/tools/perf/perf
0071b000-00733000 rwxp 0011b000 fd:06 4573758                            /home/hpt/temp/linux/perf/linux-2.6/tools/perf/perf
00733000-00b90000 rwxp 00000000 00:00 0
024dc000-024fd000 rwxp 00000000 00:00 0                                  [heap]
... ...

And I have a patch for fixing this problem. Please review it. Thanks.

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

end of thread, other threads:[~2011-01-07 15:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20110106093922.GB6713@hpt.nay.redhat.com>
2011-01-06 18:30 ` [PATCH] perf: fix buffer overflow error caused by specifying all tracepoints with -e option Arnaldo Carvalho de Melo
2011-01-07  3:16   ` Pingtian Han
2011-01-07 15:30 ` [tip:perf/core] perf tools: Fix buffer overflow error when specifying all tracepoints tip-bot for Han Pingtian
2011-01-06 10:08 [PATCH] perf: fix buffer overflow error caused by specifying all tracepoints with -e option Han Pingtian
2011-01-06 10:08 ` Han Pingtian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox