* [PATCH 21.11] ring: squash gcc 12.2.1 warnings
@ 2022-12-20 12:37 Kevin Traynor
2022-12-20 17:18 ` Kevin Traynor
2023-03-16 11:00 ` David Marchand
0 siblings, 2 replies; 5+ messages in thread
From: Kevin Traynor @ 2022-12-20 12:37 UTC (permalink / raw)
To: stable
Cc: alialnu, david.marchand, Kevin Traynor, Honnappa Nagarahalli,
Konstantin Ananyev
gcc 12.2.1 on Fedora 37 is giving stringop-overread and
stringop-overflow warnings when compiled with --buildtype=debug
e.g. [1].
These are not yet fixed on main branch. They look similar
to the overflow issues previously squashed in rte_memcpy with
commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings")
In order to ensure DPDK 21.11.3 compiles on Fedora 37, squash these
warnings. If a subsequent cleaner fix becomes available on from main
branch it can be backported to later DPDK 21.11 LTS release.
[1]
lib/ring/rte_ring_elem_pvt.h:100:25: error:
‘memcpy’ reading 32 bytes from a region of size 4
[-Werror=stringop-overread]
100 | memcpy((void *)(ring + idx),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
101 | (const void *)(obj + i), 32);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/ring/rte_ring_elem_pvt.h:234:25: error:
‘memcpy’ writing 32 bytes into a region of size 4 overflows the destination
[-Werror=stringop-overflow=]
234 | memcpy((void *)(obj + i), (void *)(ring + idx), 32);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
lib/ring/rte_ring_elem_pvt.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/lib/ring/rte_ring_elem_pvt.h b/lib/ring/rte_ring_elem_pvt.h
index 275ec55393..04b55c34a4 100644
--- a/lib/ring/rte_ring_elem_pvt.h
+++ b/lib/ring/rte_ring_elem_pvt.h
@@ -11,4 +11,10 @@
#define _RTE_RING_ELEM_PVT_H_
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Wstringop-overread"
+#endif
+
static __rte_always_inline void
__rte_ring_enqueue_elems_32(struct rte_ring *r, const uint32_t size,
@@ -383,3 +389,7 @@ __rte_ring_do_dequeue_elem(struct rte_ring *r, void *obj_table,
}
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000)
+#pragma GCC diagnostic pop
+#endif
+
#endif /* _RTE_RING_ELEM_PVT_H_ */
--
2.38.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 21.11] ring: squash gcc 12.2.1 warnings
2022-12-20 12:37 [PATCH 21.11] ring: squash gcc 12.2.1 warnings Kevin Traynor
@ 2022-12-20 17:18 ` Kevin Traynor
2023-03-16 11:00 ` David Marchand
1 sibling, 0 replies; 5+ messages in thread
From: Kevin Traynor @ 2022-12-20 17:18 UTC (permalink / raw)
To: stable; +Cc: alialnu, david.marchand, Honnappa Nagarahalli, Konstantin Ananyev
On 20/12/2022 12:37, Kevin Traynor wrote:
> gcc 12.2.1 on Fedora 37 is giving stringop-overread and
> stringop-overflow warnings when compiled with --buildtype=debug
> e.g. [1].
>
> These are not yet fixed on main branch. They look similar
> to the overflow issues previously squashed in rte_memcpy with
> commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings")
>
> In order to ensure DPDK 21.11.3 compiles on Fedora 37, squash these
> warnings. If a subsequent cleaner fix becomes available on from main
> branch it can be backported to later DPDK 21.11 LTS release.
>
> [1]
> lib/ring/rte_ring_elem_pvt.h:100:25: error:
> ‘memcpy’ reading 32 bytes from a region of size 4
> [-Werror=stringop-overread]
> 100 | memcpy((void *)(ring + idx),
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 101 | (const void *)(obj + i), 32);
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> lib/ring/rte_ring_elem_pvt.h:234:25: error:
> ‘memcpy’ writing 32 bytes into a region of size 4 overflows the destination
> [-Werror=stringop-overflow=]
> 234 | memcpy((void *)(obj + i), (void *)(ring + idx), 32);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Signed-off-by: Kevin Traynor<ktraynor@redhat.com>
> ---
Pushed to 21.11 branch for 21.11.3. Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 21.11] ring: squash gcc 12.2.1 warnings
2022-12-20 12:37 [PATCH 21.11] ring: squash gcc 12.2.1 warnings Kevin Traynor
2022-12-20 17:18 ` Kevin Traynor
@ 2023-03-16 11:00 ` David Marchand
2023-03-16 14:08 ` Konstantin Ananyev
2023-03-16 15:52 ` David Marchand
1 sibling, 2 replies; 5+ messages in thread
From: David Marchand @ 2023-03-16 11:00 UTC (permalink / raw)
To: dev, Honnappa Nagarahalli, Konstantin Ananyev, Thomas Monjalon
Cc: stable, alialnu, Bruce Richardson, Luca Boccassi,
Xueming(Steven) Li, Patrick Robb, Kevin Traynor
On Tue, Dec 20, 2022 at 1:38 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>
> gcc 12.2.1 on Fedora 37 is giving stringop-overread and
> stringop-overflow warnings when compiled with --buildtype=debug
> e.g. [1].
>
> These are not yet fixed on main branch. They look similar
> to the overflow issues previously squashed in rte_memcpy with
> commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings")
>
> In order to ensure DPDK 21.11.3 compiles on Fedora 37, squash these
> warnings. If a subsequent cleaner fix becomes available on from main
> branch it can be backported to later DPDK 21.11 LTS release.
>
> [1]
> lib/ring/rte_ring_elem_pvt.h:100:25: error:
> ‘memcpy’ reading 32 bytes from a region of size 4
> [-Werror=stringop-overread]
> 100 | memcpy((void *)(ring + idx),
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 101 | (const void *)(obj + i), 32);
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> lib/ring/rte_ring_elem_pvt.h:234:25: error:
> ‘memcpy’ writing 32 bytes into a region of size 4 overflows the destination
> [-Werror=stringop-overflow=]
> 234 | memcpy((void *)(obj + i), (void *)(ring + idx), 32);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
As mentionned in this thread:
https://inbox.dpdk.org/dev/ZBLqF6c3ujMic45N@bricha3-MOBL.ger.corp.intel.com/T/#me1c8f06a9ca2cf2a4ed4a028d373a3e3ce5146d1
I intend to pull this change in the main repository and mark this
change for backports in other stable branches.
I'll do this for -rc3, expected tomorrow, unless someone objects.
--
David Marchand
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 21.11] ring: squash gcc 12.2.1 warnings
2023-03-16 11:00 ` David Marchand
@ 2023-03-16 14:08 ` Konstantin Ananyev
2023-03-16 15:52 ` David Marchand
1 sibling, 0 replies; 5+ messages in thread
From: Konstantin Ananyev @ 2023-03-16 14:08 UTC (permalink / raw)
To: David Marchand, dev, Honnappa Nagarahalli, Konstantin Ananyev,
Thomas Monjalon
Cc: stable, alialnu, Bruce Richardson, Luca Boccassi,
Xueming(Steven) Li, Patrick Robb, Kevin Traynor
>
> On Tue, Dec 20, 2022 at 1:38 PM Kevin Traynor <ktraynor@redhat.com> wrote:
> >
> > gcc 12.2.1 on Fedora 37 is giving stringop-overread and
> > stringop-overflow warnings when compiled with --buildtype=debug
> > e.g. [1].
> >
> > These are not yet fixed on main branch. They look similar
> > to the overflow issues previously squashed in rte_memcpy with
> > commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings")
> >
> > In order to ensure DPDK 21.11.3 compiles on Fedora 37, squash these
> > warnings. If a subsequent cleaner fix becomes available on from main
> > branch it can be backported to later DPDK 21.11 LTS release.
> >
> > [1]
> > lib/ring/rte_ring_elem_pvt.h:100:25: error:
> > ‘memcpy’ reading 32 bytes from a region of size 4
> > [-Werror=stringop-overread]
> > 100 | memcpy((void *)(ring + idx),
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 101 | (const void *)(obj + i), 32);
> > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > lib/ring/rte_ring_elem_pvt.h:234:25: error:
> > ‘memcpy’ writing 32 bytes into a region of size 4 overflows the destination
> > [-Werror=stringop-overflow=]
> > 234 | memcpy((void *)(obj + i), (void *)(ring + idx), 32);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
>
> As mentionned in this thread:
> https://inbox.dpdk.org/dev/ZBLqF6c3ujMic45N@bricha3-
> MOBL.ger.corp.intel.com/T/#me1c8f06a9ca2cf2a4ed4a028d373a3e3ce5146d1
> I intend to pull this change in the main repository and mark this
> change for backports in other stable branches.
>
> I'll do this for -rc3, expected tomorrow, unless someone objects.
No objections.
Thanks
Konstantin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 21.11] ring: squash gcc 12.2.1 warnings
2023-03-16 11:00 ` David Marchand
2023-03-16 14:08 ` Konstantin Ananyev
@ 2023-03-16 15:52 ` David Marchand
1 sibling, 0 replies; 5+ messages in thread
From: David Marchand @ 2023-03-16 15:52 UTC (permalink / raw)
To: dev, Honnappa Nagarahalli, Konstantin Ananyev, Thomas Monjalon
Cc: stable, alialnu, Bruce Richardson, Luca Boccassi,
Xueming(Steven) Li, Patrick Robb, Kevin Traynor
On Thu, Mar 16, 2023 at 12:00 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Tue, Dec 20, 2022 at 1:38 PM Kevin Traynor <ktraynor@redhat.com> wrote:
> >
> > gcc 12.2.1 on Fedora 37 is giving stringop-overread and
> > stringop-overflow warnings when compiled with --buildtype=debug
> > e.g. [1].
> >
> > These are not yet fixed on main branch. They look similar
> > to the overflow issues previously squashed in rte_memcpy with
> > commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings")
> >
> > In order to ensure DPDK 21.11.3 compiles on Fedora 37, squash these
> > warnings. If a subsequent cleaner fix becomes available on from main
> > branch it can be backported to later DPDK 21.11 LTS release.
> >
> > [1]
> > lib/ring/rte_ring_elem_pvt.h:100:25: error:
> > ‘memcpy’ reading 32 bytes from a region of size 4
> > [-Werror=stringop-overread]
> > 100 | memcpy((void *)(ring + idx),
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 101 | (const void *)(obj + i), 32);
> > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > lib/ring/rte_ring_elem_pvt.h:234:25: error:
> > ‘memcpy’ writing 32 bytes into a region of size 4 overflows the destination
> > [-Werror=stringop-overflow=]
> > 234 | memcpy((void *)(obj + i), (void *)(ring + idx), 32);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
I see Konstantin is ok with it and I think Honnappa is off for some days.
So I adjusted the commitlog for the main branch, and applied.
For the record, there is a bugzilla opened for this issue:
https://bugs.dpdk.org/show_bug.cgi?id=1062
--
David Marchand
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-03-16 15:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-20 12:37 [PATCH 21.11] ring: squash gcc 12.2.1 warnings Kevin Traynor
2022-12-20 17:18 ` Kevin Traynor
2023-03-16 11:00 ` David Marchand
2023-03-16 14:08 ` Konstantin Ananyev
2023-03-16 15:52 ` David Marchand
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).