Skip to content

Newline handling different on linux x64 and linux aarch64 #57880

@mr-russ

Description

@mr-russ

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

\r Characters are stripped from aarch64 output.

Create a new API application for .NET Core, we are using 8. Put the following code in.

var builder = WebApplication.CreateSlimBuilder(args);

var app = builder.Build();

var todosApi = app.MapGroup("/");
todosApi.MapGet("/", () => "Text\r\nMore text multinewline\r\n1\r\n2\r\n3");

app.Run();

1 .Build for x86 and for aarch64 from the linux CLI using a single file deployment.
2. Deploy to a x86 maching and an aarch64 machine.
3. Run the API request from the command line by calling the appropriate URL when deployed.

on x86 you get Text\r\nMore text multinewline\r\n1\r\n2\r\n3 as the output
on aarch64 you get Text\nMore text multinewline\n1\n2\n3 as the output.

All \r characters are stripped from the output.

Expected Behavior

x86 and aarch64 return the same unmodified string.

Text\r\nMore text multinewline\r\n1\r\n2\r\n3 is the output.

Steps To Reproduce

See bug description.

Exceptions (if any)

No response

.NET Version

8.0.400

Anything else?

.NET SDK:
Version: 8.0.400
Commit: 36fe6dda56
Workload version: 8.0.400-manifests.b6724b7a
MSBuild version: 17.11.3+0c8610977

Runtime Environment:
OS Name: debian
OS Version: 12
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/8.0.400/

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
Version: 8.0.8
Architecture: x64
Commit: 08338fcaa5

.NET SDKs installed:
8.0.400 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.Status: No Recent Activityarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcbugThis issue describes a behavior which is not expected - a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions