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

Finally block not called on unhandled exception on Linux #8145

Closed
nickwalkmsft opened this issue May 17, 2017 · 2 comments
Closed

Finally block not called on unhandled exception on Linux #8145

nickwalkmsft opened this issue May 17, 2017 · 2 comments
Labels
area-ExceptionHandling-coreclr os-linux Linux OS (any supported distro)

Comments

@nickwalkmsft
Copy link

See http://stackoverflow.com/questions/44032931/net-core-unhandled-exception-in-using-does-not-call-dispose-on-linux

On Linux, finally{} blocks do not appear to be executed on exceptions that go completely uncaught. On Windows, the finally{} runs, but not for ~20 seconds after the exception text is written to the console.

@janvorli
Copy link
Member

@nickwalkmsft this is an expected behavior. On Windows, it really depends on how you have Watson set up. You can get the same behavior as on Linux there as well.
If you care about finallys being run in case of unhandled exception, you can always add try / catch at the topmost level of your app / thread to ensure that.

@nickwalkmsft
Copy link
Author

Interesting, thanks!

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
phil-harmoniq added a commit to phil-harmoniq/CliToolkit that referenced this issue Aug 6, 2020
@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-ExceptionHandling-coreclr os-linux Linux OS (any supported distro)
Projects
None yet
Development

No branches or pull requests

2 participants