diff options
author | Jan Kotas <jkotas@microsoft.com> | 2019-02-19 20:48:19 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-19 20:48:19 -0800 |
commit | a054254d2448314f1d24ef319b18dfd7a91747f6 (patch) | |
tree | 03fc27bc4ee2764e3e818e1b44d7de2426423fc5 /src/vm/excep.cpp | |
parent | d98d827d7d80960e0ffc3c283a8199baf619d94b (diff) | |
download | coreclr-a054254d2448314f1d24ef319b18dfd7a91747f6.tar.gz coreclr-a054254d2448314f1d24ef319b18dfd7a91747f6.tar.bz2 coreclr-a054254d2448314f1d24ef319b18dfd7a91747f6.zip |
Early out from vectored exception handler on uninitialized threads (#22702)
Fixes #22698
Diffstat (limited to 'src/vm/excep.cpp')
-rw-r--r-- | src/vm/excep.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/vm/excep.cpp b/src/vm/excep.cpp index 17919701fe..019ec2543d 100644 --- a/src/vm/excep.cpp +++ b/src/vm/excep.cpp @@ -8017,11 +8017,11 @@ LONG WINAPI CLRVectoredExceptionHandlerShim(PEXCEPTION_POINTERS pExceptionInfo) // // WARNING: This function could potentially throw an exception, however it should only // be able to do so when an interop debugger is attached - if(g_pDebugInterface != NULL) + if (g_pDebugInterface != NULL) { - if(g_pDebugInterface->FirstChanceSuspendHijackWorker(pExceptionInfo->ContextRecord, + if (g_pDebugInterface->FirstChanceSuspendHijackWorker(pExceptionInfo->ContextRecord, pExceptionInfo->ExceptionRecord) == EXCEPTION_CONTINUE_EXECUTION) - return EXCEPTION_CONTINUE_EXECUTION; + return EXCEPTION_CONTINUE_EXECUTION; } #endif @@ -8041,6 +8041,12 @@ LONG WINAPI CLRVectoredExceptionHandlerShim(PEXCEPTION_POINTERS pExceptionInfo) } #endif + if (NtCurrentTeb()->ThreadLocalStoragePointer == NULL) + { + // Ignore exceptions early during thread startup before the thread is fully initialized by the OS + return EXCEPTION_CONTINUE_SEARCH; + } + bool bIsGCMarker = false; #ifdef USE_REDIRECT_FOR_GCSTRESS |