From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C0E0DA10DA for ; Thu, 1 Aug 2019 09:25:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A54F61C1BD; Thu, 1 Aug 2019 09:25:17 +0200 (CEST) Received: from mail-ua1-f66.google.com (mail-ua1-f66.google.com [209.85.222.66]) by dpdk.org (Postfix) with ESMTP id BA3DE1C1BA for ; Thu, 1 Aug 2019 09:25:16 +0200 (CEST) Received: by mail-ua1-f66.google.com with SMTP id j2so1213093uaq.5 for ; Thu, 01 Aug 2019 00:25:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=i8ObTbLz1HFRStawV7S6uMIdHzjsUfMQw3DqWjfHP4k=; b=kExaS1neblBp37hqcsW3ubF1w98hFWmz3d+fg/LRuQQbalFC404EH6X5nE5D+kGF01 8mWCfCpN5lSjfANKay6x/AIBRu9wfiPbrsZ4nJh7a8nrAdos+vrbkqzmyesOKT/n3d2y 6LsoqyU85SCHbt7ByYgDOBXClGn0lXFR3KjNuQ8/+ZpZdZ8GgdYYJvm2f8d3J2+OKVQo x3sSlP70Sdh1LuhUwSaJ0EMAEUtRRqFyXVEdGJ65THNAuj5mNjZ6mTy933zoeRvjy36J 0h0sv5LrpFhT0QbCmU94J3FV3oFM/j6LGMZoFdTQmUM9saHHobKYJsq7MuBTL3LiZzDq gTKQ== X-Gm-Message-State: APjAAAWpNGawXZszlUfzJydG28jP2RIv7Jv+Q0F+hyCbt6h3QrJHrOSi pbVDJ4tJjuEeyYAKSyfKEXaJc1xBQEY55BygqtvXEg== X-Google-Smtp-Source: APXvYqwQB9TT8vzm3DsoEb6HzquqhwGyvGOwK1oA1dGFRzr1I8pbYE5UHYQG25ZPOAhzhF3XMbnS2qwRCb98LEo3SbY= X-Received: by 2002:ab0:168a:: with SMTP id e10mr33391219uaf.87.1564644316164; Thu, 01 Aug 2019 00:25:16 -0700 (PDT) MIME-Version: 1.0 References: <1564599390-9684-1-git-send-email-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Thu, 1 Aug 2019 09:25:05 +0200 Message-ID: To: Michael Santana Francisco Cc: dev , Aaron Conole Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] test/eal: fix incorrect array sizes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Jul 31, 2019 at 9:57 PM Michael Santana Francisco wrote: > > On Wed, Jul 31, 2019 at 2:56 PM David Marchand > wrote: > > > > Following removal of -c and -n options, the array should have been > > shrunk to avoid launch_proc to access unitialised strings. > > > > Fixes: b4dbacdb1ad7 ("test/eal: set core mask/list config only in dedicated test") > > Fixes: 501fa9a40298 ("test/eal: set memory channel config only in dedicated test") > > > > Signed-off-by: David Marchand > Good patch, but is it just me or are you off by one in some places? see inline The "funny" thing is that it went unnoticed, because the strdup happens after the test binary forked a child to start a dpdk process. This child segfaults, but the test code running in the parent just checks that starting this child failed (since it passed incorrect eal arguments). > > --- > > app/test/test_eal_flags.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c > > index 827ea88..5b2c0f5 100644 > > --- a/app/test/test_eal_flags.c > > +++ b/app/test/test_eal_flags.c > > @@ -244,7 +244,7 @@ test_whitelist_flag(void) > > snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp); > > #endif > > > > - const char *wlinval[][11] = { > > + const char *wlinval[][7] = { > Shoudln't this be wlinval[][6]? I can see 7 elements in this array. > > {prgname, prefix, mp_flag, > > pci_whitelist, "error", "", ""}, > > {prgname, prefix, mp_flag, > > @@ -310,7 +310,7 @@ test_invalid_b_flag(void) > > snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp); > > #endif > > > > - const char *blinval[][9] = { > > + const char *blinval[][5] = { > blinval[][6]? 5 elements. > > {prgname, prefix, mp_flag, "-b", "error"}, > > {prgname, prefix, mp_flag, "-b", "0:0:0"}, > > {prgname, prefix, mp_flag, "-b", "0:error:0.1"}, > > @@ -414,7 +414,7 @@ test_invalid_r_flag(void) > > snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp); > > #endif > > > > - const char *rinval[][9] = { > > + const char *rinval[][5] = { > rinval[][4]? Idem. > > {prgname, prefix, mp_flag, "-r", "error"}, > > {prgname, prefix, mp_flag, "-r", "0"}, > > {prgname, prefix, mp_flag, "-r", "-1"}, > > -- > > 1.8.3.1 > > -- David Marchand