-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Unhandled exception from AcceptCompletionCallback #108026
Comments
This report is not actionable for us without knowing more about the scenario when the exception occurred. Does this exception happen frequently? Are you able to reproduce it with some small code example you could share with us? |
This is happening on macOS, when accepting IPv6 TCP connections. I thought there is a bug here because .NET runtime not handling the exception and as a result the callback passed to The underlying cause is probably the same as |
We haven't understood the root cause of #81437. In fact, it has likely stopped occurring in our CI or the frequency is so low, it's below of our radar. You haven't answered the questions from #108026 (comment). Does the error happen sporadically or predictably? Any code you can possibly share? Any chance for creating a self-contained repro?
Are you using DualMode listener sockets (created by |
Sure, I can try with some custom code. |
@pepone you should be able to download the OSX ARM64 build artifacts (Debug) from https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_apis/build/builds/820467/artifacts?artifactName=libraries_bin_osx_x64_Debug&api-version=7.1&%24format=zip. you need only the System.Net.Sockets.dll from the testhost/shared/... directory. In case you have problems accessing the above url, I attached the relevant files here directly Publish app as self-contained and overwrite the System.Net.Sockets.dll in the publish output to test the change. |
With this PR I hit an assert instead of getting the unhandled exception:
To make this easy to reproduce I run my test while I also stress the CPU with |
I guess that make sense runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Unix.cs Line 38 in 008ee9f
That one is not in release builds and blows up later. I'll update the PR to pass through that. |
No more asserts with the latest build. I think we still need a workaround as proposed in #102663, otherwise when this happens the socket wont be able to accept the connection. |
I don't have repro in my hands ... but I don't think we need to. From what I saw the If you observer something else please let me know |
I will try to get more details on this part a comment on the other issue or open a new one. The unhandled exception part seems to be fixed with your PR. |
I'll get it to |
After reading #102663 (comment), I'm wondering if |
This should be fixed by the PR-s linked above. |
The exception is similar to the one from #81437, but this might indicate a different problem, exceptions from
FinishOperationAccept
are not handled.The text was updated successfully, but these errors were encountered: