-
Notifications
You must be signed in to change notification settings - Fork 18k
syscall: problem with unix domain sockets under NetBSD-6.99.x #6627
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
Labels
Comments
Hi, Do you have a spare time to dig up the root cause of this issue? Pretty interesting that: > got &net.UnixAddr{Name:"/tmp/nettest27526054", Net:"unix"}, expected &net.UnixAddr{Name:"/tmp/nettest275260547", Net:"unix"} > got &net.UnixAddr{Name:"/tmp/nettest35841834", Net:"unixgram"}, expected &net.UnixAddr{Name:"/tmp/nettest358418349" funny, the last char of filepath was eaten by Bogeyman? |
Comment 3 by tk@giga.or.at: For Unix sockets, Linux sets sock_addrlen to the strlen(sun_path)+1 to include the trailing zero, while NetBSD sets it to strlen(sun_path). That sounds like it could probably cause this difference, doesn't it? |
Maybe http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/uipc_usrreq.c.diff?r1=1.145&r2=1.146&only_with_tag=MAIN&f=h If so, we need to have a separate RawSockaddrUnix handler for NetBSD 7.x (NetBSD-6.99.x) in the near future. Labels changed: added go1.3maybe, removed priority-triage. |
Looking at it in ktrace, the following happens: 18022 1 unixtest CALL bind(3,0xc21004a090,0x11) 18022 1 unixtest MISC mbsoname: [/tmp/unixtest] 18022 1 unixtest NAMI "/tmp/unixtest" 18022 1 unixtest RET bind 0 18022 1 unixtest CALL listen(3,0x80) 18022 1 unixtest RET listen 0 18022 1 unixtest CALL getsockname(3,0xc21004c070,0xc210000090) 18022 1 unixtest MISC mbsoname: [/tmp/unixtest] 18022 1 unixtest RET getsockname 0 18022 1 unixtest GIO fd 2 wrote 49 bytes "2013/11/18 12:43:35 Listening; addr=/tmp/unixtes\n" So the truncation happens when reading the output of getsockname. |
https://golang.org/cl/28300043/ fixes the off-by-one in Getsockname but there is more to it than that. If you apply it, UnixListener.Accept returns "invalid argument". https://gist.github.com/bsiegert/7527628 is my simple test program. |
This issue was closed by revision d180579. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: