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

Exception caught in FormClosing / FormClosed lead to crash in coreclr.dll #41125

Closed
kirsan31 opened this issue Aug 17, 2020 · 33 comments
Closed

Comments

@kirsan31
Copy link

---UPD---
Small repro and further investigations from this comment.
---UPD---

  • .NET Core Version: 3.1.7

  • Have you experienced this same bug with .NET Framework?: NO

Problem description:

Hi guys, need some help here. I just figure out very strange behavior of our app.
Pre requirements:

  • MDI WInForms app.
  • Child form controls binds to BindingSource with data source is some class. e.g. bindingSource1.DataSource = typeof(app.Params);
  • .net core only (on .net framework all ok).
  • x86 only.
  • with debugger attached only.

with all above, when we input some wrong data (for example non numbers in int filed) in textbox and than attempt to close form - app will crash.
Event log:

Faulting application name: app.exe, version: 2.88.7534.41390, time stamp: 0x5f17576d
Faulting module name: coreclr.dll, version: 4.700.20.36602, time stamp: 0x5f1096e7
Exception code: 0xc0000409
Fault offset: 0x0010a890
Faulting application path: D:\save\work\main\app\bin\Debug\netcoreapp3.1\app.exe
Faulting module path: C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\3.1.7\coreclr.dll

From crash dumps:
The error always the same and in ANY random place of our program:

Unhandled exception 0x617CA890 (coreclr.dll) in app.exe.12400.dmp: Stack cookie instrumentation code detected a stack-based buffer overrun.

It's happens with all our forms where BindingSource present. No matter what code (if any) in OnFormClosing. Without OnFormClosing or even with

protected override void OnFormClosing(FormClosingEventArgs e)
{
    e.Cancel = false;
    base.OnFormClosing(e);
}

Expected behavior:

No crash.

Minimal repro:
I spend about 2 hours trying to create simple repro, but failed :(
bindingSource.zip this is not reproduce the problem, but show the structure.

I dunno is this a bug in our app, or in WinForms, or in core, or in V.S?
Windows 10, 2004 x64.
VS 16.7.1

Any advice?

P.S.

When trying to create a repro, I found 2 more bugs in VS 16.7.1 with multi targeting and designer :( Now with data sources. I will update my issue tomorrow...

@kirsan31
Copy link
Author

I've added a new empty form to our app with only 1 texbox, BindingSource and simple DataSource class with one double filed.
The error still reproduce - I am out of Ideas :(

@weltkante
Copy link
Contributor

weltkante commented Aug 18, 2020

with debugger attached only.

I assume the debugger just adds instrumentation which reports the issue, but it probably also exists without debugger, just nobody notices it.

Is it possible to reproduce with WinDbg instead of VS? (Available as app in the store, no need to install any sdk.) Then it might be possible to record a TTD trace which was immensely helpful when looking at memory corruptions.

@kirsan31
Copy link
Author

@weltkante Thanks for the advice, but not repro with WinDbg. App not crash, and no exception in the log other than three FormatException (similar in both cases with simple wrong input and close form after wrong input).
Snipaste_2020-08-19_14-08-52

@weltkante
Copy link
Contributor

That makes it hard to diagnose if it only happens in the VS debugger and at the point it happens you see a seemingly random stack trace. You still can look for similarities in the dumps, like were the random call sites always calling into the same infrastructure? is there another thread which is consistently in the same infrastructure? etc.

If you want to self-diagnose more you could also try disabling or short-circuiting parts of your application which you think are unrelated to narrow down where the problem comes from - especially if you have unsafe/interop code of your own.

Aside from that general advice I don't really have any more ideas, and I'm not sure anyone on the repo would have either if they aren't able to look at a repro themselves. Maybe you have more success asking in the dotnet runtime repo, they are working on a lower level and may be aware how to diagnose things like this, a stack corruption seems serious enough to warrant looking at, especially if you are somewhat confident you aren't causing it yourself.

@RussKie
Copy link
Member

RussKie commented Aug 19, 2020

Without a repro it is hard to pinpoint the culprit, and direct the issue to the relevant team. It can be something broken in Windows Forms, or it can be something broken in CoreCLR, or .NET Runtime, or VS...

@kirsan31
Copy link
Author

Thanks guys, I will continue in this direction:

If you want to self-diagnose more you could also try disabling or short-circuiting parts of your application which you think are unrelated to narrow down where the problem comes from - especially if you have unsafe/interop code of your own.

...

@kirsan31
Copy link
Author

kirsan31 commented Aug 19, 2020

Got it! It's related to Nlog (simple logger instance - no logging at all) and this line of code in constructor of main form:

public Form2()
{
    InitializeComponent();
    _BoldDefFont = new Font(DefaultFont, FontStyle.Bold);
}

and one more condition:
<TieredCompilation>false</TieredCompilation>
😲
I will provide a repro a bit later...

@kirsan31
Copy link
Author

Must have:

  • Nlog loaded: private static Logger _logger = LogManager.GetCurrentClassLogger();
  • private static Font _BoldDefFont; and in constructor: _BoldDefFont = new Font(DefaultFont, FontStyle.Bold);
  • <TieredCompilation>false</TieredCompilation> in csproj.
  • .net core + x86 + VS debugger attached.
  • Wrong input in BindingSource + attempt to close form.
  • Some action after that - really some sort of action (in code or by user), in repro you can move mouse over ittems in File menu for some time.
    bs

Repro proj: bindingSource.zip

So, for now candidates:

  • Nlog
  • WinForms
  • CoreCLR
  • .NET Runtime
  • VS
  • Mix of them?

What do you think - how is dangerous to run such an app in production?

@weltkante
Copy link
Contributor

weltkante commented Aug 20, 2020

Great work getting a repro, I've reduced it further. Any caught exception in FormClosing handler together with a nontrivial workload will trigger this. Additional requirements from your previous post for completeness:

  • .NET Core 3.1 (does not trigger on .NET 5 preview 7)
  • targeting x86
  • TieredCompilation disabled
  • VS debugger attached (otherwise the stack instrumentation is probably off)

Sounds like a runtime issue to me.

What do you think - how is dangerous to run such an app in production?

Depends on the nature of the stack corruption, considering that its only noticeable when the debugger/runtime are specifically looking for stack corruptions this might not be dangerous. Generally stack corruptions can be security issues so this should definitely be looked at to make sure. (After all we don't know if this bug can also be triggered in an ASP.NET Core server application.)

static class Program
{
    [STAThread]
    static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);

        bool first = true;

        var form = new Form { Text = "Try closing me", Width = 400 };
        form.FormClosing += (sender, e) =>
        {
            if (first)
            {
                first = false;
                form.Text = "Wait for crash (or close to exit)";
                e.Cancel = true;

                // caught exception triggers the bug
                try { throw new InvalidOperationException(); }
                catch { }

                // together with a nontrivial workload
                Application.Idle += delegate
                {
                    object data;
                    for (int i = 0; i < 100; i++)
                        data = new byte[10000];
                };
            }
        };

        Application.Run(form);

        MessageBox.Show("Closed successfully (no crash).");
    }
}

@RussKie
Copy link
Member

RussKie commented Aug 20, 2020

Even with all modules loaded I can't trap the exception
image

It is interesting to note, the first time I try to close the child form I get this:

Exception thrown: 'System.FormatException' in System.Private.CoreLib.dll
Exception thrown: 'System.Reflection.TargetInvocationException' in System.Private.CoreLib.dll
Exception thrown: 'System.FormatException' in System.Windows.Forms.dll

The second time I try to close the form I get this:

Exception thrown: 'System.FormatException' in Unknown Module.
Exception thrown: 'System.Reflection.TargetInvocationException' in Unknown Module.
Exception thrown: 'System.FormatException' in Unknown Module.

After which point the app crashes (with some delay as mentioned above):

The thread 0x8ddc has exited with code 0 (0x0).
The program '[35408] bindingSource.exe: Program Trace' has exited with code 0 (0x0).
The program '[35408] bindingSource.exe' has exited with code -1073740791 (0xc0000409).

@danmosemsft this looks like this bug is upstream from Windows Forms.

@kirsan31
Copy link
Author

Not only in FormClosing but in FormClosed too :( Today got it in OnFormClosed caused by this:
_CancellationTokenSource?.Cancel(); (throws inside).
I am somehow scared ...

@kirsan31 kirsan31 changed the title [bug / question] wrong input with BindingSource lead to crash in coreclr.dll Exception caught in FormClosing / FormClosed lead to crash in coreclr.dll Aug 20, 2020
@danmoseley danmoseley transferred this issue from dotnet/winforms Aug 20, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Aug 20, 2020
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@danmoseley
Copy link
Member

Transferring to VM team per @RussKie

@mangod9
Copy link
Member

mangod9 commented Aug 25, 2020

Since this only repros with Debugger attached moving to Diagnostics for now. @kirsan31 are you able to verify that it doesnt occur in .net 5?

@ghost
Copy link

ghost commented Aug 25, 2020

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

@RussKie
Copy link
Member

RussKie commented Aug 26, 2020

@mangod9 I've tested the @weltkante's repro against 3.1.7 and the latest 5.0 RC1 (5.0.100-rc.1.20425.5) in 16.8.0 Preview 3.0 [30421.201.main].
The 3.1.7 version crashes, and the 5.0 version doesn't.

@kirsan31
Copy link
Author

@mangod9

Repro with:
VS v16.8 Preview 2 and .net core 3.1.7.
VS v16.7.2 and .net core 3.1.7.

Doesn't repro with:
VS v16.8 Preview 2 and .net 5.0 Preview 8.

Can't test .net 5.0 with v16.7.2 :( Use previews of the NET Core SDK - doesn't help.

@weltkante
Copy link
Contributor

weltkante commented Aug 26, 2020

Since this only repros with Debugger attached moving to Diagnostics for now

erm, maybe I'm misunderstanding, but just because a debugger notifies you of a bug doesn't mean its causing the bug, or the bug isn't present when nobody is looking.

This shouldn't be about fixing the diagnostic/debugger experience, this should be about investigating whether this is a security-relevant stack corruption present in a .NET Core 3 LTS release.

@mangod9
Copy link
Member

mangod9 commented Aug 26, 2020

Sorry, maybe I misunderstood the original issue. Does the original scenario (or the smaller repro) AV without the debugger attached?

@weltkante
Copy link
Contributor

weltkante commented Aug 26, 2020

no, the diagnostic instrumentation detects a stack overrun, there is never any AV reported, not even with debugger attached

Stack cookie instrumentation code detected a stack-based buffer overrun.

So something writes the stack in some place that its not supposed to write in, typical stack corruption. Not all kinds of stack corruptions lead to AV.

Its unclear what the consequences are, i.e. if this can have any negative effect or just happens to always overwrite unused stack memory.

IMHO the first step is to figure out what this "stack instrumentation" is - some CLR runtime feature enabled when the debugger is attached? something VS instruments by itself? Can it be enabled with windbg attached instead of VS?

Once its clear what diagnostic feature is detecting the overrun it may be easier to enable it in context of a TTD time travel session and look who does the bad write.

@mangod9
Copy link
Member

mangod9 commented Aug 26, 2020

Ok, thanks for clarifying. Will leave in the Diagnostics area for now, to get a better understanding of the stack instrumentation. @tommcdon assume this is Diagnostics or Tracing?

@tommcdon
Copy link
Member

tommcdon commented Aug 26, 2020

Thanks for sending this. I’m able to reproduce the issue on 3.1.7 x86. Since the problem does not (edit) appear to reproduce on 5.0, I’ll change the milestone to 6.0 and we will investigate the root cause and potential fix for 3.1
@davmason

@tommcdon tommcdon removed the untriaged New issue has not been triaged by the area owner label Aug 26, 2020
@tommcdon tommcdon added this to the 6.0.0 milestone Aug 26, 2020
@tommcdon
Copy link
Member

tommcdon commented Aug 27, 2020

Callstack of debuggee at point of failure:

0:000> k
  *** Stack trace for last set context - .thread/.cxr resets it
 # ChildEBP RetAddr  
00 0317e010 7c1b42bf coreclr!__report_gsfailure+0x17 [d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\gs\gs_report.c @ 220] 
01 (Inline) -------- coreclr!DoJITFailFast+0x4 [f:\workspace\_work\1\s\src\vm\jithelpers.cpp @ 5096] 
02 (Inline) -------- coreclr!CrawlFrame::SetCurGSCookie+0x344 [f:\workspace\_work\1\s\src\vm\stackwalk.cpp @ 425] 
03 (Inline) -------- coreclr!CrawlFrame::GotoNextFrame+0x374 [f:\workspace\_work\1\s\src\vm\stackwalk.cpp @ 386] 
04 0317e058 7c1300f2 coreclr!StackFrameIterator::NextRaw+0x6ca [f:\workspace\_work\1\s\src\vm\stackwalk.cpp @ 2736] 
05 (Inline) -------- coreclr!StackFrameIterator::Next+0x17 [f:\workspace\_work\1\s\src\vm\stackwalk.cpp @ 1628] 
06 (Inline) -------- coreclr!Thread::StackWalkFramesEx+0x183 [f:\workspace\_work\1\s\src\vm\stackwalk.cpp @ 975] 
07 0317e618 7c16a2ab coreclr!Thread::StackWalkFrames+0x209 [f:\workspace\_work\1\s\src\vm\stackwalk.cpp @ 1052] 
08 0317e654 7c16a1f1 coreclr!ScanStackRoots+0x57 [f:\workspace\_work\1\s\src\vm\gcenv.ee.cpp @ 150] 
09 0317e670 7c168fb1 coreclr!GCToEEInterface::GcScanRoots+0x99 [f:\workspace\_work\1\s\src\vm\gcenv.ee.cpp @ 179] 
0a (Inline) -------- coreclr!GCScan::GcScanRoots+0x11 [f:\workspace\_work\1\s\src\gc\gcscan.cpp @ 155] 
0b 0317e6c0 7c166008 coreclr!WKS::gc_heap::mark_phase+0x146 [f:\workspace\_work\1\s\src\gc\gc.cpp @ 20721] 
0c 0317e718 7c1650e1 coreclr!WKS::gc_heap::gc1+0x7f [f:\workspace\_work\1\s\src\gc\gc.cpp @ 16346] 
0d (Inline) -------- coreclr!GCToOSInterface::GetLowPrecisionTimeStamp+0x5 [f:\workspace\_work\1\s\src\vm\gcenv.os.cpp @ 946] 
0e 0317e73c 7c1641e7 coreclr!WKS::gc_heap::garbage_collect+0x170 [f:\workspace\_work\1\s\src\gc\gc.cpp @ 17976] 
0f 0317e754 7c164065 coreclr!WKS::GCHeap::GarbageCollectGeneration+0xd1 [f:\workspace\_work\1\s\src\gc\gc.cpp @ 36597] 
10 0317e778 7c13bc38 coreclr!WKS::gc_heap::trigger_gc_for_alloc+0x19 [f:\workspace\_work\1\s\src\gc\gc.cpp @ 13843] 
11 0317e7ac 7c1f78e7 coreclr!WKS::gc_heap::try_allocate_more_space+0x118 [f:\workspace\_work\1\s\src\gc\gc.cpp @ 13934] 
12 0317e7c4 7c13bae3 coreclr!WKS::gc_heap::allocate_more_space+0x18 [f:\workspace\_work\1\s\src\gc\gc.cpp @ 14369] 
13 (Inline) -------- coreclr!WKS::gc_heap::allocate+0x41 [f:\workspace\_work\1\s\src\gc\gc.cpp @ 14400] 
14 0317e7e4 7c13b736 coreclr!WKS::GCHeap::Alloc+0x53 [f:\workspace\_work\1\s\src\gc\gc.cpp @ 35827] 
15 (Inline) -------- coreclr!Alloc+0x13a [f:\workspace\_work\1\s\src\vm\gchelpers.cpp @ 240] 
16 0317e85c 7c13b87a coreclr!AllocateSzArray+0x3e6 [f:\workspace\_work\1\s\src\vm\gchelpers.cpp @ 543] 
17 0317e8e4 07e1e835 coreclr!JIT_NewArr1+0xca [f:\workspace\_work\1\s\src\vm\jithelpers.cpp @ 3145] 
18 0317e93c 7a253ccb WindowsFormsApp2!WindowsFormsApp2.Form1+<>c.<Form1_Load>b__2_1(System.Object, System.EventArgs)+0x45
19 0317e950 7a251576 System_Windows_Forms!System.Windows.Forms.Application+ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32)+0x2b [/_/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs @ 3872] 
1a 0317ea08 7a25334a System_Windows_Forms!System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)+0x386 [/_/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs @ 1983] 
1b 0317ea68 7a253006 System_Windows_Forms!System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)+0x322 [/_/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs @ 3370] 
1c 0317ea98 79fc0eda System_Windows_Forms!System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)+0x46 [/_/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs @ 3233] 
1d 0317eab0 0549fd58 System_Windows_Forms!System.Windows.Forms.Application.Run(System.Windows.Forms.Form)+0x32 [/_/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs @ 1361] 
1e 0317eaf8 7c20992f WindowsFormsApp2!WindowsFormsApp2.Program.Main()+0x60
1f 0317eb04 7c18f9d1 coreclr!CallDescrWorkerInternal+0x34 [F:\workspace\_work\1\s\src\vm\i386\asmhelpers.asm @ 615] 
20 (Inline) -------- coreclr!CallDescrWorkerWithHandler+0x55 [f:\workspace\_work\1\s\src\vm\callhelpers.cpp @ 70] 
21 0317eb90 7c1cc1f5 coreclr!MethodDescCallSite::CallTargetWorker+0x167 [f:\workspace\_work\1\s\src\vm\callhelpers.cpp @ 604] 
22 (Inline) -------- coreclr!MethodDescCallSite::Call+0x11 [f:\workspace\_work\1\s\src\vm\callhelpers.h @ 468] 
23 0317ed0c 7c1cdbf2 coreclr!RunMain+0x1e4 [f:\workspace\_work\1\s\src\vm\assembly.cpp @ 1558] 
24 0317ef70 7c1cd7f4 coreclr!Assembly::ExecuteMainMethod+0x178 [f:\workspace\_work\1\s\src\vm\assembly.cpp @ 1681] 
25 0317f05c 7c1cd613 coreclr!CorHost2::ExecuteAssembly+0x184 [f:\workspace\_work\1\s\src\vm\corhost.cpp @ 460] 
26 0317f0b0 7c0846e6 coreclr!coreclr_execute_assembly+0xd3 [f:\workspace\_work\1\s\src\dlls\mscoree\unixinterface.cpp @ 412] 
27 0317f0d4 7c092e1d hostpolicy!coreclr_t::execute_assembly+0x26 [f:\workspace\_work\1\s\src\corehost\cli\hostpolicy\coreclr.cpp @ 145] 
28 0317f184 7c092a87 hostpolicy!run_app_for_context+0x33d [f:\workspace\_work\1\s\src\corehost\cli\hostpolicy\hostpolicy.cpp @ 247] 
29 0317f1bc 7c093bd1 hostpolicy!run_app+0x57 [f:\workspace\_work\1\s\src\corehost\cli\hostpolicy\hostpolicy.cpp @ 276] 
2a 0317f2c4 7c01d129 hostpolicy!corehost_main+0xf1 [f:\workspace\_work\1\s\src\corehost\cli\hostpolicy\hostpolicy.cpp @ 390] 
2b 0317f338 7c01fa56 hostfxr!execute_app+0x309 [f:\workspace\_work\1\s\src\corehost\cli\fxr\fx_muxer.cpp @ 147] 
2c 0317f3c0 7c01eafe hostfxr!`anonymous namespace'::read_config_and_execute+0xa6 [f:\workspace\_work\1\s\src\corehost\cli\fxr\fx_muxer.cpp @ 502] 
2d 0317f424 7c01cd65 hostfxr!fx_muxer_t::handle_exec_host_command+0xee [f:\workspace\_work\1\s\src\corehost\cli\fxr\fx_muxer.cpp @ 952] 
2e 0317f538 7c0193d6 hostfxr!fx_muxer_t::execute+0x225 [f:\workspace\_work\1\s\src\corehost\cli\fxr\fx_muxer.cpp @ 541] 
2f 0317f5cc 006cf3a3 hostfxr!hostfxr_main_startupinfo+0x76 [f:\workspace\_work\1\s\src\corehost\cli\fxr\hostfxr.cpp @ 33] 
30 0317f720 006cf59e WindowsFormsApp2_exe!exe_start+0x7e3 [f:\workspace\_work\1\s\src\corehost\corehost.cpp @ 220] 
31 0317f73c 006d0dec WindowsFormsApp2_exe!wmain+0x6e [f:\workspace\_work\1\s\src\corehost\corehost.cpp @ 279] 
32 (Inline) -------- WindowsFormsApp2_exe!invoke_main+0x1c [d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 90] 
33 0317f784 756df989 WindowsFormsApp2_exe!__scrt_common_main_seh+0xfa [d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 288] 
34 0317f794 772374a4 kernel32!BaseThreadInitThunk+0x19 [clientcore\base\win32\client\thread.c @ 64] 
35 0317f7f0 77237474 ntdll!__RtlUserThreadStart+0x2f [minkernel\ntdll\rtlstrt.c @ 1153] 
36 0317f800 00000000 ntdll!_RtlUserThreadStart+0x1b [minkernel\ntdll\rtlstrt.c @ 1070] 

@RussKie
Copy link
Member

RussKie commented Aug 27, 2020

Since the problem does appear to reproduce on 5.0

I don't think it is, only 3.1 appears to be affected.

@davmason
Copy link
Member

@tommcdon I'll take a look, my hunch is that it's related to #40637. If not it suggests that the debugger is corrupting the stack somehow

@davmason
Copy link
Member

I don't have answers yet, but it is not due to #40637. What's happening here is we expect that the linked list of Frames we keep will only have either valid frames or FRAME_TOP (-1) but we end up with a NULL Frame in the list. CrawlFrame::SetCurGSCookie will call DoJITFailFast (and therefore __report_gsfailure) if provided a NULL pGSCookie.

@davmason
Copy link
Member

This is caused by #2240. I was able to debug to the point where I saw that the frame chain was corrupted, and then by searching through issues that were fixed between 3.1 and 5.0 found this suspiciously similar issue.

I don't know exactly why this only repros under the debugger, but I validated that applying the fix for #2240 makes the provided app no longer crash so I am pretty confident this is the same issue.

@janvorli is there anything preventing us from porting the fix back to 3.1?

@janvorli
Copy link
Member

It looks like the port should just work (only the change in src/coreclr/src/vm/i386/excepx86.cpp from my change is relevant, the other part of the change was a removal of a temporary workaround for the issue).

@davmason
Copy link
Member

@kirsan31 @weltkante would one of you be able to verify the fix for #2240 locally? I verified that the sample app provided no longer crashes, but it would be nice to make sure that it solves the original issue for you before going through the servicing process.

I created a release on my fork of coreclr with binaries with the fix: https://github.com/davmason/coreclr/releases/tag/0.0.1

To test it out you would have to:

  • Close everything using dotnet core
  • Make a backup of everything in C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\3.1.7 to somewhere safe so you can restore it after (I usually copy the whole folder to 3.1.7-clean in the same directory, so when I'm done I can delete the 3.1.7 folder and rename 3.1.7-clean and know everything is back to normal)
  • Copy the files in that release to C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\3.1.7
  • Restart VS and run your scenario that was crashing
  • Once you've validated it, you can delete C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\3.1.7 and restore from your clean backup and everything will be back to normal

Please let me know if you run in to any issues

@weltkante
Copy link
Contributor

I've tested with the original and the reduced repro scenario, thats both fixed, but lets wait for @kirsan31 in case he wants to test in his actual environment. As far as I'm concerned the fix looks good, great work.

@kirsan31
Copy link
Author

kirsan31 commented Aug 29, 2020

@davmason
Tested with our original project and provided repro - all works good.
Thank you!

@davmason
Copy link
Member

Thank you both for validating the fix. I opened a PR to port it back to 3.1 in dotnet/coreclr#28090.

@davmason
Copy link
Member

Fixed in dotnet/coreclr#28090

@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants