-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Diagnostics] Serialize concurrent reporters in InProc Crash Reporter #130436
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
mdh1418
wants to merge
1
commit into
dotnet:main
Choose a base branch
from
mdh1418:inproc_crashreport_multisignal_race
base: main
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.
+19
−4
Open
Changes from all commits
Commits
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CreateDump have a serialize flag that gets set through PROCCreateCrashDumpIfEnabled when called from a location that should serialize the threads, we should use the same flag here.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing to consider, in case we call in-proc crash reporter from invoke_previous_action and g_crash_report_before_signal_chaining has been enabled, we get called before chained signal handlers gets called. The scenario is explicitly created when you have a signal handler that is not DFL, but always tear downs the process, like calling the debugger daemon on Android, serializing the in-proc crash reporters in that case is probably OK, since no other crash handlers should appear in the chain, but if they do, then we can't serialize threads, since they need to call the chained signal handler and we might create an in-proc report for something that ends up being a handled signal. So, g_crash_report_before_signal_chaining can't be used unless the app explicitly knows that any signal handler won't handle the signal, because it will then have blocked all other threads from reaching that point and produced a "false" in-proc crash report. On Android this is normally fine, since the debugger daemon signal handler is in the list, but there is no guarantee there won't be a signal handler before that that would handle/ignore it. In scenarios like that the only reasonable way is to not using g_crash_report_before_signal_chaining and let the chained signal handler run first, but on Android that will lead to debugger daemon signal handler terminating the process before any in-proc crash reports have been generated.