Windows warm-up abort: implicit aggregate return, and no abort when a hot call's baseline does not compile - #9
Merged
Conversation
… zero The return the builder adds where a body can fall off its end gave a struct-typed value an i32 zero. Cranelift holds a struct by address, so once the function was inlined and its result split into fields, the caller loaded through that zero and the verifier refused the caller. git-bug: b23d6a1de82dabb1fe61b6af14c3813fe10fa874222224a339f5006eb70a5a5b
… interpreted Both callers already fall back on a null entry, but asked through the stub's entry point, which aborts the process when the compile fails. git-bug: b23d6a1de82dabb1fe61b6af14c3813fe10fa874222224a339f5006eb70a5a5b
darmie
marked this pull request as ready for review
September 27, 2026 19:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
git-bug: b23d6a1de82dabb1fe61b6af14c3813fe10fa874222224a339f5006eb70a5a5b
exceptions/try_finally_tuple_return.pyexits 0xC0000409 on Windows with warm-up on. Its stderr: "a function compiled on first call could not be compiled (bead 1)", which isosr::lazy_compilecallingabort().i32zero. Oncegis inlined into__main__and its result split into fields,__main__loads through that zero, so Cranelift's verifier rejects it and the tier-0 compile of__main__fails. The placeholder is nowUndef, which every backend already holds as an aggregate.ensure_baseline) and the interpreter's hot-call path both handle a null entry, but they asked for it throughlazy_compile, the stub's entry point, which aborts on a failed compile. They now usetry_lazy_compile.Why Windows only: on unix zypy ends with
_exit, killing the promotion thread before its compile finishes. On Windows it drops the runtime, andshutdownwaits on the requester lock that thread holds, so the failed compile reaches the abort. On Linux the same abort happens with a longer loop, or with the Windows exit path forced.Tests:
crates/compiler/tests/implicit_aggregate_return.rs(placeholder shape; the inlined, scalarised caller on Cranelift, LLVM and the interpreter) andcrates/compiler/tests/lazy_compile_declined.rs(a hot call to a function Cranelift declines stays interpreted; it SIGABRTs before the change).Draft until the Windows native tests job is green.