Skip to content

Big-endian platforms not supported #35709

Closed
@uweigand

Description

@uweigand

Describe the bug

We are currently working on porting .NET to the IBM Z (s390x) architecture, targeting the .NET 6 release. Support for the runtime has already been merged upstream, as well as necessary bugfixes in various SDK components (roslyn, fsharp, msbuild, nuget). However, aspnetcore does not yet work out of the box, due mostly due to endian issues.

IBM Z is a big-endian platform, and the current aspnetcore code base does not support big-endian platforms. In the Kestrel component, there is an explicit assertion that will prevent the server from even starting; in other places, some code is simply incorrect for big-endian machines.

Further technical details

I've re-built a version of the .NET 6 Preview7 SDK & runtime targeting the linux-s390x platform, and used this to build & test the Preview7 aspnetcore code base (running natively on s390x).

The following endian-specific problems showed up:

  1. Endian assumptions in optimized HTTP header string processing in Kestrel (including in generated code)
  2. Endian assumptions in optimized IP/socket address processing in Kestrel
  3. Accessing binary data in little-endian format in the RenderBatch code in Ignitor
  4. Endian assumptions in optimized Guid processing in KeyRingBasedDataProtector.cs

I've created fixes for all problems listed above, and am planning to submit PRs shortly, all linked to this issue.

Metadata

Metadata

Labels

DoneThis issue has been fixedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-kestrel

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions