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

System.ExecutionEngineException occurred in Unknown Module (Fatal error. Internal CLR error. (0x80131506)) #112226

Open
cschuchardt88 opened this issue Feb 6, 2025 · 2 comments
Labels
area-Diagnostics-coreclr needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration

Comments

@cschuchardt88
Copy link

cschuchardt88 commented Feb 6, 2025

Description

When debugging (stepping over) from managed code to unsafe code, then clicking continue in Visual Studio 2022. The application you are debugging crashes dotnet. Ends up hanging dotnet application when you resume it when debugger is attached.

Reproduction Steps

  1. Add breakpoint on line: 4 in Visual Studio 2022.
  2. When breakpoint is hit. Then Step over breakpoint.
  3. Then continue the application.
  4. Now process should be hanging.

Expected behavior

Not to hang or crash.

Actual behavior

Application

Image

Visual Studio

Image

Regression?

No response

Known Workarounds

No response

Configuration

Code

int max = int.MaxValue;
int min = int.MinValue;
int value1 = min * -1;
int value2 = max + 1;
long value3 = value2; // Add break point here, then step over this point.

unsafe
{
    int* maxPtr = &max;
    int* minPtr = &min;
    int* valuePtr1 = &value1;
    int* valuePtr2 = &value2;

    Console.WriteLine($"int.MinValue = {min}           // Pointer: 0x{(ulong)minPtr:x}");
    Console.WriteLine($"int.MaxValue = {max}            // Pointer: 0x{(ulong)maxPtr:x}");
    Console.WriteLine($"int value1 = {value1}             // Pointer: 0x{(ulong)valuePtr1:x}");
    Console.WriteLine($"int value2 = {value2}             // Pointer: 0x{(ulong)valuePtr2:x}");
    Console.WriteLine($"{min} * -1 = {max}        // Does it equal '{max}'? Result: {value1 == max}");
    Console.WriteLine($"{value1} == {value2}           // Does 'value1' equal 'value2'? Result: {value1 == value2}");
}

*.csproj File

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

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

</Project>

Other information

No response

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Feb 6, 2025
@hoyosjs
Copy link
Member

hoyosjs commented Feb 7, 2025

I can't repro this on Windows x64 using runtime version 9.0.1 or 9.0.0. If this still repros - can you please share a crash dump on https://developercommunity.visualstudio.com/home and share back the issue link here please? I tried stepping line by line, stepping in, or just a single step and then continue - I was unable to repro.

@hoyosjs hoyosjs added needs-author-action An issue or pull request that requires more info or actions from the author. and removed untriaged New issue has not been triaged by the area owner labels Feb 7, 2025
@cschuchardt88
Copy link
Author

cschuchardt88 commented Feb 7, 2025

Here you go https://developercommunity.visualstudio.com/t/SystemExecutionEngineException-occurred/10844425

You can try putting a breakpoint within unsafe on one of the int* lines. Than run to that breakpoint. Try Step Into.

@dotnet-policy-service dotnet-policy-service bot added needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration and removed needs-author-action An issue or pull request that requires more info or actions from the author. labels Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Diagnostics-coreclr needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration
Projects
None yet
Development

No branches or pull requests

2 participants