Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible tiered compilation issue in preview.7 #106427

Closed
SeeminglyScience opened this issue Aug 14, 2024 · 4 comments
Closed

Possible tiered compilation issue in preview.7 #106427

SeeminglyScience opened this issue Aug 14, 2024 · 4 comments
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@SeeminglyScience
Copy link

SeeminglyScience commented Aug 14, 2024

Description

While updating PowerShell/PowerShell to 9.0.0-preview.7.24405.7 we hit a test failure in some unchanged code utilizing xoofx/markdig. After getting a minimal repro together, it appears to only occur after the method has been invoked a few times. It does not appear to be a logic error in markdig and only occurs in preview.7

Reproduction Steps

using System.Runtime.InteropServices;
using Markdig;

while (true)
{
    DoTest();
}

void DoTest()
{
    Console.WriteLine(RuntimeInformation.FrameworkDescription);
    for (int i = 0; i < 1000; i++)
    {
        Markdown.Parse("Some **test string** to write in a file");
    }

    Thread.Sleep(500);


    for (int i = 0; i < 1000; i++)
    {
        Markdown.Parse("Some **test string** to write in a file");
    }
}

csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net9.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Markdig" Version="0.37.0" />
  </ItemGroup>

</Project>

then ran with

dotnet publish --configuration release --self-contained --runtime win-x64
.\bin\release\net9.0\win-x64\publish\MarkdigRuntimeIssue.exe

Expected behavior

Loops forever without error

Actual behavior

After a few loops this exception occurs

Unhandled exception. System.InvalidOperationException: The parser is in an invalid infinite loop while trying to parse inlines for block [ParagraphBlock] at position ($0, 0, 0-38
   at Markdig.Helpers.ThrowHelper.InvalidOperationException(String message)
   at Markdig.Parsers.InlineProcessor.ProcessInlineLeaf(LeafBlock leafBlock)
   at Markdig.Parsers.MarkdownParser.ProcessInlines(InlineProcessor inlineProcessor, MarkdownDocument document)
   at Markdig.Parsers.MarkdownParser.Parse(String text, MarkdownPipeline pipeline, MarkdownParserContext context)
   at Program.<<Main>$>g__DoTest|0_0() in D:\Projects\MarkdigRuntimeIssue\Program.cs:line 15
   at Program.<Main>$(String[] args) in D:\Projects\MarkdigRuntimeIssue\Program.cs:line 7

Regression?

Yes, this does not occur with 9.0.100-preview.6.24328.19

Known Workarounds

No response

Configuration

Which version of .NET is the code running on?

9.0.0-preview.7.24405.7

What OS and version, and what distro if applicable?

Microsoft Windows 10.0.22631

What is the architecture (x64, x86, ARM, ARM64)?

x64

Do you know whether it is specific to that configuration?

Had someone else test on win-arm64, the issue does not occur. So it does appear to be specific to this configuration (ty @jborean93)

Other information

image

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 14, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Aug 14, 2024
@mmitche
Copy link
Member

mmitche commented Aug 14, 2024

@AndyAyersMS

@teo-tsirpanis teo-tsirpanis added area-TieredCompilation-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Aug 14, 2024
@AndyAyersMS
Copy link
Member

Could be the same issue as in #105792. If so, the fix will be in RC1.

Let me check with a recent build.

@AndyAyersMS AndyAyersMS added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed untriaged New issue has not been triaged by the area owner area-TieredCompilation-coreclr labels Aug 15, 2024
@AndyAyersMS AndyAyersMS added this to the 9.0.0 milestone Aug 15, 2024
@AndyAyersMS AndyAyersMS self-assigned this Aug 15, 2024
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@AndyAyersMS
Copy link
Member

Latest main is fine (@ ~rc1 snap). So indeed this is the same bug as #105792.

@SeeminglyScience thank you for trying preview 7 and reporting this.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

No branches or pull requests

4 participants