Skip to content
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

Merged
merged 6 commits into from Sep 22, 2017
Merged

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Sep 15, 2017

Do it like .NET.

Copy link
Contributor

@luhenry luhenry left a 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.

MonoClass *klass = mono_object_get_class ((MonoObject*)exc);

if (!(mono_class_get_flags (klass) & TYPE_ATTRIBUTE_SERIALIZABLE)) {
MonoException *ret;
Copy link
Contributor

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?

@@ -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 () &&
Copy link
Contributor

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");
Copy link
Contributor

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?

@BrzVlad BrzVlad force-pushed the fix-domain-abort-hang branch 2 times, most recently from 5f4349e to 0ad9e8e Compare September 19, 2017 23:12
…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.
Copy link
Contributor

@luhenry luhenry left a 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


class Driver
{
/* expected exit code: 255 */
Copy link
Contributor

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?

@BrzVlad BrzVlad merged commit 01142a1 into mono:master Sep 22, 2017
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants