Repository navigation
Manual Environment - #610
Merged
Merged
Conversation
decahedron1
commented
Aug 8, 2026
Member
decahedron1
marked this pull request as draft
August 8, 2026 22:25
decahedron1
marked this pull request as ready for review
August 14, 2026 16:25
dariofinardi
added a commit
to dariofinardi/gliner2-rs
that referenced
this pull request
Aug 25, 2026
Runtimes below 1.23 run correctly and then segfault when the process exits: exit 139, after main returns, with complete and byte-identical output. Measured with one binary against three runtimes - 1.20.0 and 1.22.0 crash, 1.23.2 does not. Not this crate, and not the CUDA EP: it reproduces on CPU in twenty lines of ort with no GLiNER code, needs a session that is actually dropped rather than leaked, and happens with one intra-op thread as readily as four. The cause is ort's global Environment being released at exit after the session state it refers to is gone. Fixed upstream by pykeio/ort#610, which makes the environment manual; verified that ort from git exits cleanly even against 1.20.0. That change is not in rc.13, so until it ships the runtime version is what decides it. Reported with the measurements as pykeio/ort#614. Worth stating because nothing warns you: ORT_API_VERSION is 17 and old runtimes satisfy it, so the library loads without complaint and the crash carries no hint that the .so is the problem.
dariofinardi
added a commit
to dariofinardi/gliner25-rs
that referenced
this pull request
Aug 25, 2026
Runtimes below 1.23 run correctly and then segfault when the process exits: exit 139, after main returns, with complete and byte-identical output. Measured with one binary against three runtimes - 1.20.0 and 1.22.0 crash, 1.23.2 does not. Not this crate, and not the CUDA EP: it reproduces on CPU in twenty lines of ort with no GLiNER code, needs a session that is actually dropped rather than leaked, and happens with one intra-op thread as readily as four. The cause is ort's global Environment being released at exit after the session state it refers to is gone. Fixed upstream by pykeio/ort#610, which makes the environment manual; verified that ort from git exits cleanly even against 1.20.0. That change is not in rc.13, so until it ships the runtime version is what decides it. Reported with the measurements as pykeio/ort#614. Worth stating because nothing warns you: ORT_API_VERSION is 17 and old runtimes satisfy it, so the library loads without complaint and the crash carries no hint that the .so is the problem.
ianshank
pushed a commit
to ianshank/FORGE
that referenced
this pull request
Aug 28, 2026
…ndled) A routine Dependabot bump (ort rc.12 -> rc.13, a7b078c) silently broke this entire feature surface -- invisible because no CI job built it. Confirmed the actual break first-hand (not the deep ABI/toolchain conflict the existing docs described): 5 mechanical lines in onnx_model.rs against ort 2.0.0-rc.13's actual API: - try_extract_raw_tensor -> try_extract_tensor (renamed) - ort::inputs![...] no longer returns a Result -- removed the stray `?` after each of the 3 call sites - Session::run now needs &mut self -- the three session-holding locals are now `let mut session = ...` - ort/std must be enabled explicitly for SessionBuilder::commit_from_file to exist at all (previously implicit; default-features = false on the base ort dependency turned it off as collateral) Also fixed a genuinely pre-existing bug this surfaced: onnx_integration.rs was missing `use std::process::Command`, uncaught for the same reason. Verified end-to-end, not just compiled: bootstrapped a real MuZero bundle via the Python export pipeline, loaded it through OnnxMuZeroModel, and ran real MCTS inference via LatentMctsSearch -- all 124 forge-agent unit tests plus the full integration test pass. Found and fixed a second, separate issue in the process: ONNX Runtime <1.23.2 hits a known upstream ort rc.13 teardown segfault on process exit under load-dynamic (pykeio/ort#614, fixed in the runtime by pykeio/ort#610) -- reproduced locally, confirmed 1.23.2 resolves it. Bumped docker/mc-runner.Dockerfile's ONNXRUNTIME_VERSION accordingly (1.18.0 -> 1.23.2); the deployed trained-mode image was carrying this same pre-existing crash risk. onnx_integration.rs's real-inference test is marked #[ignore] (needs torch+onnx+onnxscript; run with --ignored) matching the forge-eval/tests/exporters_e2e.rs precedent for heavy-external-dep tests -- everything else runs in the new CI job in the same commit.
This was referenced Sep 30, 2026
Merged
6 of 8 tasks
peteonrails
pushed a commit
to reverb256/voxtype
that referenced
this pull request
Nov 22, 2026
`voxtype transcribe <file>` on the ONNX variants prints its transcript and then aborts during teardown: `corrupted double-linked list`, exit 134, and a ~360 MB core dump per run (peteonrails#772). The command finished; the crash is entirely in the exit path. `ort` 2.0.0-rc.12 registers `release_env_on_exit` in `.fini_array`, and that cleanup releases memory ONNX Runtime has already released. glibc catches the damage on its next free in that size class and aborts, so `_dl_fini` is where the abort surfaces, not where the memory was corrupted. Skipping the hook stops the abort but is not a fix, and the hook cannot be skipped from outside the crate. The daemon already stops unwinding for the same reason (525a0a6, "Exit the daemon without running static destructors"). A one-shot command owns nothing that a static destructor releases, so it now leaves the same way: flush stdio, then `_exit`. Errors keep their exit code and their `Error: ...` line, so a missing model or an empty WAV still returns 1 rather than 134. The daemon's own error return now goes through this path too. Its success path already left without unwinding, so the only change is which code the process exits with after a failed startup, and how much of the hostile teardown it runs on the way out. The underlying defect stays upstream in `ort`/ONNX Runtime: pykeio/ort#610 replaces the exit hook with an explicitly managed environment, and it is merged but unreleased as of 2.0.0-rc.13. `src/app/exit.rs` says when to revisit this. Refs peteonrails#772
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.