fix: unpin onnxruntime, fix HUM-6564 at the source - #4
Merged
Merged
Conversation
The <1.20 pin worked around the distroless segfault by holding the ONNX
embedding runtime nine minor versions back. Fix the actual cause instead.
onnxruntime vendors cpp_client_telemetry, which reads /etc/machine-id for
a device ID. When the value is unusable it falls back to popen("blkid"),
which returns NULL with no /bin/sh. The SDK does not check that, so the
following pclose(NULL) segfaults on `import onnxruntime`. Upstream is
onnxruntime#32173, fixed by #32226 but not yet in a release.
Two independent guards: a populated /etc/machine-id (generated in the
builder while root) and ORT_DISABLE_TELEMETRY=1.
Verified on registry.access.redhat.com/hi/python:3.12, py 3.12.14,
onnxruntime 1.29.0 — the ticket's exact environment:
both guards -> imports OK
telemetry on, id set -> imports OK
telemetry off, no id -> imports OK
both off -> SIGSEGV (139), reproduces the bug
The file must be POPULATED; an empty "first boot" machine-id still
segfaults. ORT_DISABLE_TELEMETRY also stops onnxruntime writing
/tmp/mat-debug-1.log and /tmp/.ses, unwanted in this image regardless.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013t1uJRVqhkikr52jXxxvck
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.
Summary
Replaces the
onnxruntime<1.20pin with a fix for the actual cause, letting the ONNX embedding runtime run current again.onnxruntimevendorscpp_client_telemetry, which reads/etc/machine-id. When unusable it falls back topopen("blkid")— NULL with no/bin/sh— and the uncheckedpclose(NULL)segfaults on import. Upstream: microsoft/onnxruntime#32173, fixed by microsoft/onnxruntime#32226, not yet released.Two independent guards: populated
/etc/machine-id+ORT_DISABLE_TELEMETRY=1.Test plan
Verified on
registry.access.redhat.com/hi/python:3.12(py 3.12.14, onnxruntime 1.29.0):An empty
/etc/machine-idstill segfaults; it must be populated.🤖 Generated with Claude Code
https://claude.ai/code/session_013t1uJRVqhkikr52jXxxvck