Skip to content

tray crash-loops on startup — bundled vc++ runtime older than onnxruntime needs #703

Closed

Description

@moosebuilds

0xe0434352 dialog on launch, autostart relaunches → crash loop. real error's in the app event log:

.NET Runtime (1026): System.DllNotFoundException: Unable to load DLL 'sherpa-onnx-c-api' or one of
its dependencies: A dynamic link library (DLL) initialization routine failed. (0x8007045A)
   at SherpaOnnx.OfflineTts.SherpaOnnxDestroyOfflineTts(IntPtr handle)
   at SherpaOnnx.OfflineTts.Cleanup() / Finalize()  ->  GC.RunFinalizers()
Application Error: faulting module MSVCP140.dll 14.29.30142.1, 0xc0000005

tldr: bundled msvcp140/vcruntime140 are 14.29 and sit next to onnxruntime 1.26, so they win over the system runtime. 1.26 wants newer → sherpa-onnx-c-api fails its init (0x8007045A) → the OfflineTts finalizer calls into the dead dll → AV.

repros on signed 0.6.3 + a clean build of main. dropping the current vcruntime (14.51) in the app dir fixes it.

Activity

  1. clawsweeper commented on Jun 5, 2026

    @clawsweeper

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 6, 2026, 9:08 AM ET / 13:08 UTC.

    Summary
    Keep open; current main still appears to ship the same x64 app-local VC runtime path while ONNX/Sherpa remains in the tray and the native dependency verifier does not cover the reported load failure.

    Reproducibility: yes. for a source-level path: publish or run the Windows tray with the current win-x64 app-local VC runtime package and exercise the Piper/Sherpa TTS path. I did not run the live Windows crash in this read-only review.

    Next step
    This is a focused packaging and validation repair with clear likely files and a high-impact crash-loop failure mode.

    Review details

    Best possible solution:

    Update packaging so app-local VC runtime DLLs are new enough for the bundled ONNX/Sherpa stack, then extend native dependency validation to catch Sherpa/ONNX loading or minimum runtime-version failures.

    Do we have a high-confidence way to reproduce the issue?

    Yes for a source-level path: publish or run the Windows tray with the current win-x64 app-local VC runtime package and exercise the Piper/Sherpa TTS path. I did not run the live Windows crash in this read-only review.

    Is this the best way to solve the issue?

    Yes; the narrow maintainable fix is release packaging plus native dependency validation, not a TTS workaround that leaves stale app-local runtime DLLs shadowing newer system runtimes.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • This read-only Linux review did not execute a live Windows tray launch or native Sherpa/ONNX load probe; the fix should include Windows publish proof for the packaged runtime.

    Codex review notes: model gpt-5.5, reasoning high; reviewed against 4be005707f44.

    Label changes

    Label changes:

    • add P0: The report is a startup crash loop that can make the tray unusable on affected installs.
    • add impact:crash-loop: The issue specifically reports autostart relaunching the tray into repeated startup crashes.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:queueable-fix: Current issue advisory state selects this label.
    • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.

    Label justifications:

    • P0: The report is a startup crash loop that can make the tray unusable on affected installs.
    • impact:crash-loop: The issue specifically reports autostart relaunching the tray into repeated startup crashes.
    Evidence reviewed

    Acceptance criteria:

    • ./build.ps1
    • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore
    • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore
    • dotnet publish ./src/OpenClaw.Tray.WinUI/OpenClaw.Tray.WinUI.csproj -c Release -r win-x64 --self-contained --no-restore -o publish
    • pwsh ./scripts/Test-ReleaseNativeDependencies.ps1 -PayloadPath publish -RequireAppLocalVCRuntime

    What I checked:

    • Current x64 runtime package pin: Current main still references VCRuntime.CefSharp.140 1.0.5 as the product build source for loose VC runtime DLLs. (src/Directory.Build.props:17, 4be005707f44)
    • Current x64 app-local copy path: The x64 target copies every DLL from the pinned VCRuntime.CefSharp.140 package into build and publish output, matching the reported app-local shadowing mechanism. (src/Directory.Build.targets:24, 4be005707f44)
    • ONNX and Sherpa native dependencies remain present: The shared project references Microsoft.ML.OnnxRuntime 1.26.0 and the tray references org.k2fsa.sherpa.onnx 1.13.0, with PiperTextToSpeechClient constructing SherpaOnnx.OfflineTts. (src/OpenClaw.Shared/OpenClaw.Shared.csproj:22, 4be005707f44)
    • Verifier gap: Test-ReleaseNativeDependencies.ps1 searches for libsodium.dll and probes LoadLibrary("libsodium.dll"), but it does not probe sherpa-onnx-c-api, ONNX Runtime, or minimum VC runtime file versions. (scripts/Test-ReleaseNativeDependencies.ps1:93, 4be005707f44)
    • Release workflow relies on that verifier: CI and release packaging run Test-ReleaseNativeDependencies.ps1 with RequireAppLocalVCRuntime, so the current release gate can pass while missing the reported Sherpa/ONNX runtime-version mismatch. (.github/workflows/ci.yml:394, 4be005707f44)
    • Latest release has the same core packaging shape: The v0.6.3 tag contains VCRuntime.CefSharp.140 1.0.5, the x64 copy glob, and Microsoft.ML.OnnxRuntime 1.26.0, consistent with the reporter's signed-release repro. (src/Directory.Build.targets:24, 85445c78066b)

    Likely related people:

    • vincentkoc: PR 596 added the VC runtime package, release verifier, workflow checks, and release docs for native runtime bundling. (role: introduced release runtime bundling; confidence: high; commits: 7485ce2af9da; files: src/Directory.Build.props, src/Directory.Build.targets, scripts/Test-ReleaseNativeDependencies.ps1)
    • kmahone: PR 656 recently changed adjacent VC runtime publish logic and tests for ARM64 while leaving the x64 NuGet-sourced runtime path intact. (role: recent release-runtime contributor; confidence: medium; commits: f839cf53aa0c; files: src/Directory.Build.targets, tests/OpenClaw.Tray.Tests/ReleaseSigningWorkflowTests.cs, docs/RELEASING.md)
    • RBrid: PR 288 added the Sherpa package reference and OfflineTts wrapper involved in the reported native initialization failure. (role: introduced Sherpa/Piper TTS native dependency; confidence: medium; commits: b0ba9affa25d; files: src/OpenClaw.Tray.WinUI/OpenClaw.Tray.WinUI.csproj, src/OpenClaw.Tray.WinUI/Services/TextToSpeech/PiperTextToSpeechClient.cs, src/OpenClaw.Shared/Audio/PiperVoiceManager.cs)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    bug
    on Jun 6, 2026
  3. added
    P0
    impact:crash-loop
    issue-rating: 🦞 diamond lobster
    clawsweeper:source-repro
    clawsweeper:queueable-fix
    clawsweeper:fix-shape-clear
    on Jun 6, 2026
  4. github-actions commented on Jun 7, 2026

    @github-actions
    Contributor

    🤖 This is an automated response from Repo Assist.

    Root cause confirmed: VCRuntime.CefSharp.140 1.0.5 ships vcruntime140.dll version 14.29 (VS 2019 16.11). Both org.k2fsa.sherpa.onnx 1.13 and Microsoft.ML.OnnxRuntime 1.26 are compiled with VS 2022 and require VC++ runtime ≥ 14.40. When the app-local 14.29 DLL wins the loader search over the system runtime, sherpa-onnx-c-api fails DLL initialisation (0x8007045A) during GC finalisation of OfflineTts, crash-looping the tray.

    Validation fix submitted this run: I opened a PR adding a minimum file-version check (≥ 14.40.0.0) to Test-ReleaseNativeDependencies.ps1 so future releases that bundle an under-version VC runtime will fail CI on the Windows x64/arm64 build leg before reaching users. A regression test is included to prevent the gate from being silently removed.

    Follow-up packaging work needed (not in this PR): VCRuntime.CefSharp.140 must be updated to a version that ships 14.40+ DLLs — or the x64 VC runtime resolution changed to source from the local VS install (matching the ARM64 path in Directory.Build.targets). Either path requires Windows + NuGet connectivity to verify.

    Generated by 🌈 Repo Assist, see workflow run. Learn more.

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a
    
  5. locked as resolved and limited conversation to collaborators on Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P0bugclawsweeper:fix-shape-clearclawsweeper:queueable-fixclawsweeper:source-reproimpact:crash-loopissue-rating: 🦞 diamond lobster

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions