Re: [PATCH 8/8] tools, perf: Add asprintf replacement

2014-10-20 Thread Geert Uytterhoeven
On Mon, Oct 20, 2014 at 9:21 PM, Jiri Olsa wrote: > On Mon, Oct 20, 2014 at 09:13:58PM +0200, Geert Uytterhoeven wrote: >> On Mon, Oct 20, 2014 at 8:28 PM, Jiri Olsa wrote: >> >> +int vasprintf(char **str, const char *fmt, va_list ap) >> >> +{ >> >> + char buf[1024]; >> > >> > could you pleas

Re: [PATCH 8/8] tools, perf: Add asprintf replacement

2014-10-20 Thread Jiri Olsa
On Mon, Oct 20, 2014 at 09:13:58PM +0200, Geert Uytterhoeven wrote: > On Mon, Oct 20, 2014 at 8:28 PM, Jiri Olsa wrote: > >> +int vasprintf(char **str, const char *fmt, va_list ap) > >> +{ > >> + char buf[1024]; > > > > could you please make it work for generic buf len? > > The actual size ab

Re: [PATCH 8/8] tools, perf: Add asprintf replacement

2014-10-20 Thread Geert Uytterhoeven
On Mon, Oct 20, 2014 at 8:28 PM, Jiri Olsa wrote: >> +int vasprintf(char **str, const char *fmt, va_list ap) >> +{ >> + char buf[1024]; > > could you please make it work for generic buf len? The actual size above doesn't matter, except for stack usage. It could be 1 (are there any bugs trigge

Re: [PATCH 8/8] tools, perf: Add asprintf replacement

2014-10-20 Thread Jiri Olsa
On Fri, Sep 26, 2014 at 04:37:16PM -0700, Andi Kleen wrote: > From: Andi Kleen > > asprintf corrupts memory on some older glibc versions. > Provide a replacement. This fixes various segfaults > with --branch-history on older Fedoras. > > Signed-off-by: Andi Kleen > --- > tools/perf/Makefile.pe

[PATCH 8/8] tools, perf: Add asprintf replacement

2014-09-26 Thread Andi Kleen
From: Andi Kleen asprintf corrupts memory on some older glibc versions. Provide a replacement. This fixes various segfaults with --branch-history on older Fedoras. Signed-off-by: Andi Kleen --- tools/perf/Makefile.perf| 1 + tools/perf/builtin-report.c | 3 ++- tools/perf/util/asprintf.c

[PATCH 8/8] tools, perf: Add asprintf replacement

2014-09-15 Thread Andi Kleen
From: Andi Kleen asprintf corrupts memory on some older glibc versions. Provide a replacement. This fixes various segfaults with --branch-history on older Fedoras. Signed-off-by: Andi Kleen --- tools/perf/Makefile.perf| 1 + tools/perf/builtin-report.c | 3 ++- tools/perf/util/asprintf.c