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

Do not access unloading domains in debugger (case 1013579) #1270

Merged
merged 1 commit into from
Mar 13, 2020

Conversation

joncham
Copy link
Member

@joncham joncham commented Mar 13, 2020

There was a race where a domain was being unloaded while debugger would access it. A domain was only removed from the 'appdomains_list' as a very last step. The domain was already invalid to access at this point (locks freed for example).

Worse, images would be unloaded if only referenced by that domain. All places the debugger iterates domains hold the loader lock. The loader lock is acquired by the domain unloading process, so as long as a domain is not unloading when we access it inside of the loader lock we are safe.

Unity:
Release Notes:
Fixed case 1013579:
Scripting: Fix crash in debugger during enter playmode.

Backporting:
2020.1, 2019.4, and perhaps 2018.4

There was a race where a domain was being unloaded while debugger would access it. A domain was only removed from the 'appdomains_list' as a very last step. The domain was already invalid to access at this point (locks freed for example).

Worse, images would be unloaded if only referenced by that domain. All places the debugger iterates domains hold the loader lock. The loader lock is acquired by the domain unloading process, so as long as a domain is not unloading when we access it inside of the loader lock we are safe.
@joncham joncham requested a review from UnityAlex March 13, 2020 19:19
@joncham joncham self-assigned this Mar 13, 2020
@joncham joncham merged commit e1555ac into unity-master Mar 13, 2020
@joncham joncham deleted the unity-master-fix-1013579 branch March 13, 2020 21:21
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