Skip to content

a call to string.Replace does not return on linux. #36328

@Kagamia-MS

Description

@Kagamia-MS

Build and run the following code on Linux + .net core 2.1 or 2.2 SDK.

using System;
class Program
{
    static void Main(string[] args)
    {
        "abc".Replace("\0", "", StringComparison.InvariantCulture);
    }
}

The code results an infinity loop (high cpu usage) and never returns.

Remark:
The code works fine on windows.
The code works fine on .net core 3.1.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions