From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: scott.k.mitch1@gmail.com, Aaron Conole <aconole@redhat.com>
Subject: [PATCH] ci: display UBSan stack trace
Date: Wed, 28 Jan 2026 12:04:38 +0100 [thread overview]
Message-ID: <20260128110438.3003192-1-david.marchand@redhat.com> (raw)
When UBSan raises an error, we get really few context.
Example, on a recently submitted patch:
RTE>>cksum_fuzz_autotest
../lib/net/rte_cksum.h:49:10: runtime error: load of misaligned address
0x0001816c2e81 for type 'const unaligned_uint16_t' (aka 'const
unsigned short'), which requires 2 byte alignment
0x0001816c2e81: note: pointer points here
00 00 00 00 70 f2 00 00 00 00 00 00 00 00 00 00 00 00 00
^
00 00 00 00 00 00 00 00 00 00 00 00 00
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
../lib/net/rte_cksum.h:49:10 in
Ask for the full stack.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
.ci/linux-build.sh | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 084d9642fc..091d239fae 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -7,7 +7,11 @@ if [ -z "${DEF_LIB:-}" ]; then
fi
# Builds are run as root in containers, no need for sudo
-[ "$(id -u)" != '0' ] || alias sudo=
+if [ "$(id -u)" = '0' ]; then
+ run_as_root=""
+else
+ run_as_root="sudo -E"
+fi
install_libabigail() {
version=$1
@@ -28,15 +32,15 @@ configure_coredump() {
# No point in configuring coredump without gdb
which gdb >/dev/null || return 0
ulimit -c unlimited
- sudo sysctl -w kernel.core_pattern=/tmp/dpdk-core.%e.%p
+ $run_as_root sysctl -w kernel.core_pattern=/tmp/dpdk-core.%e.%p
}
catch_coredump() {
ls /tmp/dpdk-core.*.* 2>/dev/null || return 0
for core in /tmp/dpdk-core.*.*; do
- binary=$(sudo readelf -n $core |grep $(pwd)/build/ 2>/dev/null |head -n1)
+ binary=$($run_as_root readelf -n $core |grep $(pwd)/build/ 2>/dev/null |head -n1)
[ -x $binary ] || binary=
- sudo gdb $binary -c $core \
+ $run_as_root gdb $binary -c $core \
-ex 'info threads' \
-ex 'thread apply all bt full' \
-ex 'quit'
@@ -53,9 +57,9 @@ catch_ubsan() {
check_traces() {
which babeltrace >/dev/null || return 0
- for file in $(sudo find $HOME -name metadata); do
- ! sudo babeltrace $(dirname $file) >/dev/null 2>&1 || continue
- sudo babeltrace $(dirname $file)
+ for file in $($run_as_root find $HOME -name metadata); do
+ ! $run_as_root babeltrace $(dirname $file) >/dev/null 2>&1 || continue
+ $run_as_root babeltrace $(dirname $file)
done
}
@@ -136,6 +140,7 @@ fi
if [ "$UBSAN" = "true" ]; then
sanitizer=${sanitizer:+$sanitizer,}undefined
+ export UBSAN_OPTIONS=print_stacktrace=1
if [ "$RUN_TESTS" = "true" ]; then
# UBSan takes too much memory with -O2
buildtype=plain
@@ -218,7 +223,8 @@ fi
if [ "$RUN_TESTS" = "true" ]; then
failed=
configure_coredump
- sudo meson test -C build --suite fast-tests -t 3 --no-stdsplit --print-errorlogs || failed="true"
+ $run_as_root meson test -C build --suite fast-tests -t 3 --no-stdsplit --print-errorlogs ||
+ failed="true"
catch_coredump
catch_ubsan DPDK:fast-tests build/meson-logs/testlog.txt
check_traces
--
2.52.0
next reply other threads:[~2026-01-28 11:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 11:04 David Marchand [this message]
2026-01-28 11:55 ` [PATCH] ci: display UBSan stack trace Marat Khalili
2026-01-28 14:57 ` David Marchand
2026-01-28 15:21 ` Marat Khalili
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=20260128110438.3003192-1-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=aconole@redhat.com \
--cc=dev@dpdk.org \
--cc=scott.k.mitch1@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox