-
-
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
Open
jpnurmi
wants to merge
13
commits into
master
Choose a base branch
from
jpnurmi/fix/sa-nodefer-chain-at-start
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+346
−21
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
91afd1a
fix: skip SA_NODEFER when CHAIN_AT_START is active
jpnurmi ab26763
Update CHANGELOG.md
jpnurmi 66b86a6
Revert "fix: skip SA_NODEFER when CHAIN_AT_START is active"
jpnurmi b25f91d
fix: mask signal during CHAIN_AT_START to prevent re-raise from killi…
jpnurmi 57a447a
Update CHANGELOG.md
jpnurmi 986a153
fix: use raw syscall for sigtimedwait and correct sigset size
jpnurmi a804de3
fix: gate raw syscalls to Android, use sigprocmask elsewhere
jpnurmi 15f69be
fix: gate signal masking to Android where Mono resets handler and re-…
jpnurmi 15b5960
Update CHANGELOG.md
jpnurmi 3ad83bb
Use sizeof(sigset_t) instead of _NSIG/8 for raw syscalls
jpnurmi 9547e67
test: add Android emulator test for dotnet signal handling (#1574)
jpnurmi b20d459
Bump to API 28 to avoid debuggerd deadlocks
jpnurmi ef5b4f1
Clarify why raw syscall is needed to bypass libsigchain
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
Some comments aren't visible on the classic Files Changed page.
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.