Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932922AbbDJMvY (ORCPT ); Fri, 10 Apr 2015 08:51:24 -0400 Received: from mail.kernel.org ([198.145.29.136]:35875 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932356AbbDJMvT (ORCPT ); Fri, 10 Apr 2015 08:51:19 -0400 Date: Fri, 10 Apr 2015 09:51:21 -0300 From: Arnaldo Carvalho de Melo To: He Kuang Cc: a.p.zijlstra@chello.nl, mingo@redhat.com, namhyung@kernel.org, jolsa@kernel.org, wangnan0@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf buildid-list: Fix segfault when show DSOs with hits Message-ID: <20150410125121.GD4521@kernel.org> References: <1428658500-6483-1-git-send-email-hekuang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1428658500-6483-1-git-send-email-hekuang@huawei.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1291 Lines: 34 Em Fri, Apr 10, 2015 at 05:35:00PM +0800, He Kuang escreveu: > commit: f3b623b8490a ("perf tools: Reference count struct thread") > appends every thread->node to dead_threads in machine__remove_thread() > and list_del_init() this node in thread__put(). > > perf_event__exit_del_thread() releases thread wihout using > machine__remove_thread(), and causes a NULL pointer crash when > list_del_init(&thread->node) is called. Fix this by using > machine_remove_thread() instead of using thread__put() directly. > > This problem can be reproduced as following: > > $ perf record ls > $ perf buildid-list --with-hits > [ 3874.195070] perf[1018]: segfault at 0 ip 00000000004b0b15 sp > 00007ffc35b44780 error 6 in perf[400000+166000] > Segmentation fault > > After this patch: > $ perf record ls > $ perf buildid-list --with-hits > bc23e7c3281e542650ba4324421d6acf78f4c23e /proc/kcore > 643324cb0e969f30c56d660f167f84a150845511 [vdso] > 0000000000000000000000000000000000000000 /bin/busybox > ... Thanks, applied. - Arnaldo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/