Skip to content

Hooks for loading external debug symbols (especially during panics) #719

@kornelski

Description

@kornelski

I've posted this question in the internals forum, but I'm opening an issue here to help you track it directly.


backtrace-rs may try to load debug symbols from an external file, which is usually very nice, but it causes problems in more complex deployments:

  • It tries to open and mmap the files, which doesn't work when the program is sandboxed. I can make the sandboxed program ask for the right file, but I can't just make open work. For example, seccomp can't deny/allow access based on paths, but can allow pre-opening a file descriptor before denying all other filesystem access. It also means that I need to configure seccomp to be softer and gracefully deny access with EPERM rather than kill the process immediately when it tries to call open, as otherwise panics would get the process killed before it had a chance to print the backtrace.

  • The debug symbols can be large. I have servers that intentionally don't have any local disks, and only run off a RAM-based filesystem, but this means that disk space is precious. Keeping debug symbol files on disk just in case a server panics is wasteful. I have a debug symbol server which allows fetching symbols on demand over HTTP, so I'd prefer to fetch them lazily.

Would it be possible to add some sort of hook to give control over obtaining of the debug symbols?

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