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
[runtime] AppDomain fixes #5594
Conversation
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.
It mostly look very good, a few changes would be required though.
mono/metadata/remoting.c
Outdated
MonoClass *klass = mono_object_get_class ((MonoObject*)exc); | ||
|
||
if (!(mono_class_get_flags (klass) & TYPE_ATTRIBUTE_SERIALIZABLE)) { | ||
MonoException *ret; |
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.
Does that mean we are loosing the original exception? Is that the behaviour on .NET?
mono/metadata/object.c
Outdated
@@ -4587,7 +4587,9 @@ mono_unhandled_exception_checked (MonoObjectHandle exc, MonoError *error) | |||
MonoObjectHandle current_appdomain_delegate = MONO_HANDLE_NEW (MonoObject, NULL); | |||
|
|||
MonoClass *klass = mono_handle_class (exc); | |||
if (mono_class_has_parent (klass, mono_defaults.threadabortexception_class)) | |||
if (klass == mono_defaults.threadabortexception_class || | |||
(klass == mono_class_get_appdomain_unloaded_exception_class () && |
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.
It seems like it's the correct behaviour according to the doc https://msdn.microsoft.com/en-us/library/system.appdomainunloadedexception(v=vs.110).aspx#Anchor_6 . A link in the commit or the code would be greatly appreciated for further reference
} | ||
|
||
public static int test_0_unload_reset_abort () { | ||
AppDomain domain = AppDomain.CreateDomain ("test_0_unload_reset_abort"); |
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.
Could you also add tests for the expected behaviour in case of AppDomainUnloadedException in the different cases?
5f4349e
to
0ad9e8e
Compare
…main thread Before we were propagating the abort exception down in the calling domain.
…xception Except for threads started by unmanaged code (like the main thread).
Tests that we can unload domain where the threads reset the abort exception and that this exception is converted to AppDomainUnloadedException in the caller domain.
0ad9e8e
to
1384661
Compare
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.
Just a slight typo in the added test cases, but looking good otherwise
mono/tests/unhandled-exception-9.cs
Outdated
|
||
class Driver | ||
{ | ||
/* expected exit code: 255 */ |
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.
If the expected exit code is 255, why is it in the TESTS_UNHANDLED_EXCEPTION_1_SRC
with expected exit code of 1?
1384661
to
8b959c6
Compare
[runtime] AppDomain fixes Commit migrated from mono/mono@01142a1
Do it like .NET.