rust-lang / rust-lang/rust

Backtrace capture on SGX broken after (including) nightly-2023-11-20

Open
#119,806 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug O-SGX P-medium regression-untriaged T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

It looks like that after #117895 (that seems to be the only SGX backtrace-related change between the two versions) enabling backtraces and attempting to capture one on the x86_64-fortanix-unknown-sgx target (sometimes) results in the enclave hanging.

Code

Unfortunately I don't currently have a minimal reproducer example, but roughly:

std::env::set_var("RUST_BACKTRACE", "1");
// ... unspecified logic, multiple nested frames ...
std::backtrace::Backtrace::capture();

I expected to see this happen: backtrace is captured without issues.

Instead, this happened: the Backtrace::capture() method appears to hang.

Version it worked on

It most recently worked on: nightly-2023-11-19

Version with regression

nightly-2023-11-20

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 comparing nightly-2023-11-19 and nightly-2023-11-20 for the x86_64-fortanix-unknown-sgx target, focusing on the SGX backtrace-related change in #117895. Reproduce with RUST_BACKTRACE=1 and std::backtrace::Backtrace::capture() in a nested call context; done means capture no longer hangs and the regression is covered by a focused test or reproducer.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.