Bug ID 1728
Summary Segmentation fault in dpdk-test-compress-perf with compress_zlib vdev on Ubuntu 24.04 with GCC 14.2 and kernel 6.8.0
Product DPDK
Version 24.11
Hardware All
OS Linux
Status UNCONFIRMED
Severity critical
Priority Normal
Component DTS
Assignee dev@dpdk.org
Reporter Bala.MuraliKrishna@amd.com
CC juraj.linkes@pantheon.tech, probb@iol.unh.edu
Target Milestone ---

Running dpdk-test-compress-perf with compress_zlib2 virtual device and a
specific set of compression parameters causes a segmentation fault in
main_loop() at comp_perf_test_cyclecount.c:384.


Steps to Reproduce:
Environment:
OS: Ubuntu 24.04 (VERSION_ID="24.04")
Kernel: 6.8.0-60-generic
GCC: 14.2.0
DPDK: 24.11.2

run the below command line

sudo   build/app/dpdk-test-compress-perf --file-prefix=compress -l 3,4-7 
--vdev=compress_zlib2 --no-pci -v   --socket-mem 0 -- --ptest pmd-cyclecount 
--driver-name compress_zlib --input-file /home/amd/dpdk/test.img
--extended-input-sz 1048576 --seg-sz 59460 --burst-sz 32 --pool-sz 8192
--max-num-sgl-segs 1 --num-iter 2 --operation comp_and_decomp --algo deflate
--huffman-enc fixed --lz4-flags 01 --compress-level 1:1:9 --window-sz 15
--cc-delay-us 500

amd@automation-vm6:~/dpdk/dpdk-stable-24.11.2$ sudo  gdb --args 
build/app/dpdk-test-compress-perf --file-prefix=compress -l 3,4
--vdev=compress_zlib2 --no-pci -v   --socket-mem 0 -- --ptest pmd-cyclecount 
--driver-name compress_zlib --input-file /home/amd/dpdk/test.img
--extended-input-sz 1048576 --seg-sz 59460 --burst-sz 32 --pool-sz 8192
--max-num-sgl-segs 1 --num-iter 2 --operation comp_and_decomp --algo deflate
--huffman-enc fixed --lz4-flags 01 --compress-level 1:1:9 --window-sz 15
--cc-delay-us 500
[sudo] password for amd:
GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from build/app/dpdk-test-compress-perf...
(gdb) r
Starting program:
/home/amd/dpdk/dpdk-stable-24.11.2/build/app/dpdk-test-compress-perf
--file-prefix=compress -l 3,4 --vdev=compress_zlib2 --no-pci -v --socket-mem 0
-- --ptest pmd-cyclecount --driver-name compress_zlib --input-file
/home/amd/dpdk/test.img --extended-input-sz 1048576 --seg-sz 59460 --burst-sz
32 --pool-sz 8192 --max-num-sgl-segs 1 --num-iter 2 --operation comp_and_decomp
--algo deflate --huffman-enc fixed --lz4-flags 01 --compress-level 1:1:9
--window-sz 15 --cc-delay-us 500
warning: could not find '.gnu_debugaltlink' file for
/lib/x86_64-linux-gnu/libmlx5.so.1
warning: could not find '.gnu_debugaltlink' file for
/lib/x86_64-linux-gnu/libmana.so.1
warning: could not find '.gnu_debugaltlink' file for
/lib/x86_64-linux-gnu/libmlx4.so.1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
warning: could not find '.gnu_debugaltlink' file for
/lib/x86_64-linux-gnu/libcap.so.2
EAL: Detected CPU lcores: 8
EAL: Detected NUMA nodes: 1
EAL: RTE Version: 'DPDK 24.11.2'
EAL: Detected static linkage of DPDK
[New Thread 0x7ffff71d8400 (LWP 1042586)]
EAL: Multi-process socket /var/run/dpdk/compress/mp_socket
[New Thread 0x7ffff69d7400 (LWP 1042587)]
EAL: Selected IOVA mode 'PA'
[New Thread 0x7ffff51d5400 (LWP 1042588)]
[New Thread 0x7ffff49d4400 (LWP 1042589)]
USER1: 1048576 bytes read from file /home/amd/dpdk/test.img
App uses socket: 0
Burst size = 32
Input data size = 1048576
Cycle-count delay = 500 [us]

For the current input parameters (segment size = 59460, maximum segments per
SGL = 1):
        * Total number of buffers: 18
        * 17 buffer(s) 59460 bytes long, last buffer 65406 byte(s) long
        * Number of ops: 18
        * Total memory allocation: 1076226
        * 17 ops: 1 segment(s) in each, segment size 59460
        * 1 op (the last one): 1 segment 65406 byte(s) long


    lcore: 4, driver name: compress_zlib, device name: compress_zlib2, device
id: 0, socket id: 0, queue pair id: 0

Thread 4 "dpdk-worker4" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff51d5400 (LWP 1042588)]
0x000000000053f182 in main_loop (ctx=0x1002f92c0, type=RTE_COMP_COMPRESS) at
../app/test-compress-perf/comp_perf_test_cyclecount.c:384
384                                                     m->data_len =
data_to_append;
(gdb) p data_to_append
$1 = 53534
(gdb) p m->data_len
Cannot access memory at address 0x28
(gdb)


Analysis:
The crash occurs while accessing m->data_len, indicating that the m pointer (a
rte_mbuf*) is NULL or invalid.

Root cause appears to be a failure in allocation or initialization of the
rte_mbuf object before dereferencing.

The issue is reproducible consistently with the parameters provided.

As a temporary workaround, adding a NULL check on the m pointer bypasses the
crash, but it does not solve the underlying buffer allocation/management issue.
          


You are receiving this mail because: