segfault in async state drop glue: `Arc` field dropped while zeroed
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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).
- Lenguaje dominante
- Rust
- Estrellas
- 601
- Forks
- 34
- Merge medio
- 1 h 58 min
- PR fusionados (30 d)
- 45
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de makepad/relax
-
std: `SliceIndex<str>` missing for `std::ops` ranges, so generic `R: SliceIndex<str>` bounds failAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 18/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 18/100
Los mantenedores suelen responder en 1 día
-
Relax live tests rerun the whole suite after a one-line body editQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 32/100
Los mantenedores suelen responder en 1 día
Todos los issues de makepad/relax
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
-
tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
vfarcic/dot-agent-deck#2512 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
pop-os/cosmic-applets#1641 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
pop-os/cosmic-store#650 ·