You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Binary Xml format broken on big-endian machines #74494
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)
@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.
@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!
Activity
StephenMolloy commentedon Aug 24, 2022
@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.
uweigand commentedon Aug 25, 2022
@StephenMolloy OK, I'll work on coming up with a PR to fix this, hopefully within the next few days. Thanks!
KalleOlaviNiemitalo commentedon Aug 25, 2022
The format is documented in [MC-NBFX]: .NET Binary Format: XML Data Structure, where §2.1 Common Definitions indeed specifies little-endian byte order.
Fix XmlBinaryReader/XmlBinaryWriter on big-endian systems (#74599)