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

Gocode: panic: listen unix /tmp/gocode-daemon: setsockopt: invalid argument #568

Closed
tirpen opened this issue Jun 23, 2016 · 7 comments
Closed
Labels

Comments

@tirpen
Copy link

tirpen commented Jun 23, 2016

This is Microsoft Windows 10.14366. Golang 1.6.2

gocode
dial unix /tmp/gocode-daemon.$USER: setsockopt: invalid argument

gocode -s debug
panic: listen unix /tmp/gocode-daemon.aschneider: setsockopt: invalid argument

goroutine 1 [running]:
panic(0x91d1a0, 0xc82006ee10)
/usr/local/go/src/runtime/panic.go:481 +0x3e6
main.new_daemon(0x99b4f8, 0x4, 0xc8200c7ce0, 0x1d, 0x43cc01)
/home/$USER/.go/src/github.com/nsf/gocode/server.go:69 +0x110
main.do_server(0x0)
/home/$USER/.go/src/github.com/nsf/gocode/server.go:38 +0x309
main.main()
/home/$USER/.go/src/github.com/nsf/gocode/gocode.go:67 +0x5f

@sunilmut
Copy link
Member

Thanks for reporting the issue. I collected a strace and it appears that gocode is trying to set the SO_BROADCAST option on the UNIX socket, which unfortunately WSL does not support currently.
socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3 setsockopt(3, SOL_SOCKET, SO_BROADCAST, [1], 4) = -1 EINVAL (Invalid argument)

I have opened a bug for this, but it won't make the cut for the Anniversary update release. But, it should get fixed post that. If you can also post what is that you are trying to do with gocode, then when the bug gets fixed, we can validate the rest of your workflow also.

And, thanks for trying out WSL!

@tirpen
Copy link
Author

tirpen commented Jun 23, 2016

Hi. Thank you for taking this into account.

Gocode is called by deoplete-go inside nvim to provide code completion. It is a common workflow for Go development both in Mac and Linux.

@therealkenc
Copy link
Collaborator

I don't use vim or go, but gocode -sock="tcp" starts.

@oparoz
Copy link

oparoz commented Aug 13, 2016

@sunilmut

Here is the use case for me

# sudo snap install nextcloud
2016/08/13 11:20:42.752488 main.go:170: WARNING: can not create syslog logger
error: cannot communicate with server: Post http://localhost/v2/snaps/nextcloud: dial unix /run/snapd.socket: setsockopt: invalid argument

@russalex
Copy link
Contributor

russalex commented Sep 1, 2016

Try gocode on build 14915. We added support for SO_BROADCAST so that should help. I was able to do an apt-get install gocode and run gocode with no errors.

I should point out that we do not support snap apps.

@sunilmut
Copy link
Member

sunilmut commented Sep 1, 2016

@oparoz - Thanks. If you can collect a strace of the failing command strace -o <trace_file> -ff <command> and share out the trace file, we can see what socket option the command is failing at. Also, do try it on 14915.

@tirpen
Copy link
Author

tirpen commented Sep 3, 2016

Our Gocode + nvim use cases work as intended after 14915, @russalex.

Thank you for addressing this.

@tirpen tirpen closed this as completed Sep 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants