From 33368edc39bdecb0e45b52d8f7ce50d69fffd639 Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Wed, 22 Jun 2022 12:31:16 +0200 Subject: [PATCH 1/2] fix(gvisor): initialize missing variables Signed-off-by: Mauro Ezequiel Moltrasio --- userspace/libsinsp/sinsp.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/userspace/libsinsp/sinsp.cpp b/userspace/libsinsp/sinsp.cpp index 2ddb9b22ff..ff95baef6c 100644 --- a/userspace/libsinsp/sinsp.cpp +++ b/userspace/libsinsp/sinsp.cpp @@ -532,6 +532,11 @@ void sinsp::open_live_common(uint32_t timeout_ms, scap_mode_t mode) oargs.gvisor_socket = m_gvisor_socket.c_str(); oargs.gvisor_root_path = m_gvisor_root_path.c_str(); oargs.gvisor_trace_session_path = m_gvisor_trace_session_path.c_str(); + } else { + oargs.gvisor = false; + oargs.gvisor_socket = NULL; + oargs.gvisor_root_path = NULL; + oargs.gvisor_trace_session_path = NULL; } fill_syscalls_of_interest(&oargs); From eca1223b1363eb879baecb4873fbf33b89ef137f Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Wed, 22 Jun 2022 14:15:48 +0200 Subject: [PATCH 2/2] fix(gvisor): simplify flag initialization Co-authored-by: Luca Guerra Signed-off-by: Mauro Ezequiel Moltrasio --- userspace/libsinsp/sinsp.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/userspace/libsinsp/sinsp.cpp b/userspace/libsinsp/sinsp.cpp index ff95baef6c..5bb1a4f2cc 100644 --- a/userspace/libsinsp/sinsp.cpp +++ b/userspace/libsinsp/sinsp.cpp @@ -526,14 +526,13 @@ void sinsp::open_live_common(uint32_t timeout_ms, scap_mode_t mode) oargs.proc_callback = NULL; oargs.proc_callback_context = NULL; oargs.udig = m_udig; + oargs.gvisor = m_gvisor; if (m_gvisor) { - oargs.gvisor = true; oargs.gvisor_socket = m_gvisor_socket.c_str(); oargs.gvisor_root_path = m_gvisor_root_path.c_str(); oargs.gvisor_trace_session_path = m_gvisor_trace_session_path.c_str(); } else { - oargs.gvisor = false; oargs.gvisor_socket = NULL; oargs.gvisor_root_path = NULL; oargs.gvisor_trace_session_path = NULL;