Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1273425imu; Wed, 16 Jan 2019 16:10:02 -0800 (PST) X-Google-Smtp-Source: ALg8bN72bde+zRKnZpIAgc1T2XOwWnKZ+9H8iGiwyXhNAvbPTmf5MIDn7kV0PiMbM1lMK7ne3BXM X-Received: by 2002:aa7:8758:: with SMTP id g24mr12392621pfo.250.1547683801961; Wed, 16 Jan 2019 16:10:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547683801; cv=none; d=google.com; s=arc-20160816; b=ElI8PiQKLf4h3NXN9ayiZUxZXMe3qHr0riGP3Z2hDMxw4rUvG8RpPZ+Xuf7qRZR2Vf SD+h4cDA4GnI4j3Xea2Y1h+QRRsxR7KXj3uNMVqi52H6fledKJfr4bjU6dWw4vsDjJDo 2s19tjvRFqRTPvf7uKYnKx7+ukyRkd+npTcz5dZz1kE+QFAwB5wjYi5+7DuwARLac82e si8Xfl2Iq7L+6g5/LBxr1S2WW1hO83t8BQE37Lywj1XTAOe3UBkfdEM5a0c7k9a1wpZl 4SXoUfUsazv/UDczC8lfK4v1RaAgjWTVlCje9F4JKNpHlqoY+9FCK+qoRJ4Taf6wP2nt MSeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature; bh=uvIs70O3qRA1NMDZcp8RUJ2MmdYk3fT1LOw+0q0p6fo=; b=r/fLap1nggchx1L85fUn3Gr0AheuMsWdWKBeqnaevnF1/ruz3jL2A43M3Pc9udqvmu Xk38exIADSiXR0V/KbcwbfJe3LryK4/UAsKQg5kJhO+7Egtz4llWdMZldytCNNiNYrF/ ktE9z4znts3NbuXIG1+IycPlsft4r/evzICwWl4TrYYiwTdERQ5D6tAjDfBo3kgqdqwr wLZrXl1roghQTXuhMCvd7uwwse4eWtXilac3difFXdu3Q8RgtqFP6vHifrpAr4tLxni+ teZX9nZ95WEMjfRTEWQ/TIeLF550L/B3rZM9smF4IJuJigJv6BgBz00YbZbHZqdcOs98 +egQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fCadf8Jd; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j3si7573924plk.199.2019.01.16.16.09.43; Wed, 16 Jan 2019 16:10:01 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fCadf8Jd; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729953AbfAPS6C (ORCPT + 99 others); Wed, 16 Jan 2019 13:58:02 -0500 Received: from mail-qt1-f175.google.com ([209.85.160.175]:46160 "EHLO mail-qt1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728926AbfAPS6B (ORCPT ); Wed, 16 Jan 2019 13:58:01 -0500 Received: by mail-qt1-f175.google.com with SMTP id y20so8378331qtm.13 for ; Wed, 16 Jan 2019 10:58:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=uvIs70O3qRA1NMDZcp8RUJ2MmdYk3fT1LOw+0q0p6fo=; b=fCadf8JdnWP5QU4Yxno9eiYq/ha+LYNgK7kOwn6KlXy1bU45UbBlplnBByD/29Vpa0 pAhOmKrh79/Tcmv6TQT/y3JFDyBKErEQdJNeQ9kJL0IwtSpN4N/vkwhhmCyj9zZbtuIA 18UCzkO9CwOJ2LEpyUkhI/jDEVAaqcvCzcTOU2IiTOGfNtujIcxEoyMvAmwhAoyKSqIs 5p+HO/qnyn6qo7okaTbb3++OJOl2zvQi4YVWPy0VSY5nq44pce9j3eZWnW4ymCRp9uRv PCdQFlkR2d1xAqJMFhwo6oI+cJqoUnCpnPTnE0nqJtUUJii4r1HYCT2QS55TZ/aMGDtH h+jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=uvIs70O3qRA1NMDZcp8RUJ2MmdYk3fT1LOw+0q0p6fo=; b=bgjyPssHEfHjMbnB78UR9lEScVwzc1p6HN/8Ub83V0orIyBVoSseuujB68HMR3zbp2 4itVSvynTfweSVdrg5Hnm76Cy0Acih3sJDrzMzz6RJgu+r4q7rRAcA4uIs3f1HNkSf2Y NP7xe+KkJDjJtqw0TfD26Et9MG42fyVV8GzFIWtKW0RQvpluT+t4/STpuSO9JUDMTqYY bXZmDlmzAeTWSfBVCiJp+0fPpnHSpYBNsWeJnH3E8KhZYR90bJIcaTqAWv/tUGa/pyy1 fJnU9+QDVKuwwVmNoQP8JmINaKHshEuexIR2PcYSNcLcgGSQ54nZZuzWWFDGfPy5beVq njkg== X-Gm-Message-State: AJcUukf46xIoQHrV88qf1FSCevLwvGMzlz3ArHkX6AsWv3F3b25yJBvY yfilc963QM+12IEG+R4efV+iM/0YmjENtqIVTE4gAOlD X-Received: by 2002:ac8:1889:: with SMTP id s9mr8103919qtj.268.1547665080645; Wed, 16 Jan 2019 10:58:00 -0800 (PST) MIME-Version: 1.0 From: Song Liu Date: Wed, 16 Jan 2019 10:57:49 -0800 Message-ID: Subject: perf segfault in in ordered_events__free() To: open list , Jiri Olsa Cc: acme@kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, We are debugging a segfault of perf in ordered_events__free(). Disassemble shows the segfault was caused by oe->buff == NULL in the following line: /* * Current buffer might not have all the events allocated * yet, we need to free only allocated ones ... */ list_del(&oe->buffer->list); After poking around the code, I suspect it is caused by the following condition in alloc_event(): } else if (oe->buffer) { new = &oe->buffer->event[oe->buffer_idx]; if (++oe->buffer_idx == MAX_SAMPLE_BUFFER) oe->buffer = NULL; Does this theory make sense? If so, what would be the best fix? Thanks in advance! Song