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

Comments

Alexander Kanavin Aug. 24, 2025, 3:23 p.m. UTC | #1
On Sat, 23 Aug 2025 at 22:04, Khem Raj via lists.openembedded.org
<raj.khem=gmail.com@lists.openembedded.org> wrote:
> +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]

This needs an upstream ticket.

Alex
Ross Burton Sept. 4, 2025, 12:11 p.m. UTC | #2
On 23 Aug 2025, at 21:04, Khem Raj via lists.openembedded.org <raj.khem=gmail.com@lists.openembedded.org> wrote:
> +tests: fix unix socket high FD count test off-by-one

Is this an off-by-one in the test suite (in which case it should be upstreamed), in musl, or in glibc?

Someone has a bug and we should endeavour to fix it at source.

Ross
Khem Raj Sept. 4, 2025, 5:44 p.m. UTC | #3
On Thu, Sep 4, 2025 at 5:11 AM Ross Burton <Ross.Burton@arm.com> wrote:
>
> On 23 Aug 2025, at 21:04, Khem Raj via lists.openembedded.org <raj.khem=gmail.com@lists.openembedded.org> wrote:
> > +tests: fix unix socket high FD count test off-by-one
>
> Is this an off-by-one in the test suite (in which case it should be upstreamed), in musl, or in glibc?
>

I saw it on musl and this machine was running a lot of parallel tests,
but it's not happening all the time. It's fine to drop this patch

> Someone has a bug and we should endeavour to fix it at source.
>
> Ross
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"