diff --git a/userspace/libsinsp/threadinfo.h b/userspace/libsinsp/threadinfo.h index 4da7e655ad..47fd5d46a1 100644 --- a/userspace/libsinsp/threadinfo.h +++ b/userspace/libsinsp/threadinfo.h @@ -198,7 +198,8 @@ class SINSP_PUBLIC sinsp_threadinfo : public libsinsp::state::table_entry */ inline bool is_in_pid_namespace() const { - return (m_flags & PPM_CL_CHILD_IN_PIDNS || m_tid != m_vtid); + // m_tid should be always valid because we read it from the scap event header + return (m_flags & PPM_CL_CHILD_IN_PIDNS || (m_tid != m_vtid && m_vtid >= 0)); } /*!