From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752891AbbC0RbZ (ORCPT ); Fri, 27 Mar 2015 13:31:25 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:35607 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752353AbbC0RbX (ORCPT ); Fri, 27 Mar 2015 13:31:23 -0400 Message-ID: <551593EA.2030201@gmail.com> Date: Fri, 27 Mar 2015 11:31:22 -0600 From: David Ahern User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Stephane Eranian CC: LKML Subject: [BUG] segfault in perf-top -- thread refcnt Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnaldo: If I leave 'perf top -z' running it eventually crashes with the backtrace in the new thread refcnt code: (gdb) bt #0 __list_del_entry (thread=0x670bd30) at /home/dahern/kernels/linux.git/tools/perf/util/include/../../../../include/linux/list.h:102 #1 list_del_init (thread=0x670bd30) at /home/dahern/kernels/linux.git/tools/perf/util/include/../../../../include/linux/list.h:145 #2 thread__put (thread=0x670bd30) at util/thread.c:94 #3 0x00000000001bfa3c in __thread__zput (he=0x820adc0) at util/thread.h:48 #4 hist_entry__delete (he=0x820adc0) at util/hist.c:939 #5 0x00000000001c18a4 in hists__delete_entry (hists=0x4fe0f8) at util/hist.c:255 #6 hists__delete_entries (hists=0x4fe0f8) at util/hist.c:283 #7 0x00000000001250e8 in perf_top__sort_new_samples (arg=0x7feffffbca8) at builtin-top.c:549 #8 0x00000000001e9108 in hist_browser__run (evsel=0x4fdfc0, nr_events=, helpline=, left_exits=, hbt=0xfff800012cd7cce0, min_pcnt=0, env=0x4fe4c0) at ui/browsers/hists.c:431 #9 perf_evsel__hists_browse (evsel=0x4fdfc0, nr_events=, helpline=, left_exits=, hbt=0xfff800012cd7cce0, min_pcnt=0, env=0x4fe4c0) at ui/browsers/hists.c:1501 #10 0x00000000001eb390 in perf_evlist__tui_browse_hists (evlist=0x4c9ae0, help=0x28dc00 "For a higher level overview, try: perf top --sort comm,dso", hbt=0xfff800012cd7cce0, min_pcnt=, env=0x4fe4c0) at ui/browsers/hists.c:2022 #11 0x0000000000126188 in display_thread_tui (arg=) at builtin-top.c:582 #12 0xfff8000100130a68 in start_thread () from /lib64/libpthread.so.0 #13 0xfff800010139c598 in __thread_start () from /lib64/libc.so.6 #14 0xfff800010139c598 in __thread_start () from /lib64/libc.so.6 (gdb) fra 2 #2 thread__put (thread=0x670bd30) at util/thread.c:94 94 util/thread.c: No such file or directory. in util/thread.c (gdb) p *thread $2 = {{rb_node = {__rb_parent_color = 106933920, rb_right = 0x0, rb_left = 0x0}, node = {next = 0x65faea0, prev = 0x0}}, mg = 0x670be20, pid_ = 153034, tid = 153034, ppid = -1, cpu = -1, refcnt = 0, shortname = "\000\000", comm_set = false, dead = false, comm_list = {next = 0x670bdc0, prev = 0x670bdc0}, comm_len = 7, db_id = 0, priv = 0x0, ts = 0x0} In node element, prev is NULL