DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: fix service array initialisation
@ 2017-09-21 11:48 Nelio Laranjeiro
  2017-09-21 11:53 ` Van Haaren, Harry
  0 siblings, 1 reply; 3+ messages in thread
From: Nelio Laranjeiro @ 2017-09-21 11:48 UTC (permalink / raw)
  To: dev; +Cc: harry.van.haaren

GCC is complaining on variable used without being initialised.

 dpdk.org/lib/librte_eal/common/rte_service.c:
 In function ‘rte_service_start_with_defaults’:
 dpdk.org/lib/librte_eal/common/rte_service.c:449:9:
 error: ‘ids[0]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    ret = rte_service_map_lcore_set(i, ids[lcore_iter], 1);

Fixes: 21698354c832 ("service: introduce service cores concept")
Cc: harry.van.haaren@intel.com

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 lib/librte_eal/common/rte_service.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index 43716bb..aa05277 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -431,7 +431,7 @@ rte_service_start_with_defaults(void)
 	uint32_t count = rte_service_get_count();
 
 	int32_t lcore_iter = 0;
-	uint32_t ids[RTE_MAX_LCORE];
+	uint32_t ids[RTE_MAX_LCORE] = { 0 };
 	int32_t lcore_count = rte_service_lcore_list(ids, RTE_MAX_LCORE);
 
 	if (lcore_count == 0)
-- 
2.1.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix service array initialisation
  2017-09-21 11:48 [dpdk-dev] [PATCH] eal: fix service array initialisation Nelio Laranjeiro
@ 2017-09-21 11:53 ` Van Haaren, Harry
  2017-09-21 12:04   ` Nélio Laranjeiro
  0 siblings, 1 reply; 3+ messages in thread
From: Van Haaren, Harry @ 2017-09-21 11:53 UTC (permalink / raw)
  To: Nelio Laranjeiro, dev

> From: Nelio Laranjeiro [mailto:nelio.laranjeiro@6wind.com]
> Sent: Thursday, September 21, 2017 12:48 PM
> To: dev@dpdk.org
> Cc: Van Haaren, Harry <harry.van.haaren@intel.com>
> Subject: [PATCH] eal: fix service array initialisation
> 
> GCC is complaining on variable used without being initialised.
> 
>  dpdk.org/lib/librte_eal/common/rte_service.c:
>  In function ‘rte_service_start_with_defaults’:
>  dpdk.org/lib/librte_eal/common/rte_service.c:449:9:
>  error: ‘ids[0]’ may be used uninitialized in this function [-Werror=maybe-
> uninitialized]
>     ret = rte_service_map_lcore_set(i, ids[lcore_iter], 1);
> 
> Fixes: 21698354c832 ("service: introduce service cores concept")
> Cc: harry.van.haaren@intel.com
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

Hi Nelio,

Thanks for the patch - indeed this seems to be an issue. It was raised by Yang too
in this thread http://dpdk.org/ml/archives/dev/2017-September/076210.html

Given I've asked for a v2 of that patchset, and it was posted earlier I'll suggest
to merge that one, if that's OK with you?

On another note, I'm curious why neither I or the automated build-system experienced this...

Thanks for investigating / proposing a solution. -Harry

> ---
>  lib/librte_eal/common/rte_service.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_eal/common/rte_service.c
> b/lib/librte_eal/common/rte_service.c
> index 43716bb..aa05277 100644
> --- a/lib/librte_eal/common/rte_service.c
> +++ b/lib/librte_eal/common/rte_service.c
> @@ -431,7 +431,7 @@ rte_service_start_with_defaults(void)
>  	uint32_t count = rte_service_get_count();
> 
>  	int32_t lcore_iter = 0;
> -	uint32_t ids[RTE_MAX_LCORE];
> +	uint32_t ids[RTE_MAX_LCORE] = { 0 };
>  	int32_t lcore_count = rte_service_lcore_list(ids, RTE_MAX_LCORE);
> 
>  	if (lcore_count == 0)
> --
> 2.1.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] eal: fix service array initialisation
  2017-09-21 11:53 ` Van Haaren, Harry
@ 2017-09-21 12:04   ` Nélio Laranjeiro
  0 siblings, 0 replies; 3+ messages in thread
From: Nélio Laranjeiro @ 2017-09-21 12:04 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: dev

Hi Harry,

On Thu, Sep 21, 2017 at 11:53:48AM +0000, Van Haaren, Harry wrote:
> > From: Nelio Laranjeiro [mailto:nelio.laranjeiro@6wind.com]
> > Sent: Thursday, September 21, 2017 12:48 PM
> > To: dev@dpdk.org
> > Cc: Van Haaren, Harry <harry.van.haaren@intel.com>
> > Subject: [PATCH] eal: fix service array initialisation
> > 
> > GCC is complaining on variable used without being initialised.
> > 
> >  dpdk.org/lib/librte_eal/common/rte_service.c:
> >  In function ‘rte_service_start_with_defaults’:
> >  dpdk.org/lib/librte_eal/common/rte_service.c:449:9:
> >  error: ‘ids[0]’ may be used uninitialized in this function [-Werror=maybe-
> > uninitialized]
> >     ret = rte_service_map_lcore_set(i, ids[lcore_iter], 1);
> > 
> > Fixes: 21698354c832 ("service: introduce service cores concept")
> > Cc: harry.van.haaren@intel.com
> > 
> > Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> 
> Hi Nelio,
> 
> Thanks for the patch - indeed this seems to be an issue. It was raised by Yang too
> in this thread http://dpdk.org/ml/archives/dev/2017-September/076210.html
> 
> Given I've asked for a v2 of that patchset, and it was posted earlier I'll suggest
> to merge that one, if that's OK with you?

Yes, it is.  I have search for such patch, but it is not easy to find
it.  I will move this patch to superseded on the patchwork.

> On another note, I'm curious why neither I or the automated build-system experienced this...

I don't know either, I faced the issue on debian 8, on ubuntu 16.04 and
redhat the issue is not visible.  It becomes quiet complicate for a
single guy to test on so many distributions ;)

> Thanks for investigating / proposing a solution. -Harry

Thanks,

-- 
Nélio Laranjeiro
6WIND

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-21 12:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-21 11:48 [dpdk-dev] [PATCH] eal: fix service array initialisation Nelio Laranjeiro
2017-09-21 11:53 ` Van Haaren, Harry
2017-09-21 12:04   ` Nélio Laranjeiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).