Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP] [ Service ] Include drive letter in path when launching DDS snapshot #55386

Closed
bkonyi opened this issue Apr 5, 2024 · 3 comments
Closed
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. cherry-pick-approved Label for approved cherrypick request cherry-pick-review Issue that need cherry pick triage to approve triaged Issue has been triaged by sub team

Comments

@bkonyi
Copy link
Contributor

bkonyi commented Apr 5, 2024

Commit(s) to merge

d4c20e2

Target

Beta (should be included in upcoming stable)

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/361400

Issue Description

The VM service would fail to launch DDS when the SDK was on one Windows drive and the target program was executed in the context of a different drive. The logic to manually build the URI to the DDS snapshot resulted in Windows drive letters being omitted from the URI. This works fine for most cases since the path started with a leading /, which is interpreted as the current drive, but fails if the SDK is not present on the current drive.

What is the fix

Updates the _DebuggingSession logic in the VM service responsible for launching DDS to use the dart:io File API to consistently get a well-formed path to SDK bin directory rather than trying to manually build it using Uri APIs.

Why cherry-pick

Windows users with multiple drives may encounter crashes when enabling the VM service.

Risk

Low risk.

Issue link(s)

grpc/grpc-dart#697

Extra Info

No response

@bkonyi bkonyi added the cherry-pick-review Issue that need cherry pick triage to approve label Apr 5, 2024
@lrhn lrhn added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Apr 8, 2024
@a-siva
Copy link
Contributor

a-siva commented Apr 8, 2024

lgtm

@a-siva
Copy link
Contributor

a-siva commented Apr 10, 2024

@itsjustkevin is this a go ?

@a-siva a-siva added the triaged Issue has been triaged by sub team label Apr 10, 2024
@itsjustkevin itsjustkevin added the cherry-pick-approved Label for approved cherrypick request label Apr 10, 2024
@itsjustkevin
Copy link
Contributor

@bkonyi go ahead and merge, this will land in the next release.

copybara-service bot pushed a commit that referenced this issue Apr 12, 2024
…apshot

The previous logic for building the path to dds.dart.snapshot would result
in the Windows drive letter being dropped from the path:

\path\to\dart-sdk\bin\dds.dart.snapshot

This works most of the time since a leading slash is treated as a reference
to the current drive, which often contains the Dart SDK. However, if the SDK
is on a different drive than the current (e.g., in a container with two drives),
the VM will fail to find the snapshot.

This change uses the File(...) APIs from dart:io to build the path rather than
trying to use the Uri class to manually hack together a path.

TEST=N/A, not reproducible without a second Windows drive

Bug: grpc/grpc-dart#697
Change-Id: I71d00b07a98508a780f5aab76417da4aa530f3c4
Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/360920
Cherry-pick-request: #55386
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361400
Reviewed-by: Siva Annamalai <[email protected]>
@bkonyi bkonyi closed this as completed Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. cherry-pick-approved Label for approved cherrypick request cherry-pick-review Issue that need cherry pick triage to approve triaged Issue has been triaged by sub team
Projects
None yet
Development

No branches or pull requests

7 participants