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

net: Accept4 issues with old Linux 2.6 kernels #7271

Closed
gopherbot opened this issue Feb 5, 2014 · 6 comments
Closed

net: Accept4 issues with old Linux 2.6 kernels #7271

gopherbot opened this issue Feb 5, 2014 · 6 comments
Milestone

Comments

@gopherbot
Copy link

by todd.richmond:

Go 1.1 and 1.2 both fail to listen on old, early rev Linux kernels such as those found
on QNAP NAS boxes running any modern version of their firmware

Accept4 is not available on those systems, but for some reason arm
and amd64 kernels are returning different errors so checks for both EACCES and EFAULT are
both required. A Go web server will fallback correctly to the accept() call with this
check

Line 48 of src/pkg/net/sock_cloexec.go

if err == nil || (err != syscall.EACCES && err != syscall.EFAULT && err
!=
syscall.ENOSYS && err != syscall.EINVAL) {
@davecheney
Copy link
Contributor

Comment 1:

How old are we talking here ?

@gopherbot
Copy link
Author

Comment 2 by todd.richmond:

QNAP kernels from the currently shipping firmwares are 2.6.33.2 - something like 7 years
out of date! It looks like the firmware they have just started shipping (manual
downloads only, not automatic) are 3.x and will work fine. However, I'm not sure they
will update all their previous hardware systems because many of those have less internal
memory
This fix is safe regardless because if something was wrong, it would be caught again in
the fallback accept() call

@davecheney
Copy link
Contributor

Comment 3:

That should be ok. Going much earlier would lead to problems with sync/atomic as they
were broken before 2.6.29 and really broken before 2.6.27

Labels changed: added release-go1.3, repo-main, arch-arm.

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Apr 3, 2014

Comment 4:

https://golang.org/cl/84170043

@gopherbot
Copy link
Author

Comment 5 by todd.richmond:

that switch statement will also work - just a bit harder to follow as it's more
customary to use multiple cases with a final break instead of default being first and
having the remaining fall off the bottom. Does save 1 line of text though ;) - and
executes the same

@rsc
Copy link
Contributor

rsc commented Apr 3, 2014

Comment 6:

This issue was closed by revision 5fb39cc.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants