Skip to content

trex ASTF LeakSanitizer detects several leaks with clang 14.0.6 #1169

@pespin

Description

@pespin

trex-core.git 10e1d19 built with:

CC=clang  CXX=clang++ ./b configure --sanitized
CC=clang  CXX=clang++ ./b build

I had to apply this patch to get clang to compile with "--sanitized" (see #1170):

commit 13910f89b213c164f8a85299cbc7ea4a132b771c
Author: Pau Espin Pedrol <[email protected]>
Date:   Fri Mar 28 17:50:24 2025 +0100

    ws_main.py: Make --sanitized work with clang

    While compiling iwht "./confgiure sanitized":
    clang: error: unknown argument '-static-libasan'; did you mean '-static-libsan'?

diff --git a/linux/ws_main.py b/linux/ws_main.py
index 08b67d56f..51fac8fad 100755
--- a/linux/ws_main.py
+++ b/linux/ws_main.py
@@ -735,7 +735,7 @@ class build_option:
             base_flags += [
                 '-fsanitize=address',
                 '-fsanitize=leak',
-                '-static-libasan',
+                '-static-libsan',
             ]

         return base_flags;
diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py
index 4d7b62b30..988216703 100644
--- a/linux_dpdk/ws_main.py
+++ b/linux_dpdk/ws_main.py
@@ -2537,7 +2537,7 @@ class build_option:
             base_flags += [
                 '-fsanitize=address',
                 '-fsanitize=leak',
-                '-static-libasan',
+                '-static-libsan',
             ]
         return base_flags

Running Trex with: sudo /opt/trex/t-rex-64 -i --astf --software --tso-disable --no-scapy-server --cfg "${SCRIPT_DIR}/trex_cfg.yaml" --no-ofed-check

I attach here LeakSanitizer output in a txt file.

trex_leak_sanitizer_report.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions