segfault in async state drop glue: `Arc` field dropped while zeroed
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start from the async-state lowering code that generates drop glue for a future's state, particularly how drop flags and field offsets are assigned for fields holding guards across an .await. The fault is in Arc::drop at arc.rs:287 with a null pointer, so confirm why an Arc field is considered initialized when the future is dropped before it was written. There is no standalone reproduction yet: ask the reporter for relax inspect or flight-recorder output and try to reduce the tokio timeout + guard-across-await shape. Done means a reduced reproducer and drop glue that skips uninitialized fields.
Written by the indexing model from the issue text.
Description
On Relax 953d174a (macOS arm64), dropping an async future segfaults. The same test passes under rustc 1.100.
Observed
A private application's async integration test (tokio multi-thread; a tokio::time::timeout around an async method) segfaults deterministically about 4.8 s in; rustc runs the same test in 0.06 s.
Sanitized top frames:
glue0<Arc<T>> std/core/sync/arc.rs:287:28 (O2 warm-cache, v1 of 1)
glue0<closure#...> (drop glue of the async fn's state)
{closure}@<app> (polls the tokio::time::timeout future)
The fault address is 0xfffffffffffffff0 (a second run: 0xfffffffffffffff2). Arc::drop at arc.rs:287 computes header_of(self.ptr); a null self.ptr yields exactly -size_of::<ArcInner>(), so the Arc field being dropped was zeroed rather than dangling.
Shape
The async fn holds a temporary guard across an .await; the guard owns an Arc:
let v = self.acquire()?.wait().await;
acquire() returns Result<Guard> (the guard owns an Arc clone), and the future is driven by tokio::time::timeout and dropped when it fires.
Reproducing
I have not reduced it to a standalone program yet. Simple async + Arc + timeout shapes do not reproduce:
- guard temporary across
.await, cancelled while pending; - the same, completing within the timeout;
Arclocal across.await, cancelled and completed;yield_nowand shortsleepvariants.
The application is private, so I cannot attach it. I can run diagnostics (relax inspect, flight recorder) or try candidate fixes on request.
Suspect
Looks like async state lowering's drop flag / field offset: the drop glue runs on an Arc field that was never initialized (null, not dangling).
- Dominant language
- Rust
- Stars
- 601
- Forks
- 34
- Avg merge
- 1h 58m
- Merged PRs (30d)
- 45
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from makepad/relax
-
std: `SliceIndex<str>` missing for `std::ops` ranges, so generic `R: SliceIndex<str>` bounds failOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 18/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 18/100
Maintainers usually reply within 1 day
-
Relax live tests rerun the whole suite after a one-line body editMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 32/100
Maintainers usually reply within 1 day
Similar issues
-
CI/CD ignore-for-release
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
eclipse-ankaios/ankaios#844 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
symposium-dev/symposium#530 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
topgrade-rs/topgrade#2540 ·
Maintainers usually reply within 1 day