-
Notifications
You must be signed in to change notification settings - Fork 18k
net: listen tcp: errno -9 #23446
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
Comments
Which kernel is your system running? |
@davecheney The router is running tomatousb firmware. The kernel is a custom
If I'm not mistaken, kernel sources can be found here, and config is here |
I don’t know the exact minimum kernel version MIPS needs but I suspect the problem you have is your kernel doesnt support accept4. Again the details are sketchy, but it’s the version of accept that supports passing the close on accept flag.
Look in the net package for calls to syscall.Accept and then patch as appropriate. There may be some fallback code from the days we didn’t support rhel5, but still tried anyway.
… On 16 Jan 2018, at 07:06, alllexx88 ***@***.***> wrote:
@davecheney The router is running tomatousb firmware. The kernel is a custom 2.6.22.19 kernel:
***@***.*** root]$ uname -a
Linux unknown 2.6.22.19 #33 Sun Jun 26 17:47:11 CEST 2016 mips GNU/Linux
If I'm not mistaken, kernel sources can be found here, and config is here
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@davecheney Looks like my kernel indeed doesn't support |
I take it that there is nothing to fix in Go about this, then? Or should the minimum requirements for this case be better specified somewhere? In any case, https://github.com/golang/go/wiki/MinimumRequirements does mention 2.6.23, and this post refers to 2.6.22. |
The minimum kernel version of non intel platforms is higher than 2.6.23.
Maybe we should document the sys calls we need, accept4(1), etc, rather
than the kernel version.
…On 16 January 2018 at 08:20, Daniel Martí ***@***.***> wrote:
I take it that there is nothing to fix in Go about this, then? Or should
the minimum requirements for this case be better specified somewhere?
In any case, https://github.com/golang/go/wiki/MinimumRequirements does
mention 2.6.23, and this post refers to 2.6.22.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#23446 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAcA09GU6v6-3j5BlQqMvwz8MMRupDeks5tK8ElgaJpZM4Redmg>
.
|
Please no. That will help a very certain type of user, but not most users. Most users know their kernel version but don't know what system calls their kernel supports. If anything, any system calls assumed to be present by Go should perhaps throw on ENOSYS with |
@davecheney Looks like it's not
I grepped for
Probably you are correct, though I still don't know why Thanks |
According to https://github.com/golang/go/wiki/MinimumRequirements for little-endian mips64 you need a kernel newer than 4.1. No specific requirements are listed for little-endian 32-bit mips, but it seems very likely that 2.6.22 is too old. Errno 9 is |
The errno -9 is similar to #14297. It is 9, EBADF. go/src/runtime/netpoll_epoll.go Line 47 in 99e6e48
I can reproduce the issue on MIPS Linux 2.6.18. |
Change https://golang.org/cl/89235 mentions this issue: |
@crvv Thank you for clarifying things! 👍 So it's a |
@alllexx88 There's really nothing we can do if the |
@ianlancetaylor I'm still interested in finding a workaround, but this issue can be closed, I think. Thank you all. |
The caller of epollctl expects it to return a negative errno value, but it returns a positive errno value on mips, mips64 and ppc64. The change fixes this. Updates #23446 Change-Id: Ie6372eca6c23de21964caaaa433c9a45ef93531e Reviewed-on: https://go-review.googlesource.com/89235 Reviewed-by: Carlos Eduardo Seo <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
Change https://golang.org/cl/125895 mentions this issue: |
This error was caused by |
The linux syscall functions used in runtime are designed around the calling convention of returning errors as negative numbers. On some other systems (like mips and ppc) the actual syscalls signal errors in other ways. This means that the assembly implementations of the syscall functions on these platforms need to transform the return values in the error cases to match the expected negative errno values. This was addressed for certain syscalls in https://golang.org/cl/19455 and https://golang.org/cl/89235. This patch handles the rest of the syscall functions in sys_linux_*.s that return any value for mips/mips64/ppc64. Fixes #23446 Change-Id: I302100261231f76d5850ab2c2ea080170d7dba72 GitHub-Last-Rev: e358e2b GitHub-Pull-Request: #26606 Reviewed-on: https://go-review.googlesource.com/125895 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
What version of Go are you using (
go version
)?go1.10beta2
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
Ran this code
What did you expect to see?
No output
What did you see instead?
listen tcp :8080: errno -9
I'm trying to get Go programs to run on a softfloat mips32r2 router. The first issue I encountered was
pipe2
syscall not being supported by the kernel, so I wrote a patch to usepipe
syscall plusfcntl
instead (see mips_no_pipe2.patch). Now I'm facing this issue withnet.Listen
always failing. Any help or hints on how to debug this are appreciated.Thanks,
Alex
The text was updated successfully, but these errors were encountered: