From patchwork Wed Jul 17 08:53:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11047477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0AF16C5 for ; Wed, 17 Jul 2019 08:53:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFB03286AC for ; Wed, 17 Jul 2019 08:53:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B40B028716; Wed, 17 Jul 2019 08:53:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FD47286AC for ; Wed, 17 Jul 2019 08:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726851AbfGQIxl (ORCPT ); Wed, 17 Jul 2019 04:53:41 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:55424 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbfGQIxl (ORCPT ); Wed, 17 Jul 2019 04:53:41 -0400 Received: by mail-wm1-f67.google.com with SMTP id a15so21271462wmj.5 for ; Wed, 17 Jul 2019 01:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hZsbXSzkaL5uC/+rz+3t2VLv0xFcqNvTyg6Ul4E7X/U=; b=I7O5vrYfnkB5rH8/DwtWi1x+dEj05AhmHU3jZskzZFHYI7LAZXpivXtbegQIU6WW3r mw4QlfQlhUKMYA+GzQOdQaIRWd1eIRTtyu/UNGNV/Nixo1k1l6f/hnUu3PdJP6zHuukn Ys918kY/olpDWwXq8VvAC00AJt3M0R0KEcwWh1bF5tUpXOukhq+VOyiEGHRrh+aYcQae wxuqRESyY2T9hlwMSz13SDLdiEad1cBXASQMQCtyod+UCOYR7HhVAk4hZfi4A7XzQ+31 gOes4dcrh0Furq2acTtNiTArpIy1BGQ4l9mX4KIRrz/4TrgLaHT6aopV6M6TRahUY8TG 9e2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hZsbXSzkaL5uC/+rz+3t2VLv0xFcqNvTyg6Ul4E7X/U=; b=awgXF3WCr7MljcSCps1ZYihVGa4Um5KC2UwAIu0kunHFefU3hP+nPQTYwPaKUkHxTY kov6QFRDS0etEJTnYWdYQAeE2tYNgkoMMno9R01iXpEP7b+f5PYaImT7mn67a1XgJrp9 7fuB5dBoXlWQ4QJKAY1psJ/tHrGKn/lxQby7iQq94Wewm4r7DoYKj3P8d4+Nz3l+o96e /f8bAiSQcYerxwEinNyAMm8oaRw1UxA+EPqwufiDFQqwPVSf6lPSTaZjhg0LDbDswiUE Gi26GyDPcSBGK6xqlPxGCauKK9nh0+JTU6dbNae2WvLlQmP9cs2ZOAGUVw46y8Sxs2Yi Ps+w== X-Gm-Message-State: APjAAAXqXTJf37N/Z3OIsJMd9vHEs/bC87jsZBU/BZOrfcQDBIceRhJg SDtpreopL3hvS2olUjWcXIc= X-Google-Smtp-Source: APXvYqwOfVJm+bAF+TZOXKeO/mz9lLbc4rVm9W6CCkJmKBMlQURnswAA/yVEYsK6FuM5c1xzlbgKtg== X-Received: by 2002:a1c:343:: with SMTP id 64mr30565890wmd.116.1563353620060; Wed, 17 Jul 2019 01:53:40 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id w23sm24102127wmi.45.2019.07.17.01.53.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 17 Jul 2019 01:53:39 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" Subject: [PATCH 1/2] kernel-shark: Initialize the data-related fields of the model Date: Wed, 17 Jul 2019 11:53:05 +0300 Message-Id: <20190717085306.12393-2-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190717085306.12393-1-y.karadz@gmail.com> References: <20190717085306.12393-1-y.karadz@gmail.com> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is particularly important to initialize to zero the "data_size" field because its value is used when doing operations like scroll or zoom to check if data has been loaded or not. Not having "data_size" set to zero can cause segfault (as reported by Steven). Reported-By: Steven Rostedt (VMware) Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204195 Signed-off-by: Yordan Karadzhov (VMware) Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Steven Rostedt (VMware) Reviewed-by: Yordan Karadzhov (VMware) --- kernel-shark/src/libkshark-model.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel-shark/src/libkshark-model.c b/kernel-shark/src/libkshark-model.c index 18f9c69..fd4d876 100644 --- a/kernel-shark/src/libkshark-model.c +++ b/kernel-shark/src/libkshark-model.c @@ -36,6 +36,9 @@ void ksmodel_init(struct kshark_trace_histo *histo) * Initialize an empty histo. The histo will have no bins and will * contain no data. */ + histo->data_size = 0; + histo->data = NULL; + histo->bin_size = 0; histo->min = 0; histo->max = 0;