Skip to content

Binary Xml format broken on big-endian machines #74494

Closed

Description

@uweigand

The binary format used by XmlDictionaryReader and XmlDictionaryWriter is supposed to be always little-endian.

However, the current code does not implement this correctly when running on big-endian systems. These pre-existing problems were recently exposed by additional and updated test cases added here:
#73332 (XmlDictionaryReader)
#71478 (XmlDictionaryWriter)

See #73332 (comment) for more details.

@jkotas @Daniel-Svensson

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Aug 24, 2022
  2. StephenMolloy commented on Aug 24, 2022

    @StephenMolloy
    Contributor

    @uweigand - I think the fix for this should be pretty straightforward as we do account for endian-ness for most types. The problem is that I don't have any big-endian hardware to test with. We would welcome a PR if you want to create one and verify it on your s390x.

    And as @jkotas said in the original comment thread that spurred this issue - serialized representation ("on the wire" if you will) should always be little-endian for DataContractSerializer.

  3. added this to the 7.0.0 milestone on Aug 24, 2022
  4. ghost removed
    untriagedNew issue has not been triaged by the area owner
    on Aug 24, 2022
  5. uweigand commented on Aug 25, 2022

    @uweigand
    ContributorAuthor

    @uweigand - I think the fix for this should be pretty straightforward as we do account for endian-ness for most types. The problem is that I don't have any big-endian hardware to test with. We would welcome a PR if you want to create one and verify it on your s390x.

    And as @jkotas said in the original comment thread that spurred this issue - serialized representation ("on the wire" if you will) should always be little-endian for DataContractSerializer.

    @StephenMolloy OK, I'll work on coming up with a PR to fix this, hopefully within the next few days. Thanks!

  6. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Aug 25, 2022
  7. KalleOlaviNiemitalo commented on Aug 25, 2022

    @KalleOlaviNiemitalo

    The format is documented in [MC-NBFX]: .NET Binary Format: XML Data Structure, where §2.1 Common Definitions indeed specifies little-endian byte order.

  8. added a commit that references this issue on Sep 9, 2022
    c6c7d3c
  9. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Sep 9, 2022
  10. ghost locked as resolved and limited conversation to collaborators on Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions