Repository navigation
fix(dgw,agent): fix Windows service crash at startup - #2069
Merged
Merged
Conversation
Bump ceviche to 0.8.0, which passes a properly terminated service table to StartServiceCtrlDispatcherW. ceviche 0.7.0 passed a table without its null terminator entry, so Windows read leftover stack data as extra service entries. With the 2026.3.2 build, that made the Gateway service crash at startup on Windows Server 2016 (access violation in ntdll.dll). ceviche 0.8.0 also changes the service main function to return a u8 exit code, so the Gateway and Agent service entry points are updated accordingly. Issue: DGW-460 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013S6heAK1x7hF1rZDgpabwB
Member
Author
|
Implementation notes:
Generated by Claude Code |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Non-Windows service exit codes are discarded, and the lockfile includes unrelated dependency churn.
2 open findings
What changed in this PR
Updates Gateway and Agent to Ceviche 0.8, fixing invalid Windows service registration memory.
Changes:
- Upgrades Ceviche to 0.8.
- Adapts service callbacks to
u8exit codes. - Refreshes dependency resolution.
External-contract and documentation passes were not applicable.
| File | Description |
|---|---|
devolutions-gateway/src/main.rs |
Adapts Gateway service exit codes. |
devolutions-gateway/Cargo.toml |
Upgrades Ceviche. |
devolutions-agent/src/main.rs |
Adapts Agent service exit codes. |
devolutions-agent/Cargo.toml |
Upgrades Ceviche. |
Cargo.lock |
Locks Ceviche 0.8 and resolved dependencies. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ceviche 0.8 returns the service main exit code from `Controller::register`. Use it as the process exit status, so that a configuration or startup failure no longer exits with status 0 and service managers such as systemd (`Restart=on-failure`) see it. The Agent now also reports a registration failure and exits with status 1 instead of exiting silently with status 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013S6heAK1x7hF1rZDgpabwB
Benoît Cortier (CBenoit)
enabled auto-merge (squash)
October 13, 2026 17:10
Benoît Cortier (CBenoit)
disabled auto-merge
October 14, 2026 07:49
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.

Fixes a crash that could stop the Devolutions Gateway Windows service from starting: after updating to 2026.3.2 on Windows Server 2016, the service crashed immediately (access violation in
ntdll.dll) and never came up, while running the same binary in a console worked.The cause was a bug in the service-registration library both the Gateway and the Agent use, which could make Windows read garbage while registering the service. Whether it crashed depended on the exact build, so the Agent carried the same latent risk. Both now use the fixed library.
When the service fails to start (for example because of an invalid configuration), the Gateway and Agent processes now exit with a nonzero status instead of 0, so service managers such as systemd can detect the failure and restart the service.
Issue: DGW-460