From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758628AbdKPE1k (ORCPT ); Wed, 15 Nov 2017 23:27:40 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45758 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755109AbdKPE1d (ORCPT ); Wed, 15 Nov 2017 23:27:33 -0500 Subject: Re: [PATCH 16/35] perf annotate: Add samples into struct annotation_line To: Jiri Olsa Cc: Jiri Olsa , Arnaldo Carvalho de Melo , lkml , Ingo Molnar , Namhyung Kim , David Ahern , Peter Zijlstra , Andi Kleen , ravi.bangoria@linux.vnet.ibm.com References: <20171011150158.11895-1-jolsa@kernel.org> <20171011150158.11895-17-jolsa@kernel.org> <20171113201438.GB26900@krava> <20171114093114.GA25679@krava> <2d6af5ff-dad9-f2a1-e183-5dc79f91702b@linux.vnet.ibm.com> <20171114102954.GA29512@krava> <20171115140429.GA3661@krava> From: Ravi Bangoria Date: Thu, 16 Nov 2017 09:57:45 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171115140429.GA3661@krava> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 17111604-0020-0000-0000-000003CCDEB2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17111604-0021-0000-0000-000042621652 Message-Id: <41102853-a663-d3a1-8822-3bbfbc5c1aa8@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-16_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711160060 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiri, On 11/15/2017 07:34 PM, Jiri Olsa wrote: > On Tue, Nov 14, 2017 at 11:29:54AM +0100, Jiri Olsa wrote: >> On Tue, Nov 14, 2017 at 03:45:27PM +0530, Ravi Bangoria wrote: >>> Hi Jiri, >>> >>> On 11/14/2017 03:01 PM, Jiri Olsa wrote: >>>> On Mon, Nov 13, 2017 at 09:14:38PM +0100, Jiri Olsa wrote: >>>>> On Mon, Nov 13, 2017 at 09:16:20PM +0530, Ravi Bangoria wrote: >>>>>> Hi Jiri, >>>>>> >>>>>> This patch seems to be causing segfault with "perf top --stdio". >>>>>> >>>>>> Steps to reproduce: >>>>>> 1. start "perf top --stdio" in one terminal >>>>>> 2. run some simple workload in another terminal, let it get finished. >>>>>> 3. annotate function from previous workload in perf top (press 'a' followed >>>>>> by 's') >>>>>> >>>>>> Perf will crash with: >>>>>> >>>>>>   perf: Segmentation fault >>>>>>   Obtained 8 stack frames. >>>>>>   ./perf(sighandler_dump_stack+0x3e) [0x4f1b6e] >>>>>>   /lib64/libc.so.6(+0x36a7f) [0x7ff3aa7e4a7f] >>>>>>   ./perf() [0x4a27fd] >>>>>>   ./perf(symbol__annotate+0x199) [0x4a4439] >>>>>>   ./perf() [0x44e32d] >>>>>>   ./perf() [0x44f098] >>>>>>   /lib64/libpthread.so.0(+0x736c) [0x7ff3acee836c] >>>>>>   /lib64/libc.so.6(clone+0x3e) [0x7ff3aa8bee1e] >>>>>> >>>>>> Can you please check. >>>>> hum, I'm getting following crash after resizing the terminal window: >>>>> >>>>> perf: Floating point exception >>>>> Obtained 8 stack frames. >>>>> ./perf(dump_stack+0x2e) [0x510c89] >>>>> ./perf(sighandler_dump_stack+0x2e) [0x510d69] >>>>> /lib64/libc.so.6(+0x36a80) [0x7f9419588a80] >>>>> ./perf(perf_top__header_snprintf+0x208) [0x4f42c1] >>>>> ./perf() [0x453c09] >>>>> ./perf() [0x454ddb] >>>>> /lib64/libpthread.so.0(+0x736d) [0x7f941bc8c36d] >>>>> /lib64/libc.so.6(clone+0x3f) [0x7f9419662e1f] >>>>> Floating point exception (core dumped) >>>>> >>>>> working on fix >>>> so my crash is caused by bogus resize code, I have it working with fix for >>>> memory corruption happening in SIGWINCH signal handler (attached) >>>> could you please check if that fixes the code for you? >>> Yes, this fixes the crash caused by resize. >>> >>> But original crash I reported is still there. Issue seems to be with evsel >>> being NULL and we are trying to de-reference it somewhere inside >>> annotation_line__new(). >>> >>> Will try to spend more time on it. >> right, I can see it now.. we are passing NULL as evsel in >> the top but does not check on that.. attached patch prevents >> the crash for me, but I'll need to double check if that's >> correct fix > I ended up with few other annotation fixes, could you please > check following branch if it's working for you? > > https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git > perf/fixes Changes looks good to me. Thanks, Ravi