Skip to content

clr_loader should not by default shutdown runtime at_exit #26

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
lostmsu opened this issue Mar 3, 2022 · 5 comments
Closed

clr_loader should not by default shutdown runtime at_exit #26

lostmsu opened this issue Mar 3, 2022 · 5 comments
Assignees

Comments

@lostmsu
Copy link
Member

lostmsu commented Mar 3, 2022

The caveats are:

@filmor
Copy link
Member

filmor commented Mar 4, 2022

I can confirm that the referenced issue does not occur when we disable the mono_jit_cleanup call as part of the atexit calls.

@lostmsu
Copy link
Member Author

lostmsu commented Mar 4, 2022

@filmor here are my test results:

  • AppDomain.ProcessExit and AppDomain.DomainUnload are not even called currently, which is a surprise
  • critical finalizers are currently invoked, but will not be invoked if we skip mono_jit_cleanup. That is concerning. The same actually applies to regular finalizers.

@lostmsu
Copy link
Member Author

lostmsu commented Mar 8, 2022

@filmor I am getting trouble debugging Linux+Mono combo. Considering atexit is still a viable option, I suggest we turn the mono_jit_cleanup off. If I could come up with a fix, it would still be a hack and can break with a new Mono or Python version anyway.

Not invoking .NET finalizers on shutdown should be documented though.

@lostmsu
Copy link
Member Author

lostmsu commented Mar 25, 2022

@filmor are you working on this? If not, I can submit a PR.

@lostmsu
Copy link
Member Author

lostmsu commented Apr 8, 2022

Instead, we improved the shutdown procedure in pythonnet/pythonnet#1712

@lostmsu lostmsu closed this as completed Apr 8, 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

No branches or pull requests

2 participants