Skip to content

sidecar: Clear the response buffer before running - #4071

Draft
smalis-msft wants to merge 1 commit into
microsoft:mainfrom
smalis-msft:sidecar-clear-command
Draft

sidecar: Clear the response buffer before running#4071
smalis-msft wants to merge 1 commit into
microsoft:mainfrom
smalis-msft:sidecar-clear-command

Conversation

@smalis-msft

Copy link
Copy Markdown
Contributor

Setting this value to () doesn't actually write anything, as unit is zero sized. Instead, set the value to something sized but harmless, in this case a RunVpResponse indicating a spurious exit with no real intercept.

@smalis-msft
smalis-msft requested a review from a team as a code owner July 28, 2026 22:23
Copilot AI review requested due to automatic review settings July 28, 2026 22:23
@github-actions github-actions Bot added the unsafe Related to unsafe code label Jul 28, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Unsafe Code Detected

This PR modifies files containing unsafe Rust code. Extra scrutiny is required during review.

For more on why we check whole files, instead of just diffs, check out the Rustonomicon

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This change fixes a subtle correctness issue in the sidecar VP run path: previously, run() attempted to “clear” the command buffer by writing a () input, but () is zero-sized and therefore doesn’t overwrite any bytes in the shared command page. The update ensures the shared buffer is actually written before starting the VP, preventing stale data from being interpreted as a new RUN_VP result.

Changes:

  • Write a 1-byte, harmless value (RunVpResponse { intercept: 0 }) into the command page before issuing RUN_VP.
  • Preserve existing wait() semantics (intercept != 0) while ensuring the output byte is deterministically initialized.

@smalis-msft smalis-msft changed the title sidecar: Clear the command input buffer before running sidecar: Clear the response buffer before running Jul 28, 2026
@smalis-msft smalis-msft added the backport_1.8.2607 Change should be backported to the release/1.8.2607 branch label Jul 28, 2026
@github-actions

Copy link
Copy Markdown

@smalis-msft
smalis-msft marked this pull request as draft July 30, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport_1.8.2607 Change should be backported to the release/1.8.2607 branch unsafe Related to unsafe code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants