Skip to content

Property setter assigning to field in HyperVSocketEndPoint #13995

Closed

Description

@xtqqczze

public Guid VmId
{
get { return _vmId; }
set { _vmId = value; }
}
public Guid ServiceId
{
get { return _serviceId; }
set { _vmId = value; }
}

Why is the setter for ServiceId assigning to _vmId? It is unclear whether this is intended behaviour or not.

Activity

  1. added
    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a
    on Nov 6, 2020
  2. vexx32 commented on Nov 6, 2020

    @vexx32
    Collaborator
  3. iSazonov commented on Nov 6, 2020

    @iSazonov
    Collaborator

    It comes from Windows PowerShell. If it is not bug we need to add a comment in the code.

    It seems was Steve Lee (@SteveL-MSFT) who communicated with Hyper-V team in last time.

  4. added
    Issue-BugIssue has been identified as a bug in the product
    WG-Enginecore PowerShell engine, interpreter, and runtime
    WG-RemotingPSRP issues with any transport layer
    and removed
    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a
    WG-RemotingPSRP issues with any transport layer
    on Nov 6, 2020
  5. added a commit that references this issue on Jun 27, 2021
  6. xtqqczze commented on Jun 27, 2021

    @xtqqczze
    ContributorAuthor
  7. PaulHigin commented on Jun 29, 2021

    @PaulHigin
    Contributor

    This looks like a typo bug to me. The only effect appears to be that VmId and ServiceId values are not unique. Since this class can be serialized I have to assume the information may be persisted, and fixing the typo may cause a breaking change.

  8. vexx32 commented on Jun 29, 2021

    @vexx32
    Collaborator

    Given how this property setter works, I don't think it's possible for ServiceId to be deserialised correctly currently... Currently the effect would appear to be that the underlying data for ServiceId will always and only ever be the default value, unless you manually set the backing field. Any attempt to set the value by the property will simply set the VM ID instead.

  9. rkeithhill commented on Jun 30, 2021

    @rkeithhill
    Collaborator

    The Equals() method on this class is only comparing ServiceId values via the VmId field which is overwritten with the ServiceId value. The ServiceId field appears to always contain Guid.Empty. So if if two HyperVSocketEndPoint objects have the same ServiceId but different VmId values they will compare the same. Probably not a good situation.

  10. PaulHigin commented on Jun 30, 2021

    @PaulHigin
    Contributor

    This is obviously wrong, and I feel we should take the fix. There may be a small possibility of regression but I feel it is minimal and worth taking the fix. I ran this by the committee and they felt the same.

  11. vexx32 commented on Jun 30, 2021

    @vexx32
    Collaborator

    Putting it up for grabs for now, as it seems a simple enough change for community folks to take on if they would like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    First-Time-IssueEasy issues first time contributors can work on to learn about this projectIssue-BugIssue has been identified as a bug in the productUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions