Skip to content

Consider using findshlibs to find mappings #15

Open
@umanwizard

Description

@umanwizard

There is a crate findshlibs which does 99% the same thing as our machinery for getting the list of shared objects on Linux, except that it has cross-platform support.

This can be an avenue for quickly spinning up macOS/Windows support. However, we might need to fix a few things about this library before using it (and thus possibly depend on a fork, rather than on the upstream gimli-rs repo, until they are willing to merge our changes).

  1. It doesn't provide a way to get the file offset of a mapping, even on platforms that support it. I'm not sure if this is actually important; pprof seems to work fine if we just fill in 0 for the file offset of a mapping
  2. We need to land fix: add missing wrapping_add gimli-rs/findshlibs#81 as this will cause panics in debug mode on certain versions of Linux otherwise (see the comment here).
  3. In various places that library assumes that u64 can be cast to usize, see e.g. here . We need to either carefully audit every case of this and ensure that it is valid even on 32-bit platforms, or (my preference) ban as from the codebase and use properly checked conversions.

Alternatively, we can decide not to use this library, and just write the Windows/macOS support by hand, as we already did for Linux.

Tagging @roblabla who has expressed interest in working on Windows support.

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