Hooks for loading external debug symbols (especially during panics)

Open
#719 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
rust
Domain
devtools

Research direction

Start with src/symbolize/gimli.rs around the linked open and mmap logic, then read the linked internals forum discussion for context. Define the hook's scope and API for controlling external debug-symbol retrieval, including sandboxed or remote-symbol deployments; done means the design is agreed and covered by appropriate tests.

Written by the indexing model from the issue text.

Description

enhancement

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?

Dominant language
Rust
Stars
628
Forks
291
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-lang/backtrace-rs

All issues in rust-lang/backtrace-rs

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.