Skip to content

Don't dispose timers if we're in our UnhandledException handler.#104824

Closed
StephenMolloy wants to merge 968 commits intodotnet:mainfrom
StephenMolloy:bp8_64115_Memcache-UnhandledEx-Timer-Deadlock
Closed

Don't dispose timers if we're in our UnhandledException handler.#104824
StephenMolloy wants to merge 968 commits intodotnet:mainfrom
StephenMolloy:bp8_64115_Memcache-UnhandledEx-Timer-Deadlock

Conversation

@StephenMolloy
Copy link
Copy Markdown
Member

  • Description -
    Timer was updated in 5.0 to improve performance, but is prone to deadlocks when manipulated in an unhandled exception handler. Which MemoryCache does. And MemoryCache is probably more likely to witness unhandled exceptions like OOM than typical code.
  • Customer Impact - The deadlock is preventing a first-party team (Exchange/Substrate) from migrating to .Net 6 and 8.
  • Regression? - From NetFx, yes.
  • Risk Low.

Original Issue: #64115 (and #102666)
.Net 9.0 PR: #103937

System.Runtime.Caching is an OOB package that ships alongside the runtime.

vseanreesermsft and others added 30 commits February 6, 2024 16:23
…otnet#97212)

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20240118.2

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24060.2 -> To Version 8.0.0-beta.24068.2

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…ild 20240122.2 (dotnet#97322)

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 8.0.0-alpha.0.24060.1 -> To Version 8.0.0-alpha.0.24072.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…overnance warning. (dotnet#97882)

Co-authored-by: Parker Bibus <parkerbibus@microsoft.com>
Co-authored-by: Thays Grazia <thaystg@gmail.com>
…ld 20240208.4 (dotnet#98224)

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.24068.2 -> To Version 8.0.0-beta.24108.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…oesn't kick in for Vector2 pre SSE4.1 (dotnet#97074)

* Ensure that the Create(Dot(...)) optimization doesn't kick in for Vector2 pre SSE4.1

* Make sure to use #if defined(...)

* Add missing using

* Fix a type in the test

---------

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
Co-authored-by: David Mason <davmason@microsoft.com>
When inlining a method, all arguments are first copied to new vars. Ldarga is going to be applied on these copies. We were loading the address of the wrong var due to typo.
…ono_gsharedvt_constrained_call (). (dotnet#97721) (dotnet#97850)

Fixes dotnet#97625.

Co-authored-by: Larry Ewing <lewing@microsoft.com>
…) to release/8.0-staging (dotnet#98182)

- Reflection IsAssignableFrom api
- As well as constraint checking
…otnet#97352)

* Move a lock to protect m_pDynamicStaticsInfo

* apply feedback

* cast to LONG

* Fix access to m_pDynamicStaticsInfo (dotnet#97353)

- Remove race condition where it is possible that an updated dynamic statics info pointer is published without ensuring that the data is also considered written.
- Use VolatileLoadWithoutBarrier at the read site (where locks are not taken) to ensure that there are no difficult to examine reads of this pointer.

---------

Co-authored-by: Hyungju Lee <leee.lee@samsung.com>
Co-authored-by: David Wrighton <davidwr@microsoft.com>
…ect behavior on overshift (dotnet#98001) (dotnet#98066)

* Ensure that constant folding for SIMD shifts on xarch follow the correct behavior on overshift

* Ensure we test Sse2.IsSupported
…umber` APIs optimize correctly (dotnet#98159)

* Ensure that the various `Max*Number` and `Min*Number` APIs optimize correctly

* Don't mark the test methods as AO

* Add a missing using statement to the test

---------

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
Co-authored-by: Nikola Milosavljevic <nikolam@microsoft.com>
… operations involving Vector2.One (dotnet#98150)

MultiplyByScalar on ARM64 should not be handled by the same path
as other multiplications since it has different behavior.
…dotnet#97856)

* use ld_classic in ILC build and in build integration

* PR feedback

* Maybe fix the build for non-apple

* Update src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets

PR feedback

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
…ods. (dotnet#98254)

Co-authored-by: Thays Grazia <thaystg@gmail.com>
…dotnet#98249)

We were propagating state from each type in the method signature to the
comparisons for the next type. This resulted in type equivalence checks
being disabled for any parameters that came after a generic parameter.
…7405)

* Update dependencies from https://github.com/dotnet/emsdk build 20240123.1

Microsoft.SourceBuild.Intermediate.emsdk , Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100
 From Version 8.0.2-servicing.24062.1 -> To Version 8.0.2-servicing.24073.1

* Update dependencies from https://github.com/dotnet/emsdk build 20240208.3

Microsoft.SourceBuild.Intermediate.emsdk , Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100
 From Version 8.0.2-servicing.24062.1 -> To Version 8.0.3-servicing.24108.3

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
…ate at max iteration limit (dotnet#97927)

* Fix regex lazy loop handling of backtracking state at max iteration limit

Upon entering a lazy loop, state is pushed onto the backtracking stack if the lazy loop might be backtracked into.  That state is then dutifully popped off when unwinding the loop due to failure to match. However, if the loop successfully matches its maximum number of times but still fails because of a failure after the lazy loop, the state still needs to be popped off the stack, but isn't. This fixes that.

* Add a few more test variations

---------

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Nikola Milosavljevic <nikolam@microsoft.com>
@ghost
Copy link
Copy Markdown

ghost commented Jul 12, 2024

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

1 similar comment
@ghost
Copy link
Copy Markdown

ghost commented Jul 12, 2024

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@github-actions github-actions Bot locked and limited conversation to collaborators Aug 12, 2024
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.