summaryrefslogtreecommitdiff
path: root/src/vm/excep.cpp
AgeCommit message (Collapse)AuthorFilesLines
2019-09-27Port to Release/3.1 - enabling MHR support (#26803)Jan Vorlicek1-1/+11
* Move JIT_WriteBarrier that is modified at runtime to a dynamically allocated memory instead of making a page in libcoreclr.dylib RWX. * Fix JIT_Stelem_Ref calls to JIT_WriteBarrier * Update PAL to add MEM_JIT flag for allocations and reservations of executable memory. * Update native runtime in EH and stack unwinding areas so that it can unwind from the write barrier copy. That code has no unwind info, so without special handling, runtime would not be able to unwind from it.
2019-07-11Fix handling of NullReferenceException in VSD on ARM (#25627)Jan Vorlicek1-0/+33
* Fix handling of NullReferenceException in VSD on ARM There was a problem with handling NullReferenceExceptionHandling stemming from virtual dispatch stub on ARM Linux. While the primary exception was handled correctly, if the exception was rethrown or another exception was thrown from the catch handler, it was reported as unhandled even though there was a proper handler. The issue was caused by exception unwinding that was unable to unwind past the frame of the virtual dispatch stub in this case. Such stub is generated at runtime and there is no unwind info for it. The fix is to explicitly check for the stub frame and skip it during first and second pass of exception handling.
2019-07-03arm64singlestepper (#25512)Steve MacLean1-2/+2
Add single step emulation for arm64 Linux Add a copy and rework armsinglestepper to arm64singlestepper Add arm64 emulation of all armv8 user space instructions which read or write PC. - ADR, ADRP - Branch instructions: B, BL, B.cond, BR, BLR, RET - LDR (literal) * Add FEATURE_EMULATE_SINGLESTEP * Enable for ARM64 linux * Debugging fixes Fix IsSSFlagEnabled bug Fix opcode type Fix code buffer asserts Fix CBZ typo Fix BitExtract Fix m_targetPc Minimize written instructions Fix comments Fix Bypass address truncation Fix false assert Add additional logging Use %lx to log addresses Remove stray LOG Remove stray assert
2019-06-29Fix GCStress issue on x86 and Arm (#25445)Brian Sullivan1-0/+5
* Fix GCStress issue on x86 and Arm32 When we write one of the new gc stress instruction, such as INTERRUPT_INSTR_PROTECT_FIRST_RET we might be writing it in the epilog region on x86 or ARM as a direct call can be the last instruction before an epilog. (This isn't allowed on x64) This fix expands the set of instructions we are allowed by IsMarkerInstr() toinclude these newly added gc stress instructions. added comment to GetGcMarkerExceptionCode Fix DAC build * Code review feedback * Additional code review chnages
2019-06-20Fix eventpipe filtering (#25221)Sung Yoon Whang1-1/+1
* Add DOTNET_TRACE_CONTEXT and change macros to use DOTNET_TRACE_CONTEXT instead of MCGEN_TRACE_CONTEXT * Fixing macro definitions * eventing codegen scripts now generates EventPipe trace contexts * Fix macros to use the EVENTPIPE_TRACE_Context * Fix linux build * Fix windows build * Update Eventpipe provider context at EtwCallbackComon * break in switch * Update rundown provider context manually * PR feedback * Eventpipe->EventPipe * cleanup in codegen script
2019-06-02Improve fatal err msg (#24390)Dan Moseley1-13/+3
* Improve fatal err msg * Match SO format * a * Remove dead define * More adjustments to ex msg * And PAL * Remove special case for SOE * Remove excess Debug.Assert newline * Remove excess newline * typo * New format * Remove DebugProvider redundancy * Adjustments * Remove preceding newline * Make other SOE and OOM consistent * Tidy up assertion msg * Fix missing newline after inner exception divider * CR when no inner exception * ToString never CR terminated * disable corefx tests temporarily
2019-05-29Remove all uses of CanRunManagedCode() (#24847)Aaron Robinson1-24/+1
* Remove all uses of CanRunManagedCode()
2019-05-28Cleanup unnecessary code in exception formatting (#24797)Jan Kotas1-18/+4
* Cleanup unnecessary code in exception formatting * Delete fNeedFileInfo argument for GetStackTrace Fixes #8694
2019-05-27Call derived ToString on inner exceptions (#24793)Dan Moseley1-3/+3
* Remove special Appx path and METHOD__EXCEPTION__TO_STRING * Remove Exception.ToString(bool, bool) * Remove Exception.InternalToString and callers * Cache message
2019-05-08Remove more MDA support code (#24457)Steve MacLean1-13/+0
* Remove more MDA support code * PR Feedback
2019-05-01Adjust some terms (#24351)Dan Moseley1-2/+2
2019-04-26Typos (#24280)John Doe1-1/+1
* thier -> their * exeption -> exception * Estbalisher -> Establisher * neeed -> need * neeed -> need * neeeded -> needed * neeeded -> needed * facilitiate -> facilitate * extremly -> extremely * extry -> extra
2019-04-13Delete COMPlus_FinalizeOnShutdown (#23595)Jan Kotas1-11/+0
This compat quirk is increasingly more broken since the framework is generally not compatible with, and we have not heard anybody actually using it. Changed Environment.HasShutdownStarted to unconditionally return false. It does not make sense for it to ever return true with shutdown finalization disabled.
2019-04-03Remove ADID and ADIndex from CoreCLR (#23588)David Wrighton1-5/+0
- Remove concept of AppDomain from object api in VM - Various infrastructure around entering/leaving appdomains is removed - Add small implementation of GetAppDomain for use by DAC (to match existing behavior) - Simplify finalizer thread operations - Eliminate AppDomain::Terminate - Remove use of ADID from stresslog - Remove thread enter/leave tracking from AppDomain - Remove unused asm constants across all architectures - Re-order header inclusion order to put gcenv.h before handletable - Remove retail only sync block code involving appdomain index
2019-03-27Extend WindowsEventLog test for EntryPointFilter (#23178)Steve MacLean1-4/+16
* Extend WindowsEventLog test Verify EntryPointFilter solves logging problem with native host swallowing exceptions WindowsEventLog only look at new entries WindowsEventLog remove time check Add mechanism to corhost to emulate host swallowing all exceptions * PR feedback
2019-03-16Fix x86 dumps from HandleFatalError showing misleading callstack (#23289)Elinor Fung1-0/+2
2019-03-11Add EntryPointFilter option (#23054)Steve MacLean1-21/+35
* Add EntryPointFilter
2019-03-07Cleanup unused hosting interfaces (#23091)Jan Kotas1-27/+0
2019-03-06Cleanup old code (#23053)Steve MacLean1-2/+2
Remove IsContinuableException declaration & fix comment Clean up ThreadBaseRedirectingFilter Clean up comment Cleanup dead code
2019-03-05Remove dead AppDomain unload code (#23026)Steve MacLean1-6/+0
2019-03-05Remove dead ContainToAppDomain (#23021)Steve MacLean1-14/+2
* Remove dead ContainToAppDomain * Respond to feedback
2019-02-21Remove unused perfcounter code (#22742)Sung Yoon Whang1-2/+0
* removing references to COUNTER_ONLY, ENABLE_PERF_COUNTERS in src/vm directory * removing perfcounters* files * Fix build * Remove PerfCounterSupportedBuild * Some more cleanup on the GC side
2019-02-19Early out from vectored exception handler on uninitialized threads (#22702)Jan Kotas1-3/+9
Fixes #22698
2019-01-23Remove all traces of FEATURE_STACK_PROBE. (#22149)Filip Navara1-210/+5
2018-12-15Fix warning causing error in warning as error (#21557)Ben Adams1-2/+2
c:\github\coreclr\src\vm\excep.cpp(4489): error C2220: warning treated as error - no 'object' file generated [C:\GitHub\coreclr\bin\obj\Windows_NT.x64.Release\src\vm\wks\cee_wks.vcxproj] c:\github\coreclr\src\vm\excep.cpp(4489): warning C4800: 'BOOL': forcing value to bool 'true' or 'false' (performance warning) [C:\GitHub\coreclr\bin\obj\Windows_NT.x64.Release\src\vm\wks\cee_wks.vcxproj]
2018-12-10Refactor internal System.AppDomain out of CoreLib (#21460)Jan Kotas1-25/+5
Fixes #21028
2018-12-10Delete vm/context.* (#21459)Jan Kotas1-253/+0
* Delete vm/context.* Leftover from remoting
2018-11-09Delete dead/unreachable code related to remoting (#20880)Jan Kotas1-9/+9
2018-11-06NITsAndrew Au1-4/+5
2018-11-06More code review feedbackAndrew Au1-1/+11
2018-11-06Code review feedbackAndrew Au1-0/+31
2018-11-05 Fiber-friendly Vectored Exception Handling (#20746)Tobias Loew1-0/+18
* Fiber-friendly Vectored Exception Handling Check during exception handling if the cached and the current stack-base match to detect Fibers.
2018-10-08Remove mentions of Rotor from codebase (#20298)Austin Wise1-4/+0
* Moving parsing from TypeNameParser ctor to a separate method. It seems a bit odd to have the constructor parsing and then use a dummy method (MakeRotorHappy) to make it look more normal. * Remove CorMarkThreadInThreadPool. It is neither referenced nor exported. * Remove reference to rotor from securitywrapper.h * Remove reference to rotor from Strike/vm.cpp. This file is only built for Windows. * Remove reference to rotor from debugreturn.h This is the only file the defines these macros, so there is no need to undef them first. * Remove unused code refering to rotor from PAL. * Remove references to Rotor from PAL. * Remove references to deleted tests from DisabledTests.txt I can't find any evidence that this file is actually used. * Remove unneeded casts. * Remove dead and misleading code from profilinghelper.cpp. FEATURE_PROFAPI_EVENT_LOGGING is always defined when PROFILING_SUPPORTED is defined. And the entire contents of profilinghelper.cpp is surrounded with "ifdef PROFILING_SUPPORTED". So all sections in "ifndef FEATURE_PROFAPI_EVENT_LOGGING" are dead. Furthermore, in coreclr this does not use the eventlog, so the macro name is misleading. * Remove dead code in excep.cpp. This entire function is surrounded with "ifndef FEATURE_PAL". * Remove refererences to rotor from safemath.h This does not appear to cause any compile problems, so nobody was using safemath.h without _ASSERTE defined. Also S_SIZE_T_WP64BUG is not used anywhere. * Remove dead code from palclr.h. I don't know why these check to see if the macro is undefined immediately after defining them. Also the comment appears to reference some unions that are no longer in this file. * Expose ISymUnmanagedWriter2 from SymWriter as required by COM. The comment talks about the C# compiler using this, however I cannot see a way for the C# compiler to get an instance of this. It is only used internally by AssemblyBuilder and not exposed otherwise. * Restore check for _ASSERTE in safemath.h. On Windows sometimes that this file is included without _ASSERTE being defined. As the existing comment suggests, it appears that SOS explicitly does not want _ASSERTE to do anything.
2018-10-07Remove mention of rotor from comments (#20297)Austin Wise1-2/+1
* Remove old reference to Rotor in documentation. All remaining references relate to rotor's role in CoreCLR history. * Remove rotor comment from enummem.cpp. I can find no evidence that the presence of g_pStressLog is conditional on FEATURE_PAL being defined. * Remove old todo, DbgDllMain looks for thread detach. * Update nativepipeline.h comment refernce to rotor. All unix-like systems except android have FEATURE_DBGIPC_TRANSPORT_DI defined, hence "most unix-like platforms". * Update some comments to not refer to Rotor. * Remove some more references to Rotor from comments. * Remove old comment. Though maybe this macro should be removed and everywhere use the & operator. It appears there are only two places that use this macro.
2018-09-25Fix hijacking for ARM/ARM64/x86 on Unix (#20042)Jan Vorlicek1-12/+38
* Fix hijacking for ARM/ARM64/x86 on Unix We were not checking the case when we have interrupted a thread inside of a function epilog for other architectures than amd64. When such an interruption happens, GS cookie check in a stack walking has failed, since we are unable to decode GS cookie location when the IP is in epilog. This fix implements IsIPInEpilog for all architectures and makes the check unconditional.
2018-08-28Break into debugger on assertion failures (#19702)Jan Kotas1-43/+2
* Break into debugger on assertion failures Assertion failures terminated the process by default that made them hard to debug. Changed them to break into debugger or trigger fail fast when the debugger is not attached. This should make the day-to-day CoreCLR developer experience better and it is simular to what we had on .NET Framework in the past. * Fix Unix build break Add RaiseFailFastException to Unix PAL
2018-08-23Enable unloading of AssemblyLoadContext (#18476)Jan Vorlicek1-1/+2
Enable assembly unloading * Allow PInvoke methods on collectible assemblies * Fix test unloadability Several hundreds of tests were using Helper class that created GCHandle, but never freed it. That prevented unloading of those tests. The change modifies the Helper class to keep the handle in a finalizable object. Several GCHandle related tests were not freeing the GCHandle they allocated, so this change adds freeing them to enable the unloading. * Add missing error messages to the resources * Fix shuffle thunk cache for unloadability * Add GetLoaderAllocator to ICLRPrivBinder
2018-08-21Handle null byref in helper (#19571)Carol Eidt1-0/+2
Add JIT_ByRefWriteBarrier to IsIPInMarkedJitHelper so that a null dereference will be handled. Fix #19444
2018-08-11Make RuntimeType sealed and deleted support for introspection only loads ↵Jan Kotas1-1/+0
(#19427) - Sealed Runtime makes `is RuntimeType` and similar checks faster. These checks are fairly common in reflection. - Delete support for introspection only loads from the runtime. We do not plan to use in .NET Core. The support for introspection loads inherited from RuntimeType and thus it is incompatible with sealed RuntimeType.
2018-05-24Typo (#18122)John Doe1-1/+1
* acquringing -> acquiring * Activ -> Active * activley -> actively * acutal -> actual * bIncomingIPAdddefed -> bIncomingIPAddRefed * adddr -> addr * readding -> reading * Addfunction -> AddFunction * additionnal -> additional * Additonal -> Additional * Additonally -> Additionally * Addresss -> Address * addtion -> addition * aded -> added * aditional -> additional * adjustements -> adjustments * Adress -> Address * afer -> after * aformentioned -> aforementioned * afte -> after * agains -> against * agaisnt -> against * aggresively -> aggressively * aggreates -> aggregates * aggregious -> egregious * aginst -> against * agregates -> aggregates * Agressive -> Aggressive * ahve -> have * ajdust -> adjust * ajust -> adjust * alement -> element * algoritm -> algorithm * alighnment -> alignment * alignmant -> alignment * constraits -> constraints * Allcator -> Allocator * alllocate -> allocate * alloacted -> allocated * allocatate -> allocate * allocatoror -> allocator * alloctaed -> allocated * alloction -> allocation * alloted -> allotted * allt he -> all the * alltogether -> altogether * alocate -> allocate * alocated -> allocated * Alocates -> Allocates * alogrithm -> algorithm * aloocate -> allocate * alot -> a lot * alwasy -> always * alwyas -> always * alwys -> always
2018-04-19GCStress: try to reduce races and tolerate races better (#17330)Andy Ayers1-16/+21
This change addresses races that cause spurious failures in when running GC stress on multithreaded applications. * Instruction update race Threads that hit a gc cover interrupt where gc is not safe can race to overrwrite the interrupt instruction and change it back to the original instruction. This can cause confusion when handling stress exceptions as the exception code raised by the kernel may be determined by disassembling the instruction that caused the fault, and this instruction may now change between the time the fault is raised and the instruction is disassembled. When this happens the kernel may report an ACCESS_VIOLATION where there was actually an attempt to execute a priveledged instruction. x86 already had a tolerance mechanism here where when gc stress was active and the exception status was ACCESS_VIOLATION the faulting instruction would be retried to see if it faults the same way again. In this change we extend this to tolerance to cover x64 and also enable it regardless of the gc mode. We use the exception information to further screen as these spurious AVs look like reads from address 0xFF..FF. * Instrumentation vs execution race The second race happens when one thread is jitting a method and another is about to call the method. The first thread finishes jitting and publishes the method code, then starts instrumenting the method for gc coverage. While this instrumentation is ongoing, the second thread then calls the method and hits a gc interrupt instruction. The code that recognizes the fault as a gc coverage interrupt gets confused as the instrumentation is not yet complete -- in particular the m_GcCover member of the MethodDesc is not yet set. So the second thread triggers an assert. The fix for this is to instrument for GcCoverage before publishing the code. Since multiple threads can be jitting a method concurrently the instrument and public steps are done under a lock to ensure that the instrumentation and code are consistent (come from the same thread). With this lock in place we have removed the secondary locking done in SetupGcCoverage as it is no longer needed; only one thread can be instrumenting a given jitted method for GcCoverage. However we retain a bailout` clause that first looks to see if m_GcCover is set and if so skips instrumentation, as there are prejit and rejit cases where we will retry instrumentation. * Instruction cache flushes In some cases when replacing the interrupt instruction with the original the instruction cache was either not flushed or not flushed with sufficient length. This possibly leads to an increased frequency of the above races. No impact expected for non-gc stress scenarios, though some of the code changes are in common code paths. Addresses the spurious GC stress failures seen in #17027 and #17610.
2018-04-05Rename conflicting definitions VER_MAJOR/MINORVERSION macros (#17364)Jan Kotas1-31/+0
* Rename conflicting definitions of VER_MAJOR/MINORVERSION These macros are defined by Windows SDK. They were overload to mean CLR version that was causing interesting redefinition issues. * Delete workaround for redefined Windows SDK macros * Delete ProjectN version * Delete dead code
2018-03-31Delete dead code to support OSes prior to Windows 7 (#17367)Jan Kotas1-153/+59
2018-03-27Failfast windows event log (#16875)Sung Yoon Whang1-9/+46
* Add FailFast error log to Windows Event Log * change const wchar * to lpcwstr * Enable sending unhandled exception info to Windows Event Log * Change log format to match console output and address PR comments * Remove more comments * Change the order DoReportForUnhandledException to do a safety check first before calling managed code * Fix parameter name in header file * Add Windows Event logging in DefaultCatchHandler and remove DoReportForUnhandledException * Add back event reporting for ignored unhandled exception cases, fix broken UNIX builds * Fix more broken unix builds * Fix typo * Address PR comments
2018-02-21Show the expected stack trace from a rethrown exception. (#16464)Alexandre Teoi1-3/+1
* Show the expected stack trace from a rethrown exception. Fix #15780 * Remove now unused methods - StackTraceArray::AppendSkipLast - StackTraceElement::PartiallyEqual - StackTraceElement::PartialAtomicUpdate
2018-01-21Remove AppDomainLeaks configuration option (#15956)antofik1-15/+0
Removed all usages of AppDomainLeaks configuration option and CHECK_APP_DOMAIN_LEAKS feature Fix #12094
2017-11-29[Local GC] Fail fast on exceptions within a standalone GC (#15290)Sean Gillespie1-1/+2
2017-10-24Delete dead code (#14673)Jan Kotas1-2/+1
- assemblyusagelog - compatibilityflags - xmlparser
2017-06-12[Arm64/Unix] Add 64K page support (#10981)Steve MacLean1-1/+1
* [Arm64/Unix] Support 64K pages * GC move GCToOSInterface::Initialize() into InitializeGarbageCollector()
2017-05-17Finish deleting dead CAS code from CoreLib (#11436)Jan Kotas1-32/+18
Fixes #9321 and deletes CleanupToDoList.cs Delete unmanaged security implementation