diff mbox series

[2/2] lttng-tools: fix unix socket high FD count test

Message ID 20250823200405.680409-2-raj.khem@gmail.com
State New
Headers show
Series [1/2] libseccomp: fix seccomp_export_bpf_mem out-of-bounds read | expand

Commit Message

Khem Raj Aug. 23, 2025, 8:04 p.m. UTC
Fixes ptest failure on musl

                'ERROR: Exited from signal Killed (9)\n'
                'DURATION: 663\n'}

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../lttng/lttng-tools/test.patch              | 22 +++++++++++++++++++
 .../lttng/lttng-tools_2.14.0.bb               |  1 +
 2 files changed, 23 insertions(+)
 create mode 100644 meta/recipes-kernel/lttng/lttng-tools/test.patch
diff mbox series

Patch

diff --git a/meta/recipes-kernel/lttng/lttng-tools/test.patch b/meta/recipes-kernel/lttng/lttng-tools/test.patch
new file mode 100644
index 00000000000..99d99369637
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/test.patch
@@ -0,0 +1,22 @@ 
+tests: fix unix socket high FD count test off-by-one
+
+The HIGH_FD_COUNT macro in test_unix_socket.cpp was set equal to
+LTTCOMM_MAX_SEND_FDS, which could cause the test to exceed the
+maximum allowed number of file descriptors. Adjust it to
+LTTCOMM_MAX_SEND_FDS - 1 to avoid hitting the limit and ensure the
+test remains valid.
+
+Upstream-Status: Inappropriate [Musl-specific]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/tests/unit/test_unix_socket.cpp
++++ b/tests/unit/test_unix_socket.cpp
+@@ -25,7 +25,7 @@
+ #include <tap/tap.h>
+ #include <unistd.h>
+ 
+-#define HIGH_FD_COUNT		LTTCOMM_MAX_SEND_FDS
++#define HIGH_FD_COUNT		LTTCOMM_MAX_SEND_FDS - 1
+ #define MESSAGE_COUNT		4
+ #define LARGE_PAYLOAD_SIZE	(4 * 1024)
+ #define LARGE_PAYLOAD_RECV_SIZE 100
diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb b/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb
index 49575ef57cd..6f3fba1d735 100644
--- a/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb
+++ b/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb
@@ -54,6 +54,7 @@  SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
            file://disable-tests2.patch \
            file://0001-liblttng-ctl-drop-index-allocator-symbols-from-versi.patch \
            file://libc++.patch \
+           file://test.patch \
            "
 
 SRC_URI[sha256sum] = "d8c39c26cec13b7bd82551cd52a22efc358b888e36ebcf9c1b60ef1c3a3c2fd3"