Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp525990imm; Sat, 26 May 2018 05:12:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLX+ip5cvVeluexzYk4hkhPwGIwn5W1NNpAcgEcwrGq/1MnE16vLgwbwMVpjBuhllwNytW/ X-Received: by 2002:a65:6390:: with SMTP id h16-v6mr764795pgv.382.1527336720922; Sat, 26 May 2018 05:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527336720; cv=none; d=google.com; s=arc-20160816; b=UoMJw8Kj/ouEdEEglLw/wYHBV1dj4EK3ktBdP8BqCWWXqkukOHIqsBLPhmg8z0Ccmt a5Opi1HRAewNjUpu+wHfBcqfqq75X59owja9YF8EqhJ772no6R+zjveeSgciq7l7shUu Njtgeq3q6Neohdf/Kcr/qfhWWtb6GltF+mA9k8xMKAOlDra2N9YaCLpFSv9/v+zanALE /ac0khcSA+gBu2pWC/FYgnF2jVVzP7OvTU4mcUSMK6CsiKROAjLjU9sp9rJFZGKlmaCq 5vt2dAglYKuyaLS8iaAy2EUF9HF45nX7+0XCdtYyW5Si830wFsHiJ5umk/JQvek6tD+T Fm9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=7lgD1fuluUZhVMHErYaU/Afg7VT2rJ8whQpRFEahRjw=; b=tCqTs6LCqoxJdj/YYdF3zUTVBM8iITwhVRikgH5rTKVp/CtgewWH3HWU6+lVEW/QfA eUrZ7URowgDTKvBntWOUrXlQlgEc2kWuFzIZdbzgEUel2EKKxqyfzy3TwlfXt+IsL+Wd +zoO9j+uDPI0p9Bpyd/V6yGq+53ixTuyMoupZiDU+Sm0u5b6ki1A5fTTLtig90ADf2JL 00qEpTfLGZy/gfoDBYjra7XqzlP7jNyTHRtFLxAviGzhVBXXeArpFniL3NLQmewMRhgk 3d2CMFsAmn2X39CAU9cNDfjKgoLjFwPOAGoS667owAZ+4uc/61wgYdjMqYBeRc8pf175 E50A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si25379453plo.20.2018.05.26.05.11.12; Sat, 26 May 2018 05:12:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031678AbeEZMJT (ORCPT + 99 others); Sat, 26 May 2018 08:09:19 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57398 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1031444AbeEZMJS (ORCPT ); Sat, 26 May 2018 08:09:18 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 68F0D80125F1; Sat, 26 May 2018 12:09:17 +0000 (UTC) Received: from sandy.ghostprotocols.net (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D67FD111CA18; Sat, 26 May 2018 12:09:16 +0000 (UTC) Received: by sandy.ghostprotocols.net (Postfix, from userid 1000) id 4E949114; Sat, 26 May 2018 09:09:14 -0300 (BRT) Date: Sat, 26 May 2018 09:09:14 -0300 From: Arnaldo Carvalho de Melo To: Stephane Eranian Cc: LKML , Jiri Olsa , mingo@elte.hu, Peter Zijlstra , Andi Kleen , Vince Weaver Subject: Re: [BUG] perf/inject: crash in pipe mode Message-ID: <20180526120914.GA11944@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Sat, 26 May 2018 12:09:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Sat, 26 May 2018 12:09:17 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'acme@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, May 25, 2018 at 05:19:54PM -0700, Stephane Eranian escreveu: > Hi, > > > With the latest tip.git perf, if you run > > $ perf record -a -o - sleep 2 | perf inject -b -i - | perf buildid-list -i - > SEGFAULT in perf inject: > free_dup_event (oe=0x555555d25b88, oe=0x555555d25b88, > event=0x3030310931303031) at util/ordered-events.c:86 > 86 oe->cur_alloc_size -= event->header.size; > (gdb) bt > #0 free_dup_event (oe=0x555555d25b88, oe=0x555555d25b88, > event=0x3030310931303031) at util/ordered-events.c:86 > #1 ordered_events__free (oe=oe@entry=0x555555d25b88) at > util/ordered-events.c:310 > #2 0x00005555557964f8 in __perf_session__process_pipe_events > (session=0x555555d1f910) at util/session.c:1778 > #3 perf_session__process_events (session=session@entry=0x555555d1f910) at > util/session.c:1958 > #4 0x00005555556ef9b2 in __cmd_inject (inject=0x7fffffffda40) at > builtin-inject.c:697 > #5 cmd_inject (argc=, argv=) at > builtin-inject.c:871 > #6 0x000055555572e8b1 in run_builtin (p=0x555555be8f98 , > argc=4, argv=0x7fffffffe460) at perf.c:303 > #7 0x000055555572ebae in handle_internal_command (argc=4, > argv=0x7fffffffe460) at perf.c:355 > #8 0x00005555556ae1e1 in run_argv (argcp=, > argv=) at perf.c:399 > #9 main (argc=, argv=0x7fffffffe460) at perf.c:521 > > In general I think the pipe mode is not very well tested. I think it could > be made the default file format. I believe perf can > autodetect file vs. pipe mode perf.data using the header.size field. This > would simplify a few things inside perf and ensure > the pipe mode format is well tested. I'll investigate and add a test in tools/perf/tests/shell/ so that it gets tested before sending pull requests to upstreamers. - Arnaldo