-
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
System.ArgumentException: The supplied System.Net.SocketAddress is an invalid size for the System.Net.IPEndPoint end point. (Parameter 'socketAddress') on OSX #102663
Comments
Do you use dual mode sockets? IPv4, IPv6, mix ...? Since you are in |
Yes, this is a typical SocketType.Stream, ProtocolType.Tcp socket that we're listening on. We're binding to an IPv4 address. Given that this happens at random in a test environment, getting it under a debugger or obtaining a core dump is probably not going to be achievable. |
For the dump, I was thinking It is going to be difficult to investigate without more insight. |
Understood. Might take a few weeks, but will work on getting that capability added to our app and a dump when the issue triggers over to you. |
one more thought: Do you run multiple instances on the same port .e.g load balancing? I think I can inject the exception artificially and fix the path e.g. it should bubble up to the caller and not be thrown on thread pool IMHO. With that, it would at least be possible to handle it. |
actually, you claim it is different port, right? In that case I have no clue what another independent instance would matter. |
Yeah, each instance should be listening on its own port. Things do get misconfigured, but I'd expect the Bind call to fail in those instances. In these scenarios, we've successfully bound to and are listening on the port, and we're processing connections from other peers, including this one, just fine, but we're encountering this failure for some calls to AcceptAsync. The multiple-instance thing might be a red herring, but was the only thing I could identify that we'd changed around the time that we first started seeing this. |
Triage: It's not actionable without a repro. We'll look into this more. Moving to the future. |
I'm able to reproduce this error in a debugger within an Orleans project, it's been consistently happening since the start of the project. (Also OSX, no reported error in QA or Prod under Linux) |
However with Rider, I can't get any values on the breakpoint since the 'this' isn't available to me. this._address |
can you share some runable repro @Joshhua5 ... or at least core dump. |
I have a .NET test for my companies product (zeroc-ice/ice) that consistently fail with a similar issue:
I tested agains a local .NET debug build using donet/runtime and I got this assertion:
I'm using macOS arm64
|
I added some tracing in Updating the
@wfurt is there any other info that could help solve the issue? |
could you check what is value of |
The socketAddressLen value is |
the fix was submitted to 10.0/main branch and it should be available via daily builds from here: https://github.com/dotnet/sdk/blob/main/documentation/package-table.md it would be great if anybody can try it and provide feedback. (or grab the 8.0 bits like @pepone did) |
this will be part of 9.0.2 |
Description
We're encountering this exception periodically on OSX via two paths.
Most of the time we see this call stack:
Once we also saw this call stack:
Our application implements its own approach to peer-to-peer communication. This is regularly occurring in our testing environment, where we host multiple instances of our application on the same machine, communicating with each other via different ports.
Reproduction Steps
We unfortunately haven't been able to pinpoint a regularly behavior that causes this to happen.
We appear to have only started seeing this issue once we started hosting multiple instances of our application on the same machine.
Expected behavior
While we can safely handle this exception when we're directly invoking it, the majority of the time looks to be via background processing, which we cannot. We are only aware that this exception is occurring because we have logging attached to the unhandled exception handler.
Actual behavior
This error does not occur, or it is always bubbled up to the AcceptAsync caller, such that we are able to catch and handle it.
Regression?
Not 100% sure, but don't believe that a .NET upgrade materialized this. If at all, it would certainly have been a minor one, as we've been on .NET 8 since last year.
Known Workarounds
Our application looks to successfully communicate with the peer on subsequent attempts.
Configuration
.NET 8.0.3, osx-x64
Operating System
Kernel Version: 23.1.0
Name: Darwin
Raw Description: Darwin 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:28:31 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8112
Other information
No response
The text was updated successfully, but these errors were encountered: