D3D12-LOADER-CRASH-NO-STDERR-PANIC: never panic on closed stderr in crash reporting #2946

Open
bobcatchris wants to merge 1 commit from upstream-pr/2946 into main
bobcatchris commented 2026-12-01 20:35:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-12-01T20:35:59Z.


Summary

Claimed in the coordination issue as: D3D12-LOADER-CRASH-NO-STDERR-PANIC (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7324806186).

Prevents d3d12/crates/leonida-loader/src/crash.rs from panicking on a closed/failing stderr pipe during crash reporting:

  • log_crash: writes append_to_log(&text) first and writes to stderr with let _ = write!(std::io::stderr(), "{text}"); instead of eprint!, so a closed stderr pipe never loses the crashes.log entry.
  • report (called from extern "system" VEH/SetUnhandledExceptionFilter): replaces eprintln!("{l}"), eprint!("{said}"), and eprintln!(" saved ...") with fallible let _ = write!/writeln!(std::io::stderr(), ...) and writes append_to_log(&text) before printing said, so a closed stderr pipe never panics/aborts across extern "system" and never skips crashes.log or save_on_crash memory dumps.

Tests & Verification

  • Hardware / OS: Windows 11, Rust 1.98.1, no game files or GPU needed.
  • Red -> Green:
    • Added subprocess test crash::tests::log_crash_and_report_unhandled_write_files_when_stderr_pipe_is_closed verifying both log_crash and report_unhandled (plus two save_on_crash dumps under #[cfg(feature = "diagnostics")]) against a closed stderr pipe.
    • Reverting log_crash to eprint!: FAIL (RED1_EXIT=101).
    • Reverting report to eprintln!: FAIL (RED2_EXIT=101).
    • With the fix:
      • cargo test --locked -p leonida-loader --lib --features diagnostics -- crash::tests: 20 passed, 0 failed.
      • cargo test --locked -p leonida-loader --lib -- crash::tests: 20 passed, 0 failed.
  • python -I tools/d3d12_switches.py --check d3d12/docs/switches.md: exit 0.
  • python -I scripts/check_no_game_data.py d3d12/crates/leonida-loader/src/crash.rs: exit 0.

GPUs tested: N/A (crash/stderr path only; covered by @MoonEyes's 2026-12-02T18:21:19Z in-game batch PASS on RTX 4060 at head 44bf554fe).

AI Assistance

AI-assisted using Gemini 4 Neon, including a separate read-only independent review pass (APPROVE; applied optional polish to use 'static byte slices in the save_on_crash test fixture and drop a duplicate import).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5594068127 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2946). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-12-01T20:35:59Z. --- ## Summary Claimed in the coordination issue as: `D3D12-LOADER-CRASH-NO-STDERR-PANIC` (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7324806186). Prevents `d3d12/crates/leonida-loader/src/crash.rs` from panicking on a closed/failing stderr pipe during crash reporting: - `log_crash`: writes `append_to_log(&text)` **first** and writes to stderr with `let _ = write!(std::io::stderr(), "{text}");` instead of `eprint!`, so a closed stderr pipe never loses the `crashes.log` entry. - `report` (called from `extern "system"` VEH/`SetUnhandledExceptionFilter`): replaces `eprintln!("{l}")`, `eprint!("{said}")`, and `eprintln!(" saved ...")` with fallible `let _ = write!/writeln!(std::io::stderr(), ...)` and writes `append_to_log(&text)` before printing `said`, so a closed stderr pipe never panics/aborts across `extern "system"` and never skips `crashes.log` or `save_on_crash` memory dumps. ## Tests & Verification - **Hardware / OS**: Windows 11, Rust 1.98.1, no game files or GPU needed. - **Red -> Green**: - Added subprocess test `crash::tests::log_crash_and_report_unhandled_write_files_when_stderr_pipe_is_closed` verifying both `log_crash` and `report_unhandled` (plus two `save_on_crash` dumps under `#[cfg(feature = "diagnostics")]`) against a closed stderr pipe. - Reverting `log_crash` to `eprint!`: **FAIL** (`RED1_EXIT=101`). - Reverting `report` to `eprintln!`: **FAIL** (`RED2_EXIT=101`). - With the fix: - `cargo test --locked -p leonida-loader --lib --features diagnostics -- crash::tests`: **20 passed, 0 failed**. - `cargo test --locked -p leonida-loader --lib -- crash::tests`: **20 passed, 0 failed**. - `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md`: exit 0. - `python -I scripts/check_no_game_data.py d3d12/crates/leonida-loader/src/crash.rs`: exit 0. **GPUs tested:** N/A (crash/stderr path only; covered by `@MoonEyes`'s `2026-12-02T18:21:19Z` in-game batch PASS on RTX 4060 at head `44bf554fe`). ## AI Assistance AI-assisted using Gemini 4 Neon, including a separate read-only independent review pass (APPROVE; applied optional polish to use `'static` byte slices in the `save_on_crash` test fixture and drop a duplicate import).
merzleckeier commented 2026-12-01 20:51:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T20:51:35Z.


Independent crash-output check with a closed pipe on 44bf554f merged into 1e3e316c. Under Win64 Wine 11.22 the stock subprocess test passed 3/3 with diagnostics, 3/3 without diagnostics and 3/3 in the diagnostics build combined with #2945 and #2947. It verifies the GPU message, synthetic title line and breakpoint report in the file. The diagnostics build also checks the exact contents of both synthetic dump files.

Restoring only the older per-line eprintln! in report on the combined tree, with the initial file-first log_crash intact, made the same child and outer test exit 101 in all three runs. With the original Cargo binary basename the exact PR passed all 20 crash tests, and the three-PR build passed all 26 crash/profile/stack tests. This uses a direct synthetic exception report under Wine. Native exception dispatch was outside the fixture.

MEASURED with OpenAI Codex and a separate read-only review.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7325380846 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2946#issuecomment-7325380846). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-01T20:51:35Z. --- Independent crash-output check with a closed pipe on `44bf554f` merged into `1e3e316c`. Under Win64 Wine 11.22 the stock subprocess test passed 3/3 with diagnostics, 3/3 without diagnostics and 3/3 in the diagnostics build combined with #2945 and #2947. It verifies the GPU message, synthetic title line and breakpoint report in the file. The diagnostics build also checks the exact contents of both synthetic dump files. Restoring only the older per-line `eprintln!` in `report` on the combined tree, with the initial file-first `log_crash` intact, made the same child and outer test exit 101 in all three runs. With the original Cargo binary basename the exact PR passed all 20 crash tests, and the three-PR build passed all 26 crash/profile/stack tests. This uses a direct synthetic exception report under Wine. Native exception dispatch was outside the fixture. MEASURED with OpenAI Codex and a separate read-only review.
KelboLive commented 2026-12-01 21:23:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T21:23:09Z.

Review: COMMENTED


Verified on Windows with Rust 1.100: lib 85/85, all loader targets green, diagnostics crash tests 20/20, clippy -D warnings clean.

The closed-pipe test is real: the child asserts writeln!(stderr, "probe").is_err() before reporting, so every later write has a dead handle, and it checks crashes.log plus both diagnostic dumps. Both guards are load-bearing — reverting report's line write to eprintln!, or moving eprint! back before append_to_log in log_crash, fails the new test with child exit 101.

The approach is right for the context: report is reached from extern "system" filter/handler, where a panic would abort, so removing the panic source with fallible writes (rather than catch_unwind) is the correct fix, and title_output already uses try_lock.

Non-blocking: the panic hook installed by log_crashes_to still calls the previous hook (print(info), crash.rs:54). The default hook ignores stderr errors, but a third-party hook that unwraps could still abort from inside a panic — fine for a follow-up. Also worth remembering the claim is narrower than "never fails": an OOM/allocation abort in the handler is still possible; it is just no longer triggered by stderr.

Merge is clean against current main, #2945/#2947 are disjoint files, and the same-file sibling #2939 also merges cleanly.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6140397867 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2946#pullrequestreview-6140397867). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-12-01T21:23:09Z. **Review:** COMMENTED --- Verified on Windows with Rust 1.100: lib **85/85**, all loader targets green, diagnostics crash tests **20/20**, clippy `-D warnings` clean. The closed-pipe test is real: the child asserts `writeln!(stderr, "probe").is_err()` before reporting, so every later write has a dead handle, and it checks `crashes.log` plus both diagnostic dumps. Both guards are load-bearing — reverting `report`'s line write to `eprintln!`, or moving `eprint!` back before `append_to_log` in `log_crash`, fails the new test with child exit 101. The approach is right for the context: `report` is reached from `extern "system"` `filter`/`handler`, where a panic would abort, so removing the panic source with fallible writes (rather than `catch_unwind`) is the correct fix, and `title_output` already uses `try_lock`. Non-blocking: the panic hook installed by `log_crashes_to` still calls the previous hook (`print(info)`, `crash.rs:54`). The default hook ignores stderr errors, but a third-party hook that unwraps could still abort from inside a panic — fine for a follow-up. Also worth remembering the claim is narrower than "never fails": an OOM/allocation abort in the handler is still possible; it is just no longer triggered by stderr. Merge is clean against current main, #2945/#2947 are disjoint files, and the same-file sibling #2939 also merges cleanly.
MoonEyes commented 2026-12-02 12:31:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:31:56Z.


This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).

Could you, or anyone with a working setup, post a run report on the current head merged onto current main:

  • the head SHA and the main SHA it was merged onto;
  • GPU, driver and OS;
  • at least 300 s in the world after loading;
  • device lost / crashes (count), and rendered fps (median) if you have them;
  • the same run on main alone for comparison, if you can.

Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7345478615 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2946#issuecomment-7345478615). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T12:31:56Z. --- This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists). Could you, or anyone with a working setup, post a run report on the **current head** merged onto current `main`: - the head SHA and the `main` SHA it was merged onto; - GPU, driver and OS; - at least 300 s in the world after loading; - device lost / crashes (count), and rendered fps (median) if you have them; - the same run on `main` alone for comparison, if you can. Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough. AI-assisted (Claude Code).
MoonEyes commented 2026-12-02 18:12:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:12:32Z.


Reviewed #2946 (code review only, not built here: Windows-only). The fix is right and its test is real; the only thing missing is the in-game run that was asked for.

Head 44bf554fe7 (unchanged since 1 December)
Merge with main 45dc41f95c clean (git merge-tree); merge base 66c79286f6, 342 commits behind
Switches registry on the merge exit 0
Earlier checks on this head merzleckeier (Wine 11.22, closed pipe, merged onto 1e3e316c)

Review of d3d12/crates/leonida-loader/src/crash.rs

  • Every eprint!/eprintln! on the crash path (log_crash, the line closure in report, the title output and the diagnostics memory saves) becomes let _ = write!(std::io::stderr(), ...). On the head no eprint is left in the file except the comment that forbids it, and main has no new ones in that file since the base, so the merge keeps that true.
  • The order changes so the crash log is written before stderr (append_to_log then write!), so a closed pipe can no longer lose the file even if something else on stderr panicked. That is the root cause (eprint! panics on a write error inside an extern "system" handler, which aborts) and not a workaround.
  • The test runs itself as a child with stdin and stderr closed, checks that a stderr write really fails there, then drives log_crash and report_unhandled with a synthetic EXCEPTION_BREAKPOINT, and asserts the log (and, with diagnostics, the two saved ranges) exist. merzleckeier showed the red side under Wine: restoring only the old per-line eprintln! in report makes the child and the outer test exit 101 in 3 of 3 runs.
  • Process: the description has no GPUs tested: line (none is needed for this, but the template asks for one).

Verdict: ready once MoonEyes' requested in-game run (2 December 12:31) is posted. Nothing in the diff changes the render path, so a batch run is enough.

AI-assisted: Claude Opus 5.5 (Claude Code), review only.

AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7354125866 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2946#issuecomment-7354125866). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:12:32Z. --- **Reviewed #2946 (code review only, not built here: Windows-only). The fix is right and its test is real; the only thing missing is the in-game run that was asked for.** | | | |---|---| | Head | `44bf554fe7` (unchanged since 1 December) | | Merge with `main` `45dc41f95c` | clean (`git merge-tree`); merge base `66c79286f6`, 342 commits behind | | Switches registry on the merge | exit 0 | | Earlier checks on this head | merzleckeier (Wine 11.22, closed pipe, merged onto `1e3e316c`) | **Review of `d3d12/crates/leonida-loader/src/crash.rs`** - Every `eprint!`/`eprintln!` on the crash path (`log_crash`, the line closure in `report`, the title output and the diagnostics memory saves) becomes `let _ = write!(std::io::stderr(), ...)`. On the head no `eprint` is left in the file except the comment that forbids it, and `main` has no new ones in that file since the base, so the merge keeps that true. - The order changes so the crash log is written **before** stderr (`append_to_log` then `write!`), so a closed pipe can no longer lose the file even if something else on stderr panicked. That is the root cause (`eprint!` panics on a write error inside an `extern "system"` handler, which aborts) and not a workaround. - The test runs itself as a child with stdin and stderr closed, checks that a stderr write really fails there, then drives `log_crash` and `report_unhandled` with a synthetic `EXCEPTION_BREAKPOINT`, and asserts the log (and, with `diagnostics`, the two saved ranges) exist. merzleckeier showed the red side under Wine: restoring only the old per-line `eprintln!` in `report` makes the child and the outer test exit 101 in 3 of 3 runs. - Process: the description has no `GPUs tested:` line (none is needed for this, but the template asks for one). **Verdict: ready** once MoonEyes' requested in-game run (2 December 12:31) is posted. Nothing in the diff changes the render path, so a batch run is enough. AI-assisted: Claude Opus 5.5 (Claude Code), review only. AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
MoonEyes commented 2026-12-02 18:21:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:21:19Z.


RUN (in game, batch of seventeen render-path pull requests), each head merged with git merge --no-ff onto main 3c106eb2f, in one build: #3111 15b579756, #2948 5284c6eae, #2698 1f188c4f7, #2946 44bf554fe, #3001 d924cbb65, #2832 0c861595a, #2915 58e8535cf, #2822 d359a2f85, #2896 c9c6b103d, #2983 8278ef1b9, #3115 ba5121192, #2945 d2c08c14f, #2975 74512d658, #2951 26da88e8e, #2800 b6ebcedd4, #2893 7c7e99b48, #3113 fa1460b6b (and #3097 0d7a451ab, merged since). RTX 4060 8 GB, driver 610.88, Windows 11. Series S, -Resolution 1080, frame generation 2x, the same walking route as the other runs on this machine, 330 s after reaching the world.

What Result
Device lost / device removed 0
Exceptions, panics, hang watchdog, GPU stall, title suspended 0
Process alive at the end yes, stopped by the time limit
Rendered fps, last 240 s (43 samples) median 14.6, mean 12.7
Rendered fps, last 120 s median 13.7
Time under 5 fps in the world 13 % (short drops, lowest sample 0.3 fps)

The drops under 5 fps line up with shaders being translated while walking (about 500 translations in the last 330 s): this batch changes the shader translation, so the shader cache built by earlier runs did not apply and the pipeline precompile alone took about 45 minutes. The batch-5 run on the same machine and route had no sample under 5 fps (median 16.4). I read this as cold-cache stutter, not as a regression of a single pull request, but this run cannot tell them apart.

Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it.

Limits: one run; arrival in the world was driven by keys and not checked on pictures. A first attempt of this batch is not counted: the run script gave up waiting for the game window after 40 minutes of precompile.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7354432835 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2946#issuecomment-7354432835). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:21:19Z. --- RUN (in game, batch of seventeen render-path pull requests), each head merged with `git merge --no-ff` onto main `3c106eb2f`, in one build: #3111 `15b579756`, #2948 `5284c6eae`, #2698 `1f188c4f7`, #2946 `44bf554fe`, #3001 `d924cbb65`, #2832 `0c861595a`, #2915 `58e8535cf`, #2822 `d359a2f85`, #2896 `c9c6b103d`, #2983 `8278ef1b9`, #3115 `ba5121192`, #2945 `d2c08c14f`, #2975 `74512d658`, #2951 `26da88e8e`, #2800 `b6ebcedd4`, #2893 `7c7e99b48`, #3113 `fa1460b6b` (and #3097 `0d7a451ab`, merged since). RTX 4060 8 GB, driver 610.88, Windows 11. Series S, `-Resolution 1080`, frame generation 2x, the same walking route as the other runs on this machine, 330 s after reaching the world. | What | Result | |---|---| | Device lost / device removed | 0 | | Exceptions, panics, hang watchdog, GPU stall, title suspended | 0 | | Process alive at the end | yes, stopped by the time limit | | Rendered fps, last 240 s (43 samples) | median 14.6, mean 12.7 | | Rendered fps, last 120 s | median 13.7 | | Time under 5 fps in the world | 13 % (short drops, lowest sample 0.3 fps) | The drops under 5 fps line up with shaders being translated while walking (about 500 translations in the last 330 s): this batch changes the shader translation, so the shader cache built by earlier runs did not apply and the pipeline precompile alone took about 45 minutes. The batch-5 run on the same machine and route had no sample under 5 fps (median 16.4). I read this as cold-cache stutter, not as a regression of a single pull request, but this run cannot tell them apart. Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it. Limits: one run; arrival in the world was driven by keys and not checked on pictures. A first attempt of this batch is not counted: the run script gave up waiting for the game window after 40 minutes of precompile. AI-assisted (Claude Code).
bobcatchris commented 2026-12-02 21:02:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-12-02T21:02:20Z.


@MoonEyes Added GPUs tested: to the PR description referencing your 2026-12-02T18:21:19Z in-game batch PASS covering exact head 44bf554fe (head kept untouched).

AI-assisted: Gemini 4 Neon

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7358698677 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2946#issuecomment-7358698677). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-12-02T21:02:20Z. --- @MoonEyes Added `GPUs tested:` to the PR description referencing your `2026-12-02T18:21:19Z` in-game batch PASS covering exact head `44bf554fe` (head kept untouched). AI-assisted: Gemini 4 Neon
fiestorra commented 2026-12-03 04:56:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T04:56:35Z.


VERIFY-2946 — el hermano de #2840, en otro crate y de otro autor

d3d12/crates/leonida-loader/src/crash.rs   1 file changed, 105 insertions(+), 8 deletions(-)
cargo test -p leonida-loader --lib          85 passed; 0 failed

Y lo primero, para quien mire esta PR en la interfaz: GitHub dirá «210 files changed, +33 370», y el cambio es un fichero de 105 líneas. Es la deriva de su base (git diff merge-base..head es el número de arriba). Cualquiera que ordene la cola por tamaño de diff está ordenando por cuánto ha crecido main, no por el trabajo de este PR.

El cambio: no hacer panic al imprimir en un stderr cerrado — y el comentario nuevo del código lo dice con las mismas palabras que el de #2840: "prints it without panicking if stderr fails (e.g. a closed pipe at shutdown)".

Van tres esta noche y son de tres autores distintos: #2840 en leonida, este en leonida-loader, y #3294 con un test para el mad_legacy — dos arreglos del mismo fallo y una prueba del mismo patrón. El eprintln! que hace panic cuando el destino no está es una propiedad de Rust que sorprende a todo el mundo una vez, y aquí le ha sorprendido a tres personas en dos crates.

Lo que verifiqué: 85 tests del crate en verde con el cambio.
Lo que no: el crash.rs de verdad con el pipe cerrado — #2840 lo prueba lanzando un hijo con el stderr roto (PLAYER_CONTEXT_CLOSED_STDERR_TEST); si este hace lo mismo, el nombre del test lo dirá y está en los 85; si no, el caso que motiva el PR es el único que no se ejerce.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7368206992 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2946#issuecomment-7368206992). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T04:56:35Z. --- ## VERIFY-2946 — el hermano de `#2840`, en otro crate y de otro autor ``` d3d12/crates/leonida-loader/src/crash.rs 1 file changed, 105 insertions(+), 8 deletions(-) cargo test -p leonida-loader --lib 85 passed; 0 failed ``` **Y lo primero, para quien mire esta PR en la interfaz**: **GitHub dirá «210 files changed, +33 370»**, **y el cambio es un fichero de 105 líneas.** **Es la deriva de su base** (`git diff merge-base..head` es el número de arriba). **Cualquiera que ordene la cola por tamaño de diff está ordenando por cuánto ha crecido `main`, no por el trabajo de este PR.** **El cambio**: **no hacer `panic` al imprimir en un `stderr` cerrado** — **y el comentario nuevo del código lo dice con las mismas palabras que el de `#2840`**: *"prints it without panicking if stderr fails (e.g. a closed pipe at shutdown)"*. **Van tres esta noche y son de tres autores distintos**: **`#2840` en `leonida`, este en `leonida-loader`, y `#3294` con un test para el `mad_legacy`** — **dos arreglos del mismo fallo y una prueba del mismo patrón.** **El `eprintln!` que hace `panic` cuando el destino no está es una propiedad de Rust que sorprende a todo el mundo una vez**, **y aquí le ha sorprendido a tres personas en dos crates.** **Lo que verifiqué**: **85 tests del crate en verde con el cambio.** **Lo que no**: **el `crash.rs` de verdad con el pipe cerrado** — **`#2840` lo prueba lanzando un hijo con el `stderr` roto** (`PLAYER_CONTEXT_CLOSED_STDERR_TEST`); **si este hace lo mismo, el nombre del test lo dirá y está en los 85; si no, el caso que motiva el PR es el único que no se ejerce.**
merzleckeier commented 2026-12-03 05:06:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T05:06:33Z.


Integration check for 44bf554fe on main d9b618f10 with #3213 (9a996690) and the resolved #3146 callback overlap. A scratch Windows MSVC test closed a child’s stderr read end, confirmed writes failed, and then called host_gpu_failed with the synthetic HUNG reason. Under Wine, the control with the main loader exited 101. Rebuilding with this head’s sole loader change gave the expected Windows process status 0x887A0006 and wrote the callback message to crashes.log. This checks that the two fixes work together on the actual callback. Synthetic subprocess and temp log only. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7368382819 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2946#issuecomment-7368382819). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T05:06:33Z. --- Integration check for `44bf554fe` on `main` `d9b618f10` with #3213 (`9a996690`) and the [resolved #3146 callback overlap](https://github.com/ProjectLeonida/mandy/pull/3213#issuecomment-7368281841). A scratch Windows MSVC test closed a child’s stderr read end, confirmed writes failed, and then called `host_gpu_failed` with the synthetic HUNG reason. Under Wine, the control with the `main` loader exited 101. Rebuilding with this head’s sole loader change gave the expected Windows process status `0x887A0006` and wrote the callback message to `crashes.log`. This checks that the two fixes work together on the actual callback. Synthetic subprocess and temp log only. AI-assisted with OpenAI Codex.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2946:upstream-pr/2946'
git switch 'upstream-pr/2946'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2946'
git switch 'upstream-pr/2946'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2946'
git switch 'upstream-pr/2946'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2946'
git switch 'main'
git merge --squash 'upstream-pr/2946'
git switch 'main'
git merge --ff-only 'upstream-pr/2946'
git switch 'main'
git merge 'upstream-pr/2946'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2946
No description provided.