Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions userspace/libsinsp/parsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,17 @@ void sinsp_parser::parse_clone_exit_child(sinsp_evt &evt, sinsp_parser_verdict &
*/
int64_t lookup_tid;

bool is_actually_new_process = (child_tinfo->m_pid == child_tinfo->m_tid);
bool is_thread_leader = !(child_tinfo->m_flags & PPM_CL_CLONE_THREAD);

if(is_thread_leader && !is_actually_new_process) {
/* When a thread is detected but missing the CLONE_FILES flag,
* force the flag to ensure proper FD table sharing between threads.
*/
is_thread_leader = false;
child_tinfo->m_flags |= PPM_CL_CLONE_THREAD;
}

if(is_thread_leader) {
/* We need to copy data from the parent */
lookup_tid = child_tinfo->m_ptid;
Expand Down
Loading