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 2FBFDA10DA for ; Fri, 2 Aug 2019 15:44:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 018631C2AC; Fri, 2 Aug 2019 15:44:11 +0200 (CEST) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by dpdk.org (Postfix) with ESMTP id CF5591C296 for ; Fri, 2 Aug 2019 15:44:09 +0200 (CEST) Received: by mail-io1-f67.google.com with SMTP id z3so11111559iog.0 for ; Fri, 02 Aug 2019 06:44:09 -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=kgO1fX4d+l5Bfcfc5Bo5jobdkjrUmFe6yFaLWHvmQ/c=; b=YV45IJBp6BKWwpC6yIr5MN5eVUaLm1ocJr0QhV56hiHIf4UewpyCauPWrmXAzeN+c+ AKf+F7k8FuaMGQO42AZ9qP4SJFLBosg1esdumeynmGUrJYldkghNs/fKiIyPK4sN9ho5 0HK0SeG6CUC3iylJxTcPyPYSK91/fPwAGHz6tnnNitqCZF68innuMpO843rn548+xLRK uDQFeXR5qXruIfwGSVK0dtMVzKJn9N90GI1mdvwwQ1gPcutWekUgrDecU1rbSMOR4Pcp m/toAyZhGn6GnMeKdjulLiiy5qo8pl1dexWIFsx9GyuGGH6mcarWD9maMaZPoHyTNVFw n9Uw== X-Gm-Message-State: APjAAAXaqjeDFmq2ceTnELNP8lhd/D4UuhV0gXmYqy2O1C4X5k7+E+GP 6QRFYfMaHqYREPWwvr6FgqIUqjzJ5pxu/+zKzG1qnQ== X-Google-Smtp-Source: APXvYqwlYo7lzzmfRTaKZJiwXk3HV2Q0RIuQYaVNSG9yTiwhpoGBUdBDwwxewitNJiVCMky0AZam5poBA0nVrdWaSkA= X-Received: by 2002:a5e:8412:: with SMTP id h18mr6065576ioj.268.1564753449271; Fri, 02 Aug 2019 06:44:09 -0700 (PDT) MIME-Version: 1.0 References: <1564599390-9684-1-git-send-email-david.marchand@redhat.com> In-Reply-To: From: Michael Santana Francisco Date: Fri, 2 Aug 2019 09:43:57 -0400 Message-ID: To: David Marchand 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 Thu, Aug 1, 2019 at 3:25 AM David Marchand wrote: > > 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. My apologies, your patch was right from the start . I was counting the wrong thing Acked-by: Michael Santana > > > > {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