From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [DPDK/core Bug 1878] format-truncation warnings in eal_memalloc compiling find_numasocket and secondary_msl_create_walk
Date: Thu, 05 Feb 2026 14:03:36 +0000 [thread overview]
Message-ID: <bug-1878-3@http.bugs.dpdk.org/> (raw)
http://bugs.dpdk.org/show_bug.cgi?id=1878
Bug ID: 1878
Summary: format-truncation warnings in eal_memalloc compiling
find_numasocket and secondary_msl_create_walk
Product: DPDK
Version: 26.03
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: core
Assignee: dev@dpdk.org
Reporter: marat.khalili@huawei.com
CC: stephen@networkplumber.org
Target Milestone: ---
When configured with:
```bash
CC=gcc-13 meson setup --werror
'-Ddisable_drivers=gpu/*,net/bnx2x,net/cnxk,net/qede' -Denable_docs=false
-Dbuildtype=debug -Db_sanitize=address,undefined -Ddeveloper_mode=enabled
-Dc_args=-DRTE_ENABLE_ASSERT
```
the following warnings are produced during compilation of branch main
(de2604d55cb7098a941db696248c4d4d00abff43):
```
FAILED: lib/librte_eal.a.p/eal_linux_eal_memory.c.o
gcc-13 -Ilib/librte_eal.a.p -Ilib -I../../src/lib -Ilib/eal/common
-I../../src/lib/eal/common -I. -I../../src -Iconfig -I../../src/config
-Ilib/eal/include -I../../src/lib/eal/include -Ilib/eal/linux/include
-I../../src/lib/eal/linux/include -Ilib/eal/x86/include
-I../../src/lib/eal/x86/include -I../../src/kernel/linux -Ilib/eal
-I../../src/lib/eal -Ilib/kvargs -I../../src/lib/kvargs -Ilib/log
-I../../src/lib/log -Ilib/metrics -I../../src/lib/metrics -Ilib/telemetry
-I../../src/lib/telemetry -Ilib/argparse -I../../src/lib/argparse
-fdiagnostics-color=always -fsanitize=address,undefined -fno-omit-frame-pointer
-D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O0 -g
-include rte_config.h -Wvla -Wcast-qual -Wdeprecated -Wformat
-Wformat-nonliteral -Wformat-security -Wmissing-declarations
-Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith
-Wshadow -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings
-Wno-packed-not-aligned -Wno-missing-field-initializers -D_GNU_SOURCE
-DRTE_ENABLE_ASSERT -fPIC -march=native -mrtm -DALLOW_EXPERIMENTAL_API
-DALLOW_INTERNAL_API '-DABI_VERSION="26.1"'
-DRTE_EAL_PTHREAD_ATTR_SETAFFINITY_NP -DRTE_LOG_DEFAULT_LOGTYPE=lib.eal -MD -MQ
lib/librte_eal.a.p/eal_linux_eal_memory.c.o -MF
lib/librte_eal.a.p/eal_linux_eal_memory.c.o.d -o
lib/librte_eal.a.p/eal_linux_eal_memory.c.o -c
../../src/lib/eal/linux/eal_memory.c
../../src/lib/eal/linux/eal_memory.c: In function 'find_numasocket':
../../src/lib/eal/linux/eal_memory.c:450:31: error: 'snprintf' output may be
truncated before the last format character [-Werror=format-truncation=]
450 | "%s/%s", hpi->hugedir,
eal_get_hugefile_prefix());
| ^
../../src/lib/eal/linux/eal_memory.c:449:9: note: 'snprintf' output 2 or more
bytes (assuming 4097) into a destination of size 4096
449 | snprintf(hugedir_str, sizeof(hugedir_str),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
450 | "%s/%s", hpi->hugedir,
eal_get_hugefile_prefix());
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
and
```
FAILED: lib/librte_eal.a.p/eal_linux_eal_memalloc.c.o
gcc-13 -Ilib/librte_eal.a.p -Ilib -I../../src/lib -Ilib/eal/common
-I../../src/lib/eal/common -I. -I../../src -Iconfig -I../../src/config
-Ilib/eal/include -I../../src/lib/eal/include -Ilib/eal/linux/include
-I../../src/lib/eal/linux/include -Ilib/eal/x86/include
-I../../src/lib/eal/x86/include -I../../src/kernel/linux -Ilib/eal
-I../../src/lib/eal -Ilib/kvargs -I../../src/lib/kvargs -Ilib/log
-I../../src/lib/log -Ilib/metrics -I../../src/lib/metrics -Ilib/telemetry
-I../../src/lib/telemetry -Ilib/argparse -I../../src/lib/argparse
-fdiagnostics-color=always -fsanitize=address,undefined -fno-omit-frame-pointer
-D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O0 -g
-include rte_config.h -Wvla -Wcast-qual -Wdeprecated -Wformat
-Wformat-nonliteral -Wformat-security -Wmissing-declarations
-Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith
-Wshadow -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings
-Wno-packed-not-aligned -Wno-missing-field-initializers -D_GNU_SOURCE
-DRTE_ENABLE_ASSERT -fPIC -march=native -mrtm -DALLOW_EXPERIMENTAL_API
-DALLOW_INTERNAL_API '-DABI_VERSION="26.1"'
-DRTE_EAL_PTHREAD_ATTR_SETAFFINITY_NP -DRTE_LOG_DEFAULT_LOGTYPE=lib.eal -MD -MQ
lib/librte_eal.a.p/eal_linux_eal_memalloc.c.o -MF
lib/librte_eal.a.p/eal_linux_eal_memalloc.c.o.d -o
lib/librte_eal.a.p/eal_linux_eal_memalloc.c.o -c
../../src/lib/eal/linux/eal_memalloc.c
../../src/lib/eal/linux/eal_memalloc.c: In function
'secondary_msl_create_walk':
../../src/lib/eal/linux/eal_memalloc.c:1401:50: error: '%i' directive output
may be truncated writing between 1 and 11 bytes into a region of size between 0
and 63 [-Werror=format-truncation=]
1401 | snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i",
| ^~
../../src/lib/eal/linux/eal_memalloc.c:1401:9: note: 'snprintf' output between
3 and 76 bytes into a destination of size 64
1401 | snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1402 | primary_msl->memseg_arr.name, getpid());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
--
You are receiving this mail because:
You are the assignee for the bug.
reply other threads:[~2026-02-05 14:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-1878-3@http.bugs.dpdk.org/ \
--to=bugzilla@dpdk.org \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.