File tree Expand file tree Collapse file tree 3 files changed +21
-9
lines changed
src/Sentry/Platforms/Android Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -160,10 +160,11 @@ internal NativeOptions(SentryOptions options)
160160 /// The default value is <c>SignalHandlerStrategy.Default</c> (enabled).
161161 /// </summary>
162162 /// <remarks>
163- /// When set to <see cref="Android.SignalHandlerStrategy.ChainAtStart"/>, .NET runtimes
164- /// 10.0.100–10.0.301 shipped in .NET SDKs 10.0.0–10.0.3 will crash. The issue was fixed in
165- /// <see href="https://github.com/dotnet/runtime/pull/123346">dotnet/runtime#123346</see>,
166- /// which shipped as .NET runtime 10.0.400 in .NET SDK 10.0.4.
163+ /// .NET runtimes 10.0.0–10.0.3 (.NET SDKs 10.0.100–10.0.301) are not compatible with
164+ /// <see cref="Android.SignalHandlerStrategy.ChainAtStart"/>. On affected versions, the
165+ /// SDK automatically falls back to <see cref="Android.SignalHandlerStrategy.Default"/>.
166+ /// The issue was resolved in .NET runtime 10.0.4 (.NET SDK 10.0.400). See
167+ /// <see href="https://github.com/dotnet/runtime/pull/123346">dotnet/runtime#123346</see>.
167168 /// </remarks>
168169 public SignalHandlerStrategy SignalHandlerStrategy { get ; set ; } = SignalHandlerStrategy . Default ;
169170
Original file line number Diff line number Diff line change @@ -64,7 +64,17 @@ private static void InitSentryAndroidSdk(SentryOptions options)
6464 o . ServerName = options . ServerName ;
6565 o . SessionTrackingIntervalMillis = ( long ) options . AutoSessionTrackingInterval . TotalMilliseconds ;
6666 o . ShutdownTimeoutMillis = ( long ) options . ShutdownTimeout . TotalMilliseconds ;
67- o . SetNativeHandlerStrategy ( options . Native . SignalHandlerStrategy switch
67+ var signalHandlerStrategy = options . Native . SignalHandlerStrategy ;
68+ if ( signalHandlerStrategy == SignalHandlerStrategy . ChainAtStart
69+ && Environment . Version is { Major : 10 , Minor : 0 , Build : < 4 } )
70+ {
71+ options . LogWarning (
72+ "SignalHandlerStrategy.ChainAtStart is not compatible with .NET runtime {0}. " +
73+ "Falling back to SignalHandlerStrategy.Default. Update to .NET runtime 10.0.4 or later." ,
74+ Environment . Version ) ;
75+ signalHandlerStrategy = SignalHandlerStrategy . Default ;
76+ }
77+ o . SetNativeHandlerStrategy ( signalHandlerStrategy switch
6878 {
6979 SignalHandlerStrategy . ChainAtStart => NdkHandlerStrategy . SentryHandlerStrategyChainAtStart ,
7080 _ => NdkHandlerStrategy . SentryHandlerStrategyDefault
Original file line number Diff line number Diff line change @@ -16,10 +16,11 @@ public enum SignalHandlerStrategy
1616 /// signal handler.
1717 /// </summary>
1818 /// <remarks>
19- /// .NET runtimes 10.0.100–10.0.301 shipped in .NET SDKs 10.0.0–10.0.3 crash when used
20- /// with this option. The issue was fixed in
21- /// <see href="https://github.com/dotnet/runtime/pull/123346">dotnet/runtime#123346</see>,
22- /// which shipped as .NET runtime 10.0.400 in .NET SDK 10.0.4.
19+ /// .NET runtimes 10.0.0–10.0.3 (.NET SDKs 10.0.100–10.0.301) are not compatible with
20+ /// this strategy. On affected versions, the SDK automatically falls back to
21+ /// <see cref="Default"/>. The issue was resolved in .NET runtime 10.0.4
22+ /// (.NET SDK 10.0.400). See
23+ /// <see href="https://github.com/dotnet/runtime/pull/123346">dotnet/runtime#123346</see>.
2324 /// </remarks>
2425 ChainAtStart
2526}
You can’t perform that action at this time.
0 commit comments