Bug #1245
closedfile descriptor statedump should iterate over all processes/threads, not just processes
100%
Description
If we look at the output of lsof, we observe that it prints file descriptors for all processes/threads, not just processes.
Currently the LTTng-modules statedump simply iterates over all processes in the system and assumes all threads share the same file descriptor table, which is only true if threads were created with clone CLONE_FILES.
Directly invoking clone without the CLONE_FILES creates threads which belong to the same process, but have their own file descriptor table.
Therefore, model-wise, we cannot assume that all threads in a process have the same fd table content.
Fixing this would involve changing the statedump to iterate on all processes/threads, and dump the fd tables for each tid.
Updated by Mathieu Desnoyers almost 5 years ago
In order to "known" whether fd tables are shared or not across threads, the analysis can use the clone CLONE_FILES flags for newly created threads. However, for pre-existing threads, it is not straightforward.
We would need to dump the address of p->files (pointer to the thread's struct files_struct) into the trace to allow figuring out if the fd tables are shared or not.
Updated by Mathieu Desnoyers almost 5 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset lttng-modules|e7a0ca7205fd4be7c829d171baa8823fe4784c90.