Message ID | 1464590565-16857-1-git-send-email-maxim.uvarov@linaro.org |
---|---|
State | Superseded |
Headers | show |
On Mon, May 30, 2016 at 1:42 AM, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: > Fix segmentation failt with not initialized attr for pthreads. > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> > --- > platform/linux-generic/odp_traffic_mngr.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/platform/linux-generic/odp_traffic_mngr.c > b/platform/linux-generic/odp_traffic_mngr.c > index 0b37142..083f01b 100644 > --- a/platform/linux-generic/odp_traffic_mngr.c > +++ b/platform/linux-generic/odp_traffic_mngr.c > @@ -2551,6 +2551,7 @@ static int tm_thread_create(tm_system_t *tm_system) > uint32_t cpu_num; > int rc; > > + memset(&attr, 0, sizeof(pthread_attr_t)); > Since we're using Posix APIs here, this should be pthread_attr_init(&attr); > cpu_num = tm_thread_cpu_select(); > CPU_ZERO(&cpu_set); > CPU_SET(cpu_num, &cpu_set); > -- > 2.7.1.250.gff4ea60 > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/lng-odp >
On 05/31/16 02:54, Bill Fischofer wrote: > > > On Mon, May 30, 2016 at 1:42 AM, Maxim Uvarov <maxim.uvarov@linaro.org > <mailto:maxim.uvarov@linaro.org>> wrote: > > Fix segmentation failt with not initialized attr for pthreads. > > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org > <mailto:maxim.uvarov@linaro.org>> > --- > platform/linux-generic/odp_traffic_mngr.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/platform/linux-generic/odp_traffic_mngr.c > b/platform/linux-generic/odp_traffic_mngr.c > index 0b37142..083f01b 100644 > --- a/platform/linux-generic/odp_traffic_mngr.c > +++ b/platform/linux-generic/odp_traffic_mngr.c > @@ -2551,6 +2551,7 @@ static int tm_thread_create(tm_system_t > *tm_system) > uint32_t cpu_num; > int rc; > > + memset(&attr, 0, sizeof(pthread_attr_t)); > > > Since we're using Posix APIs here, this should be > pthread_attr_init(&attr); thanks, will send v2. Maxim. > cpu_num = tm_thread_cpu_select(); > CPU_ZERO(&cpu_set); > CPU_SET(cpu_num, &cpu_set); > -- > 2.7.1.250.gff4ea60 > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org> > https://lists.linaro.org/mailman/listinfo/lng-odp > >
diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c index 0b37142..083f01b 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -2551,6 +2551,7 @@ static int tm_thread_create(tm_system_t *tm_system) uint32_t cpu_num; int rc; + memset(&attr, 0, sizeof(pthread_attr_t)); cpu_num = tm_thread_cpu_select(); CPU_ZERO(&cpu_set); CPU_SET(cpu_num, &cpu_set);
Fix segmentation failt with not initialized attr for pthreads. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> --- platform/linux-generic/odp_traffic_mngr.c | 1 + 1 file changed, 1 insertion(+)