diff --git a/ffi/README.md b/ffi/README.md index 56c33d7d4..359d34ffd 100644 --- a/ffi/README.md +++ b/ffi/README.md @@ -1768,6 +1768,9 @@ and cgocheck2, and `tests/api.py`'s checks on a debug build of the newest CPytho blocks end where they began; and it drives the C ABI from `tests/miri/api.rs` and the protocol scripts from `tests/miri/protocol.rs` under Miri with strict provenance. The protocol scripts' C driver runs under each sanitizer too. +On aarch64 the glue builds without outline atomics (`-Ctarget-feature=-outline-atomics`): the +instrumented `compiler_builtins` would answer the runtime's own atomics, before its shadow +exists, and crash it in `__asan_init`. moq's crates export through `target/moq-ffi`, an empty library on each that `just ffi moq` writes in place of moq-ffi's remainder. The export serves the host and each target `just ffi moq-api` staged in `target/moq-api` from the same moq sources, and fails on a diff --git a/ffi/tests/fixtures.rs b/ffi/tests/fixtures.rs index 2386f5591..1243fa48c 100644 --- a/ffi/tests/fixtures.rs +++ b/ffi/tests/fixtures.rs @@ -528,6 +528,15 @@ fn api_valgrind() { fn sanitized_glue(sanitizer: &str) -> (PathBuf, Vec) { let api = api(); let dir = scratch().join("api").join(sanitizer); + // On aarch64, the runtime's atomics call `__aarch64_*` helpers, which the instrumented + // compiler_builtins would define and answer by reading a flag through a shadow check, before + // the runtime has mapped its shadow: every run would crash in `__asan_init` or `__tsan_init`. + // Without them the link takes the toolchain's own, which are not instrumented. + let outline = if cfg!(target_arch = "aarch64") { + " -Ctarget-feature=-outline-atomics" + } else { + "" + }; let built = run(cargo() .args(["build", "--quiet", "--locked", "-Zbuild-std", "--target", host()]) .arg("--manifest-path") @@ -536,7 +545,7 @@ fn sanitized_glue(sanitizer: &str) -> (PathBuf, Vec) { .arg(dir.join("glue")) .env( "RUSTFLAGS", - format!("-D warnings -Zsanitizer={sanitizer} --print=native-static-libs"), + format!("-D warnings -Zsanitizer={sanitizer} --print=native-static-libs{outline}"), )); let native: Vec = String::from_utf8_lossy(&built.stderr) .lines() diff --git a/quest/m1/README.md b/quest/m1/README.md index 4e3352e61..44e5a3106 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -25,7 +25,6 @@ hold moq's pin open; the epic retired on 2026-11-16 once its children landed. Re Decided with the maintainer on 2026-11-18, in the per-language audit of the exporter's bindings and the translators: ✅ its findings join m1 where moq's switch uses them. Breaking changes are children of [the exporter epic](/quest/m1/ffi-export/README.md) and land as -soon as possible; the rest are the [proofs](/quest/m1/ffi-proofs/README.md), -[speed](/quest/m1/ffi-speed/README.md), [rule cost](/quest/m1/ffi-rules/README.md), and +soon as possible; the rest are the [speed](/quest/m1/ffi-speed/README.md), [rule cost](/quest/m1/ffi-rules/README.md), and [packaging](/quest/m1/ffi-packaging/README.md) epics, and the fixes and additions at this milestone's top. Rejected: packaging in m2. diff --git a/quest/m1/ffi-export/README.md b/quest/m1/ffi-export/README.md index 2126ec296..d379b6bfe 100644 --- a/quest/m1/ffi-export/README.md +++ b/quest/m1/ffi-export/README.md @@ -101,8 +101,7 @@ Decided with the maintainer on 2026-11-18, in the per-language audit: Kotlin (landed), Python (landed), Dart (landed), and docs. Rejected: only the surface lock holding the pin; all of them after the pin. - ✅ Work that changes no generated API, or only adds to it, stays out of this epic, as - decided on 2026-11-12: [proofs](/quest/m1/ffi-proofs/README.md), - [speed](/quest/m1/ffi-speed/README.md), [rule cost](/quest/m1/ffi-rules/README.md), + decided on 2026-11-12: [speed](/quest/m1/ffi-speed/README.md), [rule cost](/quest/m1/ffi-rules/README.md), [packaging](/quest/m1/ffi-packaging/README.md), ordering and stream adapters (landed), with [Swift streams of noncopyable objects](/quest/m1/swift-async-reader.md). - Dropped: a per-function contract in place of the whole-header hash, since moq links diff --git a/quest/m1/ffi-proofs/README.md b/quest/m1/ffi-proofs/README.md deleted file mode 100644 index 2a1b2cd43..000000000 --- a/quest/m1/ffi-proofs/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Prove the exporter on more inputs - -## Goal - -[rust2-ffi](/ffi/README.md) is checked against inputs and call sequences no one wrote by -hand: stock crates, a wider shape sample, random protocol sequences, and every language's -own checkers. It completes when every child has merged. - -## Plan - -Decided with the maintainer on 2026-11-18, in the per-language audit: ✅ all four proofs -the audit proposed are kept (rejected: any subset). Existing proofs stay: differential -transcripts against native Rust in every language, seeded shape round-trips, ASan and TSan, -Go's race detector, Miri, and loom on `rt/borrow.rs` and the hold counts. - -This epic changes no generated API, so it does not hold moq's pin -([the exporter epic](/quest/m1/ffi-export/README.md#plan)). Considered and dropped by the -audit: Kani, since the runtime's `unsafe` is FFI and concurrency, where Miri and loom fit -better; and mutation testing of the generators, since every mutant reruns eight languages. diff --git a/quest/m1/ffi-proofs/arm-sanitizers.md b/quest/m1/ffi-proofs/arm-sanitizers.md deleted file mode 100644 index 1a3e9d011..000000000 --- a/quest/m1/ffi-proofs/arm-sanitizers.md +++ /dev/null @@ -1,28 +0,0 @@ -# [S] The nightly sanitizers run on the arm runner - -## Goal - -The nightly's `ffi-sanitize` job passes on `ubuntu-24.04-arm`. Today `api_asan`, -`api_tsan`, and `api_swift_tsan` fail there on their first program run, which prints -nothing. Each one passes on x86_64 Linux. - -## Plan - -Decided with the maintainer on 2026-11-19, in the pick of [#891](https://github.com/kixel-ai/rust2/pull/891): ✅ kept (rejected: dropping it). - -Found by the checkers quest -([kixel-ai/rust2#891](https://github.com/kixel-ai/rust2/pull/891)). The job has failed on -every nightly since it was added on 2026-11-14, for example -[run 44339014570](https://github.com/kixel-ai/rust2/actions/runs/44339014570). Valgrind, -Miri, Go's race detector, and the debug CPython in the same job pass. - -A failed run now names its exit status (`check` in `ffi/tests/fixtures.rs`). Read that -first. The leading suspect is the runner kernel's ASLR entropy (`vm.mmap_rnd_bits`): it -breaks the sanitizer runtimes' shadow layouts, and the common fix lowers it with `sysctl` -in the job. The other suspect is a mismatch between nixpkgs clang's compiler-rt and the -nightly rustc's instrumentation on aarch64. Fix the cause, not the symptom. Running on -x86_64 instead would hide it. - -## Hosts - -- linux - the failure is on aarch64 Linux; reproduce on an arm64 Linux host or the runner