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
syscall: Peername() does not work on socketpair sockets on Illumos #53739
Comments
CC @golang/solaris |
Have you tried switching from using |
zrepl actually uses |
I think the culprit is https://github.com/golang/sys/blob/master/unix/syscall_solaris.go#L432 which means that the switch at https://github.com/golang/sys/blob/master/unix/syscall_solaris.go#L398 isn't finding EDIT: When you're using If you add another debug line to the C program printf("sun_family=%d\n", name.sun_family); I get
So it seems to me that on my illumos host, And for completeness, on my linux host, I get
|
It would be cool if we could also CC @golang/illumos for illumos OS issues, rather than the Solaris folks, otherwise we'll miss them until someone points them out to us. |
On Solaris 11.4, the provided C program does indeed return no error for the getpeername() call, but it also sets the returned address length to 0, which appears to be how it indicates you've hit this case specified in both the Solaris man page and the Unix/POSIX standard:
Since there is no address associated with a socket from socketpair(), it's not clear what else it could do here, or what a program could expect it to return. |
Yep, that seems about right. I looked at that code before, but it didn't occur to me to check FWIW I added a workaround in zrepl for this now. So, it's not exactly high priority for me. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
(This is the presumed root cause for zrepl/zrepl#598 )
Take the following code snippet:
What did you expect to see?
On Linux, it prints
On Illumos (
SunOS openindiana 5.11 illumos-e302d6af52 i86pc i386 i86pc
),Getpeername
appears to not workCcompiled with
However, a corresponding C program works fine on both platforms, i.e., the
getpeername
libc call returns no error.Compiled with:
Relevant
truss
of the Go program:Relevant
truss
of the C program:The text was updated successfully, but these errors were encountered: