-
-
Notifications
You must be signed in to change notification settings - Fork 202
fix(android): mask signal during CHAIN_AT_START to survive chained Mono handler re-raises #1572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
967c4c8
fix: skip SA_NODEFER when CHAIN_AT_START is active
jpnurmi 8f1f592
Update CHANGELOG.md
jpnurmi e1c7799
Revert "fix: skip SA_NODEFER when CHAIN_AT_START is active"
jpnurmi c13706d
fix: mask signal during CHAIN_AT_START to prevent re-raise from killi…
jpnurmi 46049f2
Update CHANGELOG.md
jpnurmi 97bd7a8
fix: use raw syscall for sigtimedwait and correct sigset size
jpnurmi 13a98fa
fix: gate raw syscalls to Android, use sigprocmask elsewhere
jpnurmi b4c3b36
fix: gate signal masking to Android where Mono resets handler and re-…
jpnurmi 0044c23
Update CHANGELOG.md
jpnurmi ae8b07a
Use sizeof(sigset_t) instead of _NSIG/8 for raw syscalls
jpnurmi a40ffcd
test: add Android emulator test for dotnet signal handling (#1574)
jpnurmi 137517b
Bump to API 28 to avoid debuggerd deadlocks
jpnurmi f2e3b6f
Clarify why raw syscall is needed to bypass libsigchain
jpnurmi 176d4af
Revert "Bump to API 28 to avoid debuggerd deadlocks"
jpnurmi 3b3b5e2
fix(inproc): disable CHAIN_AT_START on Android API < 26
jpnurmi 7fcc526
fix(inproc): move CHAIN_AT_START API level check to init
jpnurmi d811108
try 36
jpnurmi 1a03a8c
Revert "try 36"
jpnurmi dd7b4f9
ci: switch Android emulator target back to google_apis
jpnurmi 88dcbf0
fix(inproc): use clone(CLONE_VM) for CHAIN_AT_START on Android
jpnurmi dc83356
Revert "fix(inproc): use clone(CLONE_VM) for CHAIN_AT_START on Android"
jpnurmi d8e92a1
fix(inproc): use raw SYS_rt_sigaction to restore handler on Android
jpnurmi 682f5a9
fix(tests): replace `pm clear` with force-stop + run-as on Android
jpnurmi ee61610
fix(tests): filter Android logcat by app PID
jpnurmi 3ba6a33
fix(inproc): use sigaction() instead of raw SYS_rt_sigaction
jpnurmi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| <!-- Prevent MSBuild from using parent Directory.Build.props --> | ||
| <Project /> |
31 changes: 31 additions & 0 deletions
31
tests/fixtures/dotnet_signal/Platforms/Android/MainActivity.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| using Android.App; | ||
| using Android.OS; | ||
|
|
||
| // Required for "adb shell run-as" to access the app's data directory in Release builds | ||
| [assembly: Application(Debuggable = true)] | ||
|
|
||
| namespace dotnet_signal; | ||
|
|
||
| [Activity(Name = "dotnet_signal.MainActivity", MainLauncher = true)] | ||
| public class MainActivity : Activity | ||
| { | ||
| protected override void OnResume() | ||
| { | ||
| base.OnResume(); | ||
|
|
||
| var arg = Intent?.GetStringExtra("arg"); | ||
| if (!string.IsNullOrEmpty(arg)) | ||
| { | ||
| var databasePath = FilesDir?.AbsolutePath + "/.sentry-native"; | ||
|
|
||
| // Post to the message queue so the activity finishes starting | ||
| // before the crash test runs. Without this, "am start -W" may hang. | ||
| new Handler(Looper.MainLooper!).Post(() => | ||
| { | ||
| Program.RunTest(new[] { arg }, databasePath); | ||
| FinishAndRemoveTask(); | ||
| Java.Lang.JavaSystem.Exit(0); | ||
| }); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,23 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net10.0</TargetFramework> | ||
| <TargetFrameworks>net10.0</TargetFrameworks> | ||
| <TargetFrameworks Condition="'$(ANDROID_API)' != ''">$(TargetFrameworks);net10.0-android</TargetFrameworks> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup Condition="$(TargetFramework.Contains('-android'))"> | ||
| <ApplicationId>io.sentry.ndk.dotnet.signal.test</ApplicationId> | ||
| <SupportedOSPlatformVersion>21</SupportedOSPlatformVersion> | ||
| <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup Condition="!$(TargetFramework.Contains('-android'))"> | ||
| <Compile Remove="Platforms\Android\**" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup Condition="$(TargetFramework.Contains('-android'))"> | ||
| <AndroidNativeLibrary Include="native\**\*.so" /> | ||
| </ItemGroup> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.