dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.16k stars 4.71k forks source link

corerun.exe unhandled execption at KernelBase.dll when debugging on Windows 7 x64 #7903

Open mazong1123 opened 7 years ago

mazong1123 commented 7 years ago

I just went through https://github.com/dotnet/coreclr/blob/master/Documentation/building/debugging-instructions.md to setup my Visual Studio 2015 for debugging.

I use latest night build dotnet tool to restore & publish following code:

using System;

namespace hl
{
class Program
{
    static int Main(string[] args)
    {
        return 12;
    }
}
}

I'm able to run the program via dotnet run or E:\Personal\github\coreclr\bin\Product\Windows_NT.x64.Debug>CoreRun.exe E:\Personal\coreclrtest\hl\bin\Debug\netcoreapp2.0\win7-x64\publish\hl.dll successfully.

However, if I run the debugger through Visual Studio 2015, it gave me following error:

Unhandled exception at 0x000007FEFD44A06D (KernelBase.dll) in CoreRun.exe: 0xE0434352 (parameters: 0xFFFFFFFF80070002, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x000007FEDCD70000).

And the stacktrace is (not so much useful as I cannot figure out which method was called through the address...):

>   KernelBase.dll!000007fefd44a06d()   Unknown
    coreclr.dll!000007fedcf046b3()  Unknown
    coreclr.dll!000007fedcefddab()  Unknown
    coreclr.dll!000007fedcf0f362()  Unknown
    coreclr.dll!000007fedce3e97a()  Unknown
    CoreRun.exe!000000013fabba6a()  Unknown
    CoreRun.exe!000000013fabd723()  Unknown
    CoreRun.exe!000000013fb72d24()  Unknown
    CoreRun.exe!000000013fb72bc7()  Unknown
    CoreRun.exe!000000013fb72a8e()  Unknown
    CoreRun.exe!000000013fb72d49()  Unknown
    [External Code] 

My Visual Studio Debugging configuration is as following: Command: $(SolutionDir)....\product\Windows_NT.$(Platform).$(Configuration)\corerun.exe

Command Arguments: E:\Personal\coreclrtest\hl\bin\Debug\netcoreapp2.0\win7-x64\hl.dll

Working Directory: $(SolutionDir)....\product\Windows_NT.$(Platform).$(Configuration)

gkhanna79 commented 7 years ago

Is your directory, where you run CoreRun from under VS, containing the same set of binaries as in E:\Personal\github\coreclr\bin\Product\Windows_NT.x64.Debug?

mazong1123 commented 7 years ago

@gkhanna79 The Command setting for INSTALL project (which is the startup project) is $(SolutionDir)....\product\Windows_NT.$(Platform).$(Configuration)\corerun.exe which is actually E:\Personal\github\coreclr\bin\Product\Windows_NT.x64.Debug\corerun.exe.

My steps:

  1. Rebuild INSTALL project.
  2. Right click INSTALL project, then click "Debug -> Start new instance".

It's strange that VS threw an exception. Is VS using this executable during debugging? 20170422222750

raizam commented 7 years ago

Same issue here, window 7 too.

ravilog commented 5 years ago

facing the same issue. is there any update on this?

ivdiazsa commented 9 months ago

Is this issue still relevant considering Windows 7 has been out of support since 2020? Or can we close it now?