linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>,
	Ben Cheng <bccheng@google.com>, David Ahern <dsahern@gmail.com>,
	Dongsheng Yang <yangds.fnst@cn.fujitsu.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@redhat.com>, Mike Galbraith <efault@gmx.de>,
	Namhyung Kim <namhyung.kim@lge.com>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Stephane Eranian <eranian@google.com>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [GIT PULL 00/21] perf/core improvements and fixes
Date: Tue, 10 Dec 2013 14:22:58 +0200	[thread overview]
Message-ID: <52A707A2.5020802@intel.com> (raw)
In-Reply-To: <20131210121042.GK8098@ghostprotocols.net>

On 10/12/13 14:10, Arnaldo Carvalho de Melo wrote:
> Em Tue, Dec 10, 2013 at 02:13:12PM +0200, Adrian Hunter escreveu:
>> On 10/12/13 13:44, Arnaldo Carvalho de Melo wrote:
>>> Em Tue, Dec 10, 2013 at 12:12:29PM +0100, Ingo Molnar escreveu:
>>>>
>>>> Hm, I've unpulled it because 'perf top' crashes on exit, in 
>>>> dso__delete():
>>>
>>> 495		if (dso->sname_alloc)
>>> 496			free((char *)dso->short_name)
>>>
>>> Yeah, must be that basename() patch from Stephane, I'll work on a fix
>>> and resubmit this batch, thanks for the report.
>>
>> The problem is sname_alloc is not maintained.  Perhaps it should be
>> set in dso__set_short_name() e.g.
> 
> Yeah, sounds better than having all callers manage that thing, quickie,
> was this with Stephane's patch applied?

Yes it was at
	e993d10caeb6dca690dbaf86e1981ba240d1414a
	perf symbols: fix bug in usage of the basename() function

> 
> I think it should be done as a prep, then apply a modified version of
> Stephanes, that doesn't deal with the alloc flag (more than using 'true'
> to say it is a malloc'ed chunk).
> 
> - Arnaldo
>  
>> diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
>> index 9fae484..54ed980 100644
>> --- a/tools/perf/util/dso.c
>> +++ b/tools/perf/util/dso.c
>> @@ -379,7 +379,7 @@ struct dso *dso__kernel_findnew(struct machine *machine,
>> const char *name,
>>  	 * processing we had no idea this was the kernel dso.
>>  	 */
>>  	if (dso != NULL) {
>> -		dso__set_short_name(dso, short_name);
>> +		dso__set_short_name(dso, short_name, false);
>>  		dso->kernel = dso_type;
>>  	}
>>
>> @@ -394,10 +394,13 @@ void dso__set_long_name(struct dso *dso, char *name)
>>  	dso->long_name_len = strlen(name);
>>  }
>>
>> -void dso__set_short_name(struct dso *dso, const char *name)
>> +void dso__set_short_name(struct dso *dso, const char *name, bool sname_alloc)
>>  {
>>  	if (name == NULL)
>>  		return;
>> +	if (dso->sname_alloc)
>> +		free((char *)dso->short_name);
>> +	dso->sname_alloc = sname_alloc;
>>  	dso->short_name = name;
>>  	dso->short_name_len = strlen(name);
>>  }
>> @@ -426,12 +429,7 @@ static void dso__set_basename(struct dso *dso)
>>  	if (!base)
>>  		return;
>>
>> -	if (dso->sname_alloc)
>> -		free((char *)dso->short_name);
>> -	else
>> -		dso->sname_alloc = 1;
>> -
>> -	dso__set_short_name(dso, base);
>> +	dso__set_short_name(dso, base, true);
>>  }
>>
>>  int dso__name_len(const struct dso *dso)
>> @@ -467,7 +465,7 @@ struct dso *dso__new(const char *name)
>>  		int i;
>>  		strcpy(dso->name, name);
>>  		dso__set_long_name(dso, dso->name);
>> -		dso__set_short_name(dso, dso->name);
>> +		dso__set_short_name(dso, dso->name, false);
>>  		for (i = 0; i < MAP__NR_TYPES; ++i)
>>  			dso->symbols[i] = dso->symbol_names[i] = RB_ROOT;
>>  		dso->cache = RB_ROOT;
>> diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
>> index 384f2d9..166463e 100644
>> --- a/tools/perf/util/dso.h
>> +++ b/tools/perf/util/dso.h
>> @@ -110,7 +110,7 @@ static inline void dso__set_loaded(struct dso *dso, enum
>> map_type type)
>>  struct dso *dso__new(const char *name);
>>  void dso__delete(struct dso *dso);
>>
>> -void dso__set_short_name(struct dso *dso, const char *name);
>> +void dso__set_short_name(struct dso *dso, const char *name, bool sname_alloc);
>>  void dso__set_long_name(struct dso *dso, char *name);
>>
>>  int dso__name_len(const struct dso *dso);
>>
>>
>>>
>>> - Arnaldo
>>>  
>>>> [Thread 0x7ffff70df700 (LWP 29561) exited]
>>>> *** Error in `/fast/mingo/tip/tools/perf/perf': munmap_chunk(): invalid pointer: 0x0000000000587371 ***
>>>> ======= Backtrace: =========
>>>> /lib64/libc.so.6[0x3e5907bbe7]
>>>> /fast/mingo/tip/tools/perf/perf(dso__delete+0xd9)[0x46da89]
>>>> /fast/mingo/tip/tools/perf/perf(machines__exit+0xad)[0x482e7d]
>>>> /fast/mingo/tip/tools/perf/perf(perf_session__delete+0xb6)[0x488c66]
>>>> /fast/mingo/tip/tools/perf/perf(cmd_top+0xf44)[0x4345f4]
>>>> /fast/mingo/tip/tools/perf/perf[0x419f95]
>>>> /fast/mingo/tip/tools/perf/perf(main+0x600)[0x419830]
>>>> /lib64/libc.so.6(__libc_start_main+0xf5)[0x3e59021b45]
>>>> /fast/mingo/tip/tools/perf/perf[0x4198fd]
>>>> ======= Memory map: ========
>>>>
>>>> Program received signal SIGABRT, Aborted.
>>>> 0x0000003e590359e9 in raise () from /lib64/libc.so.6
>>>> Missing separate debuginfos, use: debuginfo-install audit-libs-2.3.2-1.fc19.x86_64 bzip2-libs-1.0.6-8.fc19.x86_64 elfutils-libelf-0.156-5.fc19.x86_64 elfutils-libs-0.156-5.fc19.x86_64 glibc-2.17-19.fc19.x86_64 libgcc-4.8.2-1.fc19.x86_64 libunwind-1.1-2.fc19.x86_64 nss-softokn-freebl-3.15.2-2.fc19.x86_64 numactl-libs-2.0.8-4.fc19.x86_64 perl-libs-5.16.3-266.fc19.x86_64 python-libs-2.7.5-9.fc19.x86_64 slang-2.2.4-8.fc19.x86_64 xz-libs-5.1.2-4alpha.fc19.x86_64 zlib-1.2.7-10.fc19.x86_64
>>>> (gdb) 
>>>> (gdb) bt
>>>> #0  0x0000003e590359e9 in raise () from /lib64/libc.so.6
>>>> #1  0x0000003e590370f8 in abort () from /lib64/libc.so.6
>>>> #2  0x0000003e59075d17 in __libc_message () from /lib64/libc.so.6
>>>> #3  0x0000003e5907bbe7 in malloc_printerr () from /lib64/libc.so.6
>>>> #4  0x000000000046da89 in dso__delete (dso=0x8e46f0) at util/dso.c:496
>>>> #5  0x0000000000482e7d in dsos__delete (dsos=0x8e4490) at util/machine.c:72
>>>> #6  machine__exit (machine=<optimized out>) at util/machine.c:103
>>>> #7  machines__exit (machines=machines@entry=0x8e4438) at util/machine.c:123
>>>> #8  0x0000000000488c66 in perf_session__delete (session=0x8e4360) at util/session.c:155
>>>> #9  0x00000000004345f4 in __cmd_top (top=0x7fffffffb140) at builtin-top.c:985
>>>> #10 cmd_top (argc=<optimized out>, argv=<optimized out>, prefix=<optimized out>) at builtin-top.c:1210
>>>> #11 0x0000000000419f95 in run_builtin (p=p@entry=0x7ece88 <commands+264>, argc=argc@entry=2, argv=argv@entry=0x7fffffffe420) at perf.c:319
>>>> #12 0x0000000000419830 in handle_internal_command (argv=0x7fffffffe420, argc=2) at perf.c:376
>>>> #13 run_argv (argv=0x7fffffffe220, argcp=0x7fffffffe22c) at perf.c:420
>>>> #14 main (argc=2, argv=0x7fffffffe420) at perf.c:529
>>>> (gdb) 
>>>>
>>>> Running it on an up-to-date installation of Fedora 19.
>>>>
>>>> Thanks,
>>>>
>>>> 	Ingo
>>>
>>>
> 
> 


  reply	other threads:[~2013-12-10 12:15 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-09 19:36 [GIT PULL 00/21] perf/core improvements and fixes Arnaldo Carvalho de Melo
2013-12-09 19:36 ` [PATCH 01/21] perf trace: Add support for syscalls vs raw_syscalls Arnaldo Carvalho de Melo
2013-12-09 19:36 ` [PATCH 02/21] perf trace: Fix summary percentage when processing files Arnaldo Carvalho de Melo
2013-12-09 19:36 ` [PATCH 03/21] tools lib traceevent: Report better error message on bad function args Arnaldo Carvalho de Melo
2013-12-09 19:36 ` [PATCH 04/21] perf script: Fix symoff printing in callchains Arnaldo Carvalho de Melo
2013-12-09 19:36 ` [PATCH 05/21] perf script: Add an option to print the source line number Arnaldo Carvalho de Melo
2013-12-09 19:36 ` [PATCH 06/21] perf record: Fix display of incorrect mmap pages Arnaldo Carvalho de Melo
2013-12-09 19:36 ` [PATCH 07/21] perf evlist: Remove unnecessary parentheses Arnaldo Carvalho de Melo
2013-12-09 19:36 ` [PATCH 08/21] perf evlist: Fix max mmap_pages Arnaldo Carvalho de Melo
2013-12-09 19:36 ` [PATCH 09/21] perf evlist: Fix mmap pages rounding to power of 2 Arnaldo Carvalho de Melo
2013-12-09 19:36 ` [PATCH 10/21] perf kvm: Introduce option -v for perf kvm command Arnaldo Carvalho de Melo
2013-12-09 19:37 ` [PATCH 11/21] perf kvm: Fix bug in 'stat report' Arnaldo Carvalho de Melo
2013-12-09 19:37 ` [PATCH 12/21] perf archive: Remove duplicated 'runs' in man page Arnaldo Carvalho de Melo
2013-12-09 19:37 ` [PATCH 13/21] perf annotate: Fix typo Arnaldo Carvalho de Melo
2013-12-09 19:37 ` [PATCH 14/21] perf kvm: Move code to generate filename for perf-kvm to function Arnaldo Carvalho de Melo
2013-12-09 19:37 ` [PATCH 15/21] perf kvm: Make perf kvm diff support --guestmount Arnaldo Carvalho de Melo
2013-12-09 19:37 ` [PATCH 16/21] tools lib traceevent: Get rid of malloc_or_die() in pevent_filter_alloc() Arnaldo Carvalho de Melo
2013-12-09 19:37 ` [PATCH 17/21] tools lib traceevent: Get rid of malloc_or_die() in add_event() Arnaldo Carvalho de Melo
2013-12-09 19:37 ` [PATCH 18/21] tools lib traceevent: Get rid of die() in create_arg_item() Arnaldo Carvalho de Melo
2013-12-09 19:37 ` [PATCH 19/21] tools lib traceevent: Get rid of malloc_or_die() in pevent_filter_add_filter_str() Arnaldo Carvalho de Melo
2013-12-09 19:37 ` [PATCH 20/21] tools lib traceevent: Get rid of die() in pevent_filter_clear_trivial() Arnaldo Carvalho de Melo
2013-12-09 19:37 ` [PATCH 21/21] perf symbols: fix bug in usage of the basename() function Arnaldo Carvalho de Melo
2013-12-10 11:07 ` [GIT PULL 00/21] perf/core improvements and fixes Ingo Molnar
2013-12-10 15:47   ` Jiri Olsa
2013-12-10 15:49     ` Ingo Molnar
2013-12-10 11:12 ` Ingo Molnar
2013-12-10 11:44   ` Arnaldo Carvalho de Melo
2013-12-10 11:47     ` Ingo Molnar
2013-12-10 12:01       ` Arnaldo Carvalho de Melo
2013-12-10 12:07         ` Ingo Molnar
2013-12-10 12:13     ` Adrian Hunter
2013-12-10 12:10       ` Arnaldo Carvalho de Melo
2013-12-10 12:22         ` Adrian Hunter [this message]
2013-12-10 12:22           ` Arnaldo Carvalho de Melo
2013-12-10 12:23             ` Arnaldo Carvalho de Melo
2013-12-10 12:24             ` Ingo Molnar
2013-12-11 11:07           ` [tip:perf/core] perf symbols: Remove open coded management of short_name_allocated member tip-bot for Adrian Hunter
2013-12-10 12:18       ` [GIT PULL 00/21] perf/core improvements and fixes Ingo Molnar
2013-12-10 12:46         ` Ingo Molnar
2013-12-10 13:29           ` Arnaldo Carvalho de Melo
2013-12-10 13:49         ` Arnaldo Carvalho de Melo
2013-12-10 15:05           ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2018-08-20 16:15 Arnaldo Carvalho de Melo
2018-08-23  8:31 ` Ingo Molnar
2018-08-01 21:36 Arnaldo Carvalho de Melo
2018-08-02  8:03 ` Ingo Molnar
2018-02-06 16:53 Arnaldo Carvalho de Melo
2015-05-04 21:36 Arnaldo Carvalho de Melo
2015-02-11 21:08 Arnaldo Carvalho de Melo
2015-03-05  4:30 ` Victor Kamensky
2015-03-05  6:37   ` Ingo Molnar
2015-03-05  6:49     ` Victor Kamensky
2013-08-28 14:59 Arnaldo Carvalho de Melo
2013-08-29 10:04 ` Ingo Molnar
2013-08-14 18:24 Arnaldo Carvalho de Melo
2013-08-15  7:52 ` Ingo Molnar
2013-01-30 14:46 Arnaldo Carvalho de Melo
2013-01-31  9:27 ` Ingo Molnar
2012-11-09 21:42 Arnaldo Carvalho de Melo
2012-11-12  2:10 ` Namhyung Kim
2012-11-12 13:55   ` Jiri Olsa
2012-11-12 16:01     ` Arnaldo Carvalho de Melo
2012-11-13  1:20       ` Namhyung Kim
2012-11-13 18:11 ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52A707A2.5020802@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@ghostprotocols.net \
    --cc=ak@linux.intel.com \
    --cc=bccheng@google.com \
    --cc=dsahern@gmail.com \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=yangds.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).