Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Fix crash during shutdown - #1032

Merged
MichalStrehovsky merged 1 commit into
dotnet:masterfrom
jkotas:shutdown-crash
Mar 19, 2016
Merged

MichalStrehovsky merged 1 commit into
dotnet:masterfrom
jkotas:shutdown-crash

Conversation

@jkotas

@jkotas jkotas commented Mar 19, 2016

Copy link
Copy Markdown
Member

RyuJIT started calling IEEMemoryManager interface methods late during process shutdown. Since IEEMemoryManager is implemented in C#, it leads to crashes caused by attempts to run managed code on CLR that has been shutdown already.

The fix is to switch the implementation of IEEMemoryManager from C# to C++ in jitinterface wrapper .dll. I have also added __stdcall modifiers as appropriate to make the code ready for x86.

RyuJIT started calling IEEMemoryManager interface methods late during process shutdown. Since IEEMemoryManager is implemented in C#, it leads to crashes caused by attempts to run managed code on CLR that has been shutdown already.

The fix is to switch the implementation of IEEMemoryManager from C# to C++ in jitinterface wrapper .dll. I have also added __stdcall modifiers as appropriate to make the code ready for x86.
@jkotas

jkotas commented Mar 19, 2016

Copy link
Copy Markdown
Member Author

cc @MichalStrehovsky

@jkotas

jkotas commented Mar 19, 2016

Copy link
Copy Markdown
Member Author

@pgavlin I suspect that the cleanup during RyuJIT shutdown that you have added will be causing troubles in other situations as well. It may be a good idea to stop cleaning up during process shutdown - it is what we do every else in CLR.

@MichalStrehovsky

Copy link
Copy Markdown
Member

LGTM

MichalStrehovsky added a commit that referenced this pull request Mar 19, 2016
@MichalStrehovsky
MichalStrehovsky merged commit 499c793 into dotnet:master Mar 19, 2016
@jkotas
jkotas deleted the shutdown-crash branch March 20, 2016 04:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants