Skip to contentSkip to conversation

test_stack_perf fails to build with GCC 13 due to memcpy overread/overflow warning

DPDK/core Bug 2061 [email protected] 1 participant 2 messages Oct 19 – Nov 2

lore
Share & tools
lore
#0 lore raw

https://bugs.dpdk.org/show_bug.cgi?id=2061

Bug ID: 2061
Summary: [Debug][aarch64] test_stack_perf fails to build with
GCC 13 due to memcpy overread/overflow warning
Product: DPDK
Version: 26.11
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: core
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---

$ meson --werror --buildtype=debug build && ninja -C build

[..]
[3428/3451] Compiling C object app/dpdk-test.p/test_test_tailq.c.o [3429/3451] Compiling C object app/dpdk-test.p/test_test_security_inline_macsec.c.o [3430/3451] Compiling C object app/dpdk-test.p/test_test_stack_perf.c.o
FAILED: app/dpdk-test.p/test_test_stack_perf.c.o
[..]
In file included from ../../root/dpdk/lib/eal/arm/include/rte_memcpy.h:9,

                 from ../../root/dpdk/lib/stack/rte_stack_pile.h:8,
                 from ../../root/dpdk/lib/stack/rte_stack.h:152,
                 from ../../root/dpdk/app/test/test_stack_perf.c:12:

In function '__rte_stack_pile_push',
inlined from 'rte_stack_push' at
../../root/dpdk/lib/stack/rte_stack.h:179:10,
inlined from 'test_single_push_pop' at
../../root/dpdk/app/test/test_stack_perf.c:261:3:
../../root/dpdk/lib/eal/arm/include/rte_memcpy_64.h:365:33: error: 'memcpy' reading 256 bytes from a region of size 8 [-Werror=stringop-overread]

  365 | #define rte_memcpy(d, s, n)     memcpy((d), (s), (n))
      |                                 ^~~~~~~~~~~~~~~~~~~~~

../../root/dpdk/lib/stack/rte_stack_pile.h:160:17: note: in expansion of macro 'rte_memcpy'
160 | rte_memcpy(((struct rte_stack_pile_bulk_elem
*)tmp)->objs,

      |                 ^~~~~~~~~~

../../root/dpdk/app/test/test_stack_perf.c: In function 'test_single_push_pop':
../../root/dpdk/app/test/test_stack_perf.c:255:15: note: source object 'obj' of size 8
255 | void *obj = NULL;
| ^~~
In function '__rte_stack_pile_bulk_pop_elems',
inlined from '__rte_stack_pile_pop' at
../../root/dpdk/lib/stack/rte_stack_pile.h:274:15,
inlined from 'rte_stack_pop' at
../../root/dpdk/lib/stack/rte_stack.h:205:10,
inlined from 'test_single_push_pop' at
../../root/dpdk/app/test/test_stack_perf.c:262:3:
../../root/dpdk/lib/eal/arm/include/rte_memcpy_64.h:365:33: error: 'memcpy' writing 256 bytes into a region of size 8 overflows the destination [-Werror=stringop-overflow=]

  365 | #define rte_memcpy(d, s, n)     memcpy((d), (s), (n))
      |                                 ^~~~~~~~~~~~~~~~~~~~~

../../root/dpdk/lib/stack/rte_stack_pile.h:75:25: note: in expansion of macro 'rte_memcpy'
75 | rte_memcpy(&obj_table[i *
RTE_STACK_PILE_BULK_SIZE],

      |                         ^~~~~~~~~~

../../root/dpdk/app/test/test_stack_perf.c: In function 'test_single_push_pop':
../../root/dpdk/app/test/test_stack_perf.c:255:15: note: destination object 'obj' of size 8
255 | void *obj = NULL;
| ^~~
cc1: all warnings being treated as errors
[..]
ninja: build stopped: subcommand failed.

git-bisect points to ee0822a0ef41 ("stack: introduce pile")

Meson: 1.3.2
OS: Ubuntu 24.04.4 LTS
Compiler: gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.
#1 lore raw

https://bugs.dpdk.org/show_bug.cgi?id=2061

David Marchand ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|---                         |FIXED
                 CC|                            |[email protected]
             Status|IN_PROGRESS                 |RESOLVED

--- Comment #4 from David Marchand ([email protected]) --- Fixed in commit 812a18c167f4 ("build: disable GCC string op warnings when unoptimized").

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.