Age | Commit message (Collapse) | Author | Files | Lines |
|
* Implement instantiating and unboxing through portable stublinker code
- Handle only the cases with register to register moves
- Shares abi processing logic with delegate shuffle thunk creation
- Architecture specific logic is relatively simple
- Do not permit use of HELPERREG in computed instantiating stubs
- Fix GetArgLoc such that it works on all architectures and OS combinations
Add a JIT stress test case for testing all of the various combinations
- Use the same calling convention test architecture that was used as part of tail call work
Rename secure delegates to wrapper delegates
- Secure delegates are no longer a feature of the runtime
- But the wrapper delegate lives on as a workaround for a weird detail of the ARM32 abi
|
|
|
|
When string.Replace is given a target string with zero collation weight, it would enter an infinite loop. It is now changed so that the call to Replace terminates when such a condition is encountered.
|
|
* fix principal policy for new threads
Fixes #31717
Co-authored-by: Marco Rossignoli <marco.rossignoli@gmail.com>
|
|
Remove BMI2 from ASCII and UTF-16 processing hot paths, as not all processors have optimized implementations of pext/pdep
|
|
(#27996)
|
|
|
|
|
|
IsDaylightSavingTime_CasablancaMultiYearDaylightSavings fails on rhel.8
When parsing the tzdata POSIX string that contains an 'n' Julian date, we are currently throwing an exception, and then falling back to a TimeZoneInfo without DST enabled. However, this is a mistake because there are other DST transitions that were read from the tzdata file that are valid and usable. We shouldn't be throwing that information away.
So instead, we now skip the POSIX string if we detect an unsupported 'n' Julian date, and just use the last transition as the AdjustmentRule for all the DateTimes in the future. This way we can still make DST determinations correctly for some DateTimes.
Fix https://github.com/dotnet/corefx/issues/42192
|
|
(#27501)
ReadAsyncInternal is correctly passing its token into the two call sites where it delegates directly to the underlying stream, but in one place it calls through ReadBufferAsync, which is currently not defined to take a token. Fix that, and pass the token through.
|
|
1. Fix NullReferenceException. When the filter args exceeded the
hard-coded size limit GetDataFromController would return data = null.
The code previously asserted that data was not null and triggered NRE
when it was. The fix correctly null checks the value instead of
asserting and uses an empty args dictionary in this case, the same as if
filter args had been empty to begin with.
2. ETW has always limited filter args to 1024 bytes but EventPipe has no
such restriction. When using DiagnosticSourceEventSource it can be
useful to specify a larger filter arg blob. I can't do anything about
ETW's restriction but there is no need for the runtime to force
EventPipe to be equally limited. The larger size also reduces the chance
that we need to hit the fallback path above causing filter args to be
ignored.
|
|
Port https://github.com/dotnet/coreclr/pull/27210 to release/3.1
|
|
(#27217)
* Wrap MoveNext Action for TPL event tracing
Wraps the MoveNext action of the AsyncStateMachineBox in a
continuation wrapper when async causality tracing is on so that the
TPL event source can find the task that is associated with a
continuation. Does not wrap otherwise.
* Clarifying comment
* removing trailing whitespace
* code review feedback.
Makes AsyncMethodBuilderCore.TryFindContinuationTask check to
whether the target of a continuation is itself a task, as a fall-back
to checking to see if the continuation is a ContinuationWrapper
* Got rid of unnecessary null checks
|
|
* Use win32 api directly for workingset counter
* Fix build warnings
* Removing useless code
* more cleanup
* remove size annotation
* remove useless comment
* Move all the changes to Environment.WorkingSet and remove it from RuntimeEventSourceHelper
* removing useless usings
* Use kernel32.dll instead of psapi.dll
* Code review feedback
* Remove newline change
* More code review nits
|
|
Change multiplying by (x * (1.0 / BigValue)) on (x / BigValue).
Fix #41380
|
|
|
|
In 3.0 we have fixed the formatting to use the abbreviated genitive month names when having "d" format specifier followed by "MMM". This fix is good as original formatting specs required but we needed to support the parsing when we have such genitive names.
|
|
(#26366)
User may have extra expectations for the privatly owned array pools.
For example there could be an expectation that array never contains negative numbers (since user never puts them there). Uninitialized allocations can break such expectations.
|
|
(#26356)
BinaryReader.ReadChars incorrectly read more than necessary from the underlying Stream when multi-byte characters straddled the read chunks.
Fixes https://github.com/dotnet/corefx/issues/40455
|
|
(#25844) (#26056)
* Allow for interface implementations in EventSource.WriteEventVarArgs
* Also account null ref types and nullable types
* fix error in comment and simplify first part of boolean logic
* Update src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs
Co-Authored-By: Noah Falk <noahfalk@users.noreply.github.com>
|
|
that the intrinsic and managed form are deterministic. (#26017)
* Updating Math.Round and MathF.Round to be IEEE compliant so that the intrinsic and managed form are deterministic. (#25901)
* Updating Math.Round and MathF.Round to be IEEE compliant so that the intrinsic and managed form are deterministic.
* Fixing the Math.Round and MathF.Round handling for values greater than 0.5 and less than 1.0
* Applying formatting patch.
* Adding a comment about only having the roundToNearestTiesToEven code path
|
|
* Make a dedicated polling thread for EventCounters
* Cleanup
* remove debug prints
* nit
* Fix comment
* addressing issues from code review
* Fix an assertion from getting fired when we have multiple listeners
* Fix a test issue
* code review feedback
* Fix a potential deadlock
* Fix another deadlock
* Allow s_sleepDurationInMilliseconds to be reset to a larger value
* More issues fix
* Let thread wake up from sleep if needed
* Some suggestions for the counters fix.
The resulting behavior should be the same as what is there now (assuming I didn't mess anything up), these are all just code simplifications that hopefully make it easier to review and maintain going forward. In total I think this reduces the change size in CounterGroup.cs by ~30%.
- With the addition of the AutoResetEvent the ManualResetEvent is no longer needed, removed it.
- Removed the various if foo != null checks for the shared state, it is all initialized once when then thread is created and then assumed to be non-null elsewhere.
- Removed a 2nd lock acquisition inside OnTimer
- Replaced an if with Math.Min in PollForValues
* fix test
|
|
When we rewrote the async methods implementation with AsyncStateMachineBox, we neglected to call AddToActiveTasks if the debugger is paying attention to tasks. This hasn't mattered as the debugger's support for Tasks hasn't worked for other reasons in .NET Core, but there is now a renewed focus on it, and this is preventing some of that support from working.
This change is a minimal fix to ensure that we're adding the state machine box task when it's created and removing it when it completes. Post-3.0, we should look at overhauling this, e.g. to clean up a lot of this logging and tracking that's done, to use a weak table in order to avoid keeping task objects alive artificially if they're dropped without completing by the developer code, etc.
This only affects when the debugger is attached, as the s_asyncDebuggingEnabled field is only ever set by the debugger.
|
|
The compiler is now analyzing statics. Get compliant.
|
|
* Fix issue 25709
* rename
* Fix regression test
* cleanup
* Code review feedback
* set maxincrement to 3
* test fix
|
|
Late-breaking design change: all events should be declared with nullable delegate types.
|
|
* Remove !s and TODO-NULLABLE comments for [DoesNotReturn]
* Remove !s and TODO-NULLABLE comments for [NotNullIfNotNull]
* Remove !s and TODO-NULLABLE comments for writes via Interlocked.CompareExchange
* Remove !s and TODO-NULLABLE comments for Debug.Assert on fields
* Update/add several TODO-NULLABLE comments
|
|
|
|
If the debugger evaluates a `ValueTask<T>`'s `Result`, that counts as the "you should only consume a `ValueTask<T>`" once, and ends up breaking / hanging / throwing exceptions and other bad stuff while stepping through code in the debugger.
This commit addresses that in two ways:
1. Adds `[DebuggerBrowsable(Never)]` to `Result` to prevent it from showing up in debugger views.
2. Adds a NotifyOfCrossThreadDependency call to its ToString. This prevents the debugger from using ToString to show an implicit representation of the instance, and it forces the developer explicitly trying to access ToString (e.g. in the watch window) to click a button acknowleding the impact.
(Post 3.0, we should consider removing the `ValueTask<T>.ToString()` override altogether.)
|
|
Merge changes from TFS
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
|
|
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
Also update TODO-NULLABLE comments to be more specific where appropriate.
|
|
|
|
Don't spin forever in EventListener when listening for EventPipe data
|
|
|
|
* Fix regression in Timers with long timeouts
Early in .NET Core 3.0, we added an important optimization to significantly reduce lock contention and CPU overheads in situations where lots of timers were firing. The optimization worked by splitting the set of timers into those expected to fire in the very near future and then everything else. However, for really long timers (e.g. > 24 days), due to integer overflows we can accidentally put a long timer onto the short list and cause a timer that shouldn’t fire for days to instead fire in milliseconds. This is not the first such bug we’ve had in Timer, and there is a fair amount of complicated casting (that we sometimes get wrong, obviously) in order to keep the tick count usage within the Int32 domain. This PR addresses the problem (and hopefully others in the future) by switching over to using Int64. We’re already paying to get 64-bit tick counts on both Windows and Unix, so this just removes truncation that was being performed, does a little more addition/comparison with 64-bit values instead of with 32-bit, and stores an Int64 instead of Int32 in each TimerQueueTimer. On 64-bit, this has a 0 increase in memory consumption, as it simply ends up utilizing padding space that was previously in TimerQueueTimer. On 32-bit, it increases memory allocation when creating a Timer by 4 bytes from 80 to 84 (still 3 allocations), but I believe it’s the right trade-off for reduced complexity and bug likelihood.
* Address PR feedback
|
|
|
|
* Add property HardLimitBytes to GCMemoryInfo
This adds a new property HardLimitBytes.
Unlike TotalAvailableMemoryBytes,
this will reflect an explicitly set COMPLUS_GCHeapHardLimit.
It will also reflect the fraction of a container's size that we use,
where TotalAvailableMemoryBytes is the total container size.
Normally, though, it is equal to TotalAvailableMemoryBytes.
Fix #38821
* Remove HardLimitBytes; have TotalAvailableMemoryBytes take on its behavior
* Fix typos
* Separate total_physical_mem and heap_hard_limit
so we can compute highMemoryLoadThresholdBytes and memoryLoadBytes
* Do more work in gc.cpp instead of Gc.cs
* Consistently end names in "Bytes"
|
|
Prep-work for using mainstream IL linker
|
|
|
|
Now that `ArrayList` is in CoreLib, we don't need the copy.
|
|
|
|
* Reduce the default EventPipe circularBufferSize to 10MB for EventListener sessions
* make it a static var instead of random # in the code
|
|
We were missing methods that got added for 3.0. The only LoadContext that works is the default one though.
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
|
|
(#25482)
Fixes https://github.com/dotnet/coreclr/issues/25242
- The issue could be that there is no memory barrier (or in the wrong place) on the thread reading the value, and an old value could be cached and read
|
|
|
|
Enum.HasFlag generates bigger IL and depends on complex JIT optimization for a good code.
The classic bit check is strongly preferred accross CoreCLR and CoreFX.
|