-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[threads] Delay abort via handler block guard when in abort protected block. #7599
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
monojenkins
merged 4 commits into
mono:master
from
lambdageek:abort-cctor-no-protection
Mar 20, 2018
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9b3893f
[tests] Class should be viable even if cctor is aborted in in nested …
lambdageek b073459
[tests] Run abort-cctor.exe on the coop Jenkins job
lambdageek 92042c9
[threads] Delay abort via handler block guard when in abort protected…
lambdageek 43415f5
[threads] Add mono_uninstall_current_handler_block_guard
lambdageek 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
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 |
|---|---|---|
|
|
@@ -117,6 +117,7 @@ static void mono_raise_exception_with_ctx (MonoException *exc, MonoContext *ctx) | |
| static void mono_runtime_walk_stack_with_ctx (MonoJitStackWalk func, MonoContext *start_ctx, MonoUnwindOptions unwind_options, void *user_data); | ||
| static gboolean mono_current_thread_has_handle_block_guard (void); | ||
| static gboolean mono_install_handler_block_guard (MonoThreadUnwindState *ctx); | ||
| static void mono_uninstall_current_handler_block_guard (void); | ||
|
|
||
| static gboolean | ||
| first_managed (MonoStackFrameInfo *frame, MonoContext *ctx, gpointer addr) | ||
|
|
@@ -232,6 +233,7 @@ mono_exceptions_init (void) | |
| cbs.mono_raise_exception_with_ctx = mono_raise_exception_with_ctx; | ||
| cbs.mono_exception_walk_trace = mono_exception_walk_trace; | ||
| cbs.mono_install_handler_block_guard = mono_install_handler_block_guard; | ||
| cbs.mono_uninstall_current_handler_block_guard = mono_uninstall_current_handler_block_guard; | ||
| cbs.mono_current_thread_has_handle_block_guard = mono_current_thread_has_handle_block_guard; | ||
| cbs.mono_clear_abort_threshold = mini_clear_abort_threshold; | ||
| cbs.mono_above_abort_threshold = mini_above_abort_threshold; | ||
|
|
@@ -2955,10 +2957,10 @@ install_handler_block_guard (MonoJitInfo *ji, MonoContext *ctx) | |
| break; | ||
| } | ||
|
|
||
| /*no matching finally */ | ||
| if (i == ji->num_clauses) | ||
| return; | ||
| /*no matching finally - can't happen, we parallel the logic in find_last_handler_block. */ | ||
| g_assert (i < ji->num_clauses); | ||
|
|
||
| g_message (" installed handler block guard at %p\n", ip); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. escaped debug line? |
||
| /*Load the spvar*/ | ||
| bp = (guint8*)MONO_CONTEXT_GET_BP (ctx); | ||
| *(bp + clause->exvar_offset) = 1; | ||
|
|
@@ -2996,6 +2998,15 @@ mono_install_handler_block_guard (MonoThreadUnwindState *ctx) | |
| return TRUE; | ||
| } | ||
|
|
||
| static void | ||
| mono_uninstall_current_handler_block_guard (void) | ||
| { | ||
| MonoJitTlsData *jit_tls = (MonoJitTlsData *)mono_tls_get_jit_tls (); | ||
| if (jit_tls) | ||
| jit_tls->handler_block = NULL; | ||
| } | ||
|
|
||
|
|
||
| static gboolean | ||
| mono_current_thread_has_handle_block_guard (void) | ||
| { | ||
|
|
||
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
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.
What about renaming
mono_thread_set_interruption_requestedto followmono_thread_set_self_interruption_respect_abort_prot?This would allow us to get rid of the weird
_flagsvariant.