Skip to content

A call to string.Replace does not terminate #1060

Closed

Description

@VladimirReshetnikov

Compile and run:

using System;

static class Program
{
    static void Main()
    {
        var s = "hi".Replace("\u0640", "", StringComparison.InvariantCulture);
        Console.WriteLine(s);
    }
}

ACTUAL:
The call to method Replace does not terminate (apparently, there is an infinite loop).

EXPECTED:
The program prints hi.


OS ver is Microsoft Windows [Version 10.0.17763.914]

%SystemRoot%\System32\kernel32.dll
File version: 10.0.17763.475
File SHA1: 8de080d3295fb21475715d4051ec9dbc3df972ba


The issue occurs both on:

%ProgramFiles%\dotnet\shared\Microsoft.NETCore.App\3.1.0\.version
65f04fb6db7a5e198d05dbebd5c4ad21eb018f89
3.1.0

and

%ProgramFiles%\dotnet\shared\Microsoft.NETCore.App\5.0.0-alpha.1.19564.1\.version
c77948d92a2f950140f09384f057cb893ec3955a
5.0.0-alpha.1.19564.1

Activity

  1. added
    untriaged
    on Dec 19, 2019
  2. GrabYourPitchforks commented on Dec 19, 2019

    @GrabYourPitchforks
    Member

    This and #1062 are likely NLS bugs. I'll follow up with the Windows localization team offline.

  3. GrabYourPitchforks commented on Dec 21, 2019

    @GrabYourPitchforks
    Member

    Followed up with the NLS team. They helped walk me through the scenario and we've determined that this is in fact a .NET bug. We'll make the change on our side.

  4. added and removed
    untriaged
    on Dec 21, 2019
  5. added this to the 5.0 milestone on Dec 21, 2019
  6. added
    Servicing-consider
    on Feb 11, 2020
  7. GrabYourPitchforks commented on Feb 11, 2020

    @GrabYourPitchforks
    Member

    I'm reopening the issue because it may be a candidate for servicing.

  8. removed
    Servicing-consider
    on Feb 12, 2020
  9. ghost locked as resolved and limited conversation to collaborators on Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions