forked from mono/mono
-
Notifications
You must be signed in to change notification settings - Fork 520
[w32process] clear lazy init class pointers when system image changes #1168
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
Closed
Conversation
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 change builds the class library code to implement the `NamedPipeClientStream` class in the unityaot profile on Windows. For the time being, we will not implement this class for non-Windows platforms, since that requires the Mono.Posix.dll assembly and a native library as well. We may consider adding support on Posix platforms in the future.
On macOS and FAT32 partitions, we will sometimes get this inode value for more than one file. It means the file is empty. When this happens, the hash table of file shares becomes corrupt, since more then one file has the same inode. Instead, let's assume it is always fine to share empty files. (Unity case 950616).
…s to find it fine.
…_current () and invoke_method (). (mono#13362) Fixes mono#13261.
Previously, 5174f7e was an attempt to correct this issue. However, the `#define` scheme for Mono changed since then, so `PLATFORM_MACOSX` became `HOST_DARWIN`. This change uses the proper define to correct Unity case 1166108.
e4588ad
to
6941df6
Compare
@corngood I ended up fixing this by just removing the caching as it's not really needed. This could never really work with appdomains as is. Unity: #1237 Upstream PR: mono#17602 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Running a debug build of unity/mono, and opening a project which has dirty scripts results in the following:
stash_system_image
is calledget_process_module_class
is called, which lazy initsprocess_module_class
to the loaded ProcessModuleprocess_module_class
stash_system_image
is called againget_process_module_class
is called again, which returns a pointer to the dead object, resulting in a crashThis is the fix I'm currently testing. I haven't yet investigated the threading/atomic requirements of doing this.
Also, there are other similar patterns (e.g. https://github.com/Unity-Technologies/mono/blob/unity-master/mono/metadata/threadpool.c#L168) which look like they would suffer from the same problem. I'm not sure how these would work.
Anyone know how these lazy inits are supposed to survive app domain destruction?
The stack trace where the particular class object is destroyed is: