From 4381dda7ec8705f7eacf5c1b34eaea861a72b3e6 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 2 Dec 2021 17:33:55 -0500 Subject: [PATCH] Fix: relayd: `!vsession->current_trace_chunk` assertion failed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Observed issue ============== When performing: #!/bin/bash lttng create py_syscalls --live lttng enable-event -u -a lttng enable-event -k -a lttng start babeltrace2 -i lttng-live net://localhost/host/raton/py_syscalls The relay daemon hits this assertion: Thread 8 (Thread 0x7fffeeffd700 (LWP 167040) "lttng-relayd"): #0 0x00007ffff7b1618b in raise () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007ffff7af5859 in abort () from /lib/x86_64-linux-gnu/libc.so.6 #2 0x00007ffff7af5729 in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #3 0x00007ffff7b06f36 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #4 0x00005555555889bb in viewer_session_attach (vsession=0x7fffdc001400, session=session@entry=0x7fffe8001180) at viewer-session.c:80 #5 0x000055555557bcff in viewer_attach_session (conn=0x7fffd0001140) at live.c:1275 #6 process_control (conn=0x7fffd0001140, recv_hdr=0x7fffeeffcaf0) at live.c:2341 #7 thread_worker (data=) at live.c:2515 #8 0x00007ffff7ccd609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #9 0x00007ffff7bf2293 in clone () from /lib/x86_64-linux-gnu/libc.so.6 Cause ===== This assert appears to be entirely wrong. It checks that the "viewer session" has a NULL current trace chunk when attaching a session to a viewer session, but in the case where a viewer session has multiple sessions (e.g. with kernel and ust tracing combined), we are attaching each session individually to the viewer session, and we set the current trace chunk of the viewer session when we attach the first session to it. So it is expected to be non-NULL when attaching the second session. Solution ======== Remove the assertion. Known limitations ================= None. Fixes: #1335 Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau Change-Id: I4d8f5d5347b4588144ddf449976cae5a94b81b3a --- src/bin/lttng-relayd/viewer-session.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/bin/lttng-relayd/viewer-session.cpp b/src/bin/lttng-relayd/viewer-session.cpp index 9bed097ab..ac14dbff0 100644 --- a/src/bin/lttng-relayd/viewer-session.cpp +++ b/src/bin/lttng-relayd/viewer-session.cpp @@ -77,7 +77,6 @@ enum lttng_viewer_attach_return_code viewer_session_attach( } else { int ret; - LTTNG_ASSERT(!vsession->current_trace_chunk); session->viewer_attached = true; ret = viewer_session_set_trace_chunk_copy(vsession, -- 2.34.1