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

[soft-debugger-session] Domain unload type fix. #60

Closed

Conversation

lukaszunity
Copy link
Contributor

Maintain list of loaded assemblies for each domain to remove unloaded types correctly on domain unload.

As discussed in issue #57

…omain to remove unloaded types correctly on domain unload.
…h previous logic. Remove entries from source_to_type on domain unload.
@lukaszunity
Copy link
Contributor Author

I've updated this PR also remove types on Assembly Unload, to match the logic before opening this PR.

@DavidKarlas
Copy link
Member

Why is removal when Assembly Unload event happens needed? Won't UnloadDomain happen soon after?

Only thing that annoys me atm with this PR... is that when 10 assemblies are loaded at start(one after another) of program we will be executing extra SDB commands to fetch assemblies in domains 10 times... Maybe we could lazy fetch domain assemblies 1st time some type is loaded(if code gets too ugly... maybe we can live with existing solution in this PR)

I also noticed that types that need unloading are determined by assembly location...(this is existing code)
Doesn't this mean that if type System.Net.Socket was loaded in DomainRoot and is part of /path/to/System.dll will be unloaded when some other AppDomain is unloaded, which shouldn't be?

@lukaszunity
Copy link
Contributor Author

You are right that types might be incorrectly unloaded in the wrong domain and in fact, if the some other AppDomain contains all the assemblies that are in DomainRoot, then this PR is equivalent to doing types.Clear() HandleAppDomainUnloadEvents when unloading the other domain.

I don't think there is an good way to solve this issue domain unload issue without updating the debugger agent to send the domain ids for type loads.

I will fix this enum evalution issue in our own fork with a work-around and then revisit the issue with a the proper fix in the future.

@lukaszunity lukaszunity closed this Sep 4, 2015
@lukaszunity lukaszunity deleted the domain-unload-fix-master branch September 4, 2015 08:35
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.

2 participants