oxidecomputer / oxidecomputer/hubris

Max Stack Analysis does not account for functions missing `.stack_sizes` info

Open
#2,596 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

robustness
Dominant language
Rust
Stars
3.6k
Forks
239
Avg merge
1d 12h
Merged PRs (30d)
23

Description

The current max-stack code does not account for functions that do not have .stack_sizes metadata provided by LLVM. This includes inline assembly (like system calls), statically linked libraries (like from salty), or compiler-builtins (like memcpy).

I've written a hacky pass to the stack analysis to calculate this: https://github.com/oxidecomputer/hubris/compare/b702011f358a5ddfdfca3a2bd25feb1528deb71c.../james/calculate-stack. If this analysis appears to be sufficient enough, we could potentially remove our dependency on the unstable -Z flags required to make rustc/llvm emit the .stack_sizes section.

CC #2588

Contributor guide

Open the contributing guide

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.

Research direction

Start by reading the current max-stack analysis and comparing it with the linked calculate-stack pass. Trace how functions without LLVM .stack_sizes metadata are handled, including inline assembly, statically linked libraries, and compiler-builtins. Done means the analysis accounts for those functions and confirms whether the unstable Rust flags can be removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, embedded-iot, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.