Skip to content

Add support for the MINIDUMP_HANDLE_DATA_STREAM on Linux #92

@gabrielesvelto

Description

@gabrielesvelto

We'd like to record all the open file descriptors in a process. Windows minidumps populate the MINIDUMP_HANDLE_DATA_STREAM for this purpose and I'm adding support to rust-minidump for it, see rust-minidump/rust-minidump#885

The idea is to repurpose this stream to capture Linux fd information by storing the contents of /proc/<pid>/fd. Every entry in the stream would be a MINIDUMP_HANDLE_DESCRIPTOR with the following fields set:

  • handle would contain the fd number
  • object_name_rva would point to a string holding the file path
  • attributes would hold the contents of the st_mode field of the stat structure
  • All other fields would be zero

This would lose some information (e.g. number of hardlinks, UID/GID, etc...) but keep most of what interests us. In case we need it in the future we could extend this information with a custom MINIDUMP_HANDLE_OBJECT_INFORMATION structure that holds the missing bits (note that I'm reluctant to repurpose the other fields of MINIDUMP_HANDLE_DESCRIPTOR for these bits as IMHO it would be confusing).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions