From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754058AbbJZNCB (ORCPT ); Mon, 26 Oct 2015 09:02:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45849 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753769AbbJZNB6 (ORCPT ); Mon, 26 Oct 2015 09:01:58 -0400 Date: Mon, 26 Oct 2015 14:01:54 +0100 From: Jiri Olsa To: Adrian Hunter Cc: acme@kernel.org, Peter Zijlstra , Ingo Molnar , Namhyung Kim , Kan Liang , Andi Kleen , linux-kernel@vger.kernel.org Subject: [BUG] reporting stuck on s390 in dso__split_kallsyms_for_kcore Message-ID: <20151026130154.GA4400@krava.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi, I'm getting stuck buildid-list command on s390 seems like the kcore code gets stuck with inseting into rbtree while iterating it.. I was able to fix it with patch below, bu I'm not sure it's the correct fix because the kcore maps magic is beyond me so far ;-) please check attached backtrace and patch (gdb) r buildid-list -i perf.data --with-hits Starting program: /root/linux/tools/perf/./perf buildid-list -i perf.data --with-hits [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Detaching after fork from child process 56723. ^C Program received signal SIGINT, Interrupt. rb_next (node=0x81573930, node@entry=0x81551840) at ../lib/rbtree.c:451 451 node=node->rb_left; Missing separate debuginfos, use: debuginfo-install audit-libs-2.4.1-5.el7.s390x bzip2-libs-1.0.6-13.el7.s390x elfutils-libelf-0.163-3.el7.s390x elfutils-libs-0.163-3.el7.s390x glibc-2.17-105.el7.s390x nss-softokn-freebl-3.16.2.3-13.el7_1.s390x perl-libs-5.16.3-286.el7.s390x python-libs-2.7.5-34.el7.s390x slang-2.2.4-11.el7.s390x xz-libs-5.1.2-12alpha.el7.s390x zlib-1.2.7-15.el7.s390x (gdb) bt #0 rb_next (node=0x81573930, node@entry=0x81551840) at ../lib/rbtree.c:451 #1 0x00000000800a7da0 in dso__split_kallsyms_for_kcore (dso=dso@entry=0x812e69c0, map=map@entry=0x812e6fb0, filter=filter@entry=0x0) at util/symbol.c:668 #2 0x00000000800a9ac6 in dso__load_kallsyms (dso=dso@entry=0x812e69c0, filename=filename@entry=0x81353030 "/proc/kallsyms", map=map@entry=0x812e6fb0, filter=filter@entry=0x0) at util/symbol.c:1289 #3 0x00000000800aa0c4 in dso__load_kernel_sym (dso=dso@entry=0x812e69c0, map=map@entry=0x812e6fb0, filter=filter@entry=0x0) at util/symbol.c:1783 #4 0x00000000800aa208 in dso__load (dso=0x812e69c0, map=map@entry=0x812e6fb0, filter=filter@entry=0x0) at util/symbol.c:1420 #5 0x00000000800bb2aa in map__load (map=0x812e6fb0, filter=0x0) at util/map.c:289 #6 0x0000000080087c9e in thread__find_addr_map (thread=, cpumode=cpumode@entry=1 '\001', type=type@entry=MAP__FUNCTION, addr=, al=al@entry=0x3ffffffe118) at util/event.c:969 #7 0x0000000080081908 in build_id__mark_dso_hit (tool=, event=0x3fffd5aa568, sample=0x3ffffffe410, evsel=, machine=) at util/build-id.c:41 #8 0x00000000800bdfec in perf_evlist__deliver_sample (evlist=evlist@entry=0x812e5d60, tool=tool@entry=0x8024b240 , event=event@entry=0x3fffd5aa568, sample=sample@entry=0x3ffffffe410, evsel=evsel@entry=0x812e6770, machine=0x812e5ab8) at util/session.c:1039 #9 0x00000000800be156 in machines__deliver_event (machines=machines@entry=0x812e5ab8, evlist=0x812e5d60, event=event@entry=0x3fffd5aa568, sample=sample@entry=0x3ffffffe410, tool=tool@entry=0x8024b240 , file_offset=136552) at util/session.c:1076 #10 0x00000000800be3f2 in perf_session__deliver_event (session=session@entry=0x812e59e0, event=event@entry=0x3fffd5aa568, sample=sample@entry=0x3ffffffe410, tool=tool@entry=0x8024b240 , file_offset=) at util/session.c:1133 #11 0x00000000800c0146 in perf_session__process_event (session=session@entry=0x812e59e0, event=event@entry=0x3fffd5aa568, file_offset=file_offset@entry=136552) at util/session.c:1298 #12 0x00000000800c0746 in __perf_session__process_events (session=session@entry=0x812e59e0, data_offset=, data_size=, file_size=1164232, file_size@entry=1166128) at util/session.c:1633 #13 0x00000000800c0c2c in perf_session__process_events (session=session@entry=0x812e59e0) at util/session.c:1683 #14 0x000000008002ae5e in perf_session__list_build_ids (force=, with_hits=true) at builtin-buildid-list.c:82 #15 0x000000008002b078 in cmd_buildid_list (argc=, argv=, prefix=) at builtin-buildid-list.c:115 #16 0x000000008007c71a in run_builtin (p=p@entry=0x8024aab8 , argc=argc@entry=4, argv=0x3fffffff090) at perf.c:385 #17 0x000000008007c95e in handle_internal_command (argc=, argv=) at perf.c:445 #18 0x000000008007c9e4 in run_argv (argcp=argcp@entry=0x3ffffffedd4, argv=argv@entry=0x3ffffffedc8) at perf.c:489 #19 0x000000008007cca2 in main (argc=4, argv=0x3fffffff090) at perf.c:606 thanks, jirka --- diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index e7bf0c4..b0d2fb2 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -680,7 +680,7 @@ static int dso__split_kallsyms_for_kcore(struct dso *dso, struct map *map, pos->start -= curr_map->start - curr_map->pgoff; if (pos->end) pos->end -= curr_map->start - curr_map->pgoff; - if (curr_map != map) { + if (curr_map->dso != map->dso) { rb_erase_init(&pos->rb_node, root); symbols__insert( &curr_map->dso->symbols[curr_map->type],